Skip to content

0.5.0 - next

Choose a tag to compare

@AmaseCocoa AmaseCocoa released this 23 Dec 05:14
· 33 commits to develop since this release
26f40ca

apmodel 0.5.0 ("Next")

This release introduces a major migration to Pydantic, enhancing data validation and serialization. It also includes several new features, bug fixes, and significant improvements to the testing framework and documentation.

💥 Breaking Changes

  • The underlying model implementation has been migrated from dataclasses to Pydantic. This is a significant change that may affect how models are instantiated and manipulated. Please
    review the documentation for details on the new Pydantic-based models.

✨ Features

  • Pydantic Integration: All models are now based on Pydantic, providing robust data validation, serialization, and type hinting.
  • Actor Endpoints: Added endpoints field to the Actor model to store a dictionary of endpoint URLs (e.g., proxyUrl, oauthTokenEndpoint).
  • Likes and Shares: The base Object model now includes likes and shares fields, allowing for easy access to these common collections.
  • LitePub Support: Added support for the EmojiReact object from the LitePub vocabulary.
  • to_dict() Method: A new to_dict() method has been added to models for easy conversion to a dictionary.
  • Performance Improvements:
    • Implemented lazy loading for the ModelRegistry to improve initial import times.
    • Core models are now preloaded for faster resolution.

🐛 Bug Fixes

  • JSON-LD Context: The @context is now always serialized as a list to improve compatibility.
  • Multibase Encoding: Fixed an issue with public key encoding format to use PKCS#8.
  • Collection Handling: Correctly load OrderedCollectionPage and its items.
  • Numerous type annotation fixes to improve static analysis and developer experience.

🧪 Testing

  • Increased Coverage: Expanded test coverage, especially for model properties and serialization.
  • Real-World Data: Added new tests using real-world data from Akkoma, Mastodon, and Misskey to ensure compatibility.
  • Registry Tests: Implemented comprehensive tests for the ModelRegistry.

📚 Documentation

  • New Documentation Site: A new documentation site has been created with mkdocs.
  • Updated README: The project's README.md has been overhauled with more detailed information.
  • API Documentation: Added detailed API documentation for models, functions, and the registry.

⚙️ Internal

  • Developer Environment:
    • Introduced pre-commit hooks to automate dependency synchronization and code analysis with pyrefly.
    • CI workflows have been updated and improved.