Skip to content

Releases: MarshalX/atproto

v0.0.35

21 Dec 18:57
ba0a47d
Compare
Choose a tag to compare

❗Breaking changes

SDK was split into many packages. This affects imports in your codebase. Read more

What's Changed

Full Changelog: v0.0.34...v0.0.35

v0.0.34

17 Dec 16:48
0d7cd96
Compare
Choose a tag to compare

What's Changed

  • Make SDK more backward and forward-compatible with protocol by @MarshalX in #207
  • Add plenty of new high-level methods by @MarshalX in #208
    • Documentation
    • Breaking changes:
      • unlike now accepts AT URI instead of record_key and profile_identify
    • New methods:
      • get_post
      • get_posts
      • get_post_thread
      • get_likes
      • get_reposted_by
      • get_timeline
      • get_author_feed
      • unrepost AKA delete_report
      • follow
      • unfollow AKA delete_follow
      • get_follows
      • get_followers
      • get_profile
      • get_profiles
      • mute
      • unmute
      • resolve_handle
      • update_handle
      • upload_blob
  • Migrate lexicon parser from dacite to pydantic; enable ruff ANN by @MarshalX in #206
    • Removed exceptions:
      • UnknownPrimitiveTypeError
      • UnknownDefinitionTypeError
    • Renamed fields:
      • schema -> schema_
      • maxLength -> max_length
      • ... and all other camelCase names now in snake_case

Full Changelog: v0.0.33...v0.0.34

v0.0.33

13 Dec 09:39
4dc0695
Compare
Choose a tag to compare

What's Changed

  • Update lexicons fetched from 0c54951 committed 2023-12-12T21:37:06Z by @MarshalX in #202
  • Update changelog for v0.0.32 by @MarshalX in #199

Full Changelog: v0.0.32...v0.0.33

v0.0.32

11 Dec 13:41
2d1384e
Compare
Choose a tag to compare

What's Changed

  • Add text builder as helper for constructing rich text by @MarshalX in #194

Docs: https://atproto.blue/en/latest/text_builder.html

Create rich text using TexBuilder:

from atproto.utils import TextBuilder
text_builder = TextBuilder()
text_builder.tag('This is a rich message. ', 'atproto')
text_builder.text('I can mention ')
text_builder.mention('account', 'did:plc:kvwvcn5iqfooopmyzvb4qzba')
text_builder.text(' and add clickable ')
text_builder.link('link', 'https://atproto.blue/')

or

from atproto.utils import TextBuilder

text_builder = TextBuilder().text('Test msg using ').link('Python SDK', 'https://atproto.blue/')

and send it

from atproto import Client
from atproto.utils import TextBuilder

client = Client()
client.send_post(TextBuilder().link('Python SDK', 'https://atproto.blue/'))

Full Changelog: v0.0.31...v0.0.32

v0.0.31

02 Dec 22:39
6c2bbf7
Compare
Choose a tag to compare

What's Changed

  • Migrate firehose to new relay URI by @MarshalX in #190
  • Update lexicons fetched from 8d9b1f7 committed 2023-12-01T20:28:54Z by @MarshalX in #189
  • Update changelog for v0.0.30 by @MarshalX in #184

Full Changelog: v0.0.30...v0.0.31

v0.0.30

06 Nov 10:43
dacea8f
Compare
Choose a tag to compare

What's Changed

  • Add Python 3.12; migrate from black to ruff format by @MarshalX in #177
  • Async Firehose Client: block on make message handler call, add on error callback by @DXsmiley in #157
  • Downgrade sphinxext-opengraph to clean up the tree of dependencies (including vulnerable) by @MarshalX in #179
  • Update lexicons fetched from 46b108c committed 2023-10-26T22:29:51Z by @MarshalX in #178
  • Update lexicons fetched from 772736a committed 2023-11-02T20:16:26Z by @MarshalX in #182
  • Update changelog for v0.0.29 by @MarshalX in #173
  • Fix type hint of OnMessageCallback (Firehose client) by @MarshalX in #183
  • Fix dependency groups by @MarshalX in #180

Full Changelog: v0.0.29...v0.0.30

v0.0.29

28 Sep 12:58
31eea9a
Compare
Choose a tag to compare

What's Changed

  • Make codegen deterministic by @DXsmiley in #162
  • Add TypedDict for params and data arguments; add type hint for kwargs by @DXsmiley in #166
  • Update lexicons fetched from 41ee177 committed 2023-09-27T21:08:58Z by @MarshalX in #172
  • Update changelog for v0.0.28 by @MarshalX in #156

New Contributors

Full Changelog: v0.0.28...v0.0.29

v0.0.28

16 Sep 14:20
9692ee1
Compare
Choose a tag to compare

What's Changed

  • Add update_params method to firehose clients to fix utilizing the old state on reconnecting by @MarshalX in #149
  • Add the ability to export and import session string by @MarshalX in #154
  • Add the ability to pass base_uri to Firehose clients by @MarshalX in #155
  • Update lexicons fetched from 9879ca9 committed 2023-09-14T20:24:48Z by @MarshalX in #150
  • Update changelog for v0.0.27 by @MarshalX in #146

Full Changelog: v0.0.27...v0.0.28

v0.0.27

13 Sep 19:25
ed27433
Compare
Choose a tag to compare

What's Changed

  • Add reposts support to the firehose process commits example by @MarshalX in #140
  • Add snake to camel and camel to snake case conversion support for DotDict wrapper by @MarshalX in #143
  • Update lexicons fetched from 07bb0da committed 2023-09-12T17:37:57Z by @MarshalX in #144
  • Update dependencies by @MarshalX in #145

Full Changelog: v0.0.26...v0.0.27

v0.0.26 – 40x performance boost; breaking changes

07 Sep 23:09
10a0b43
Compare
Choose a tag to compare

Migration to Pydantic v2 and libipld

All models have been migrated to Pydantic v2. Fields constraints have been added. Decoding of DAG-CBOR, CID and CAR files has been migrated to the brand-new library libipld. This library is powered by Rust and is much faster than the previous implementation. Pydantic v2 also uses Rust in the core. This leads to a significant performance boost.

Firehose catch up benchmark:

  • The previous SDK version: 700 commits in 5 seconds.
  • After migration to Pydantic v2: 2650 commits in 5 seconds.
  • After migration to libipld: 20000 commits in 5 seconds.
  • Using pydantic v2 and libipld with multiprocessing: 30000 commits in 5 seconds.

The new release gives a 40x performance boost! But the cost is a lot of breaking changes.

Example of firehose consumer with multiprocessing: process_commits.py

Test stand for benchmarks: MacBook Pro 2021, Apple M1 Pro, 32 GB RAM, 450mbps connection speed, Python 3.8

❗Breaking changes

  • Python 3.7.0 has been dropped. The minimum supported version is now Python 3.7.1.
  • Camel cased fields are gone. Use snake case instead. For example, createdAt is now created_at.
  • Root namespace has been fixed from bsky to app. For example, Client().bsky.feed.get_likes is now Client().app.bsky.feed.get_likes.
  • Using similar model instances as strong refs is not allowed anymore. Use models.create_strong_ref helper function to convert refs (example).
  • Creating model instances using positional arguments is no longer supported. Use keyword arguments instead. For example, thant's not possible anymore models.ComAtprotoIdentityResolveHandle.Params('marshal.dev'). Use models.ComAtprotoIdentityResolveHandle.Params(handle='marshal.dev') instead.
  • Fields that conflict with reserved Pydantic names has _ (underscore) suffix. For example, validation is now validation_.
  • DotDict has been moved to models.dot_dict.
  • Inheritance of base models has been changed. Please check new base classes.
  • Inheritance of DotDict has been changed. Please check the new base class.
  • BlobRef model doesn't contain to_dict() method anymore.
  • CID class has been reimplemented using libipld lib. It supports much less API.
  • _type field of models has been renamed to py_type. Now it's constant.
  • leb128 module has been removed.
  • Type hint of CID has been changed to CIDType.
  • Type hint of DotDict has been changed to DotDictType.
  • multiformats and dag-cbor dependencies have been removed.
  • These reference classes have been removed:
    • ResponseRef from get_profile. Use models.AppBskyActorDefs.ProfileViewDetailed instead.
    • ResponseRef from get_moderation_action. Use models.ComAtprotoAdminDefs.ActionViewDetail instead.
    • ResponseRef from get_moderation_report. Use models.ComAtprotoAdminDefs.ReportViewDetail instead.
    • ResponseRef from get_record. Use models.ComAtprotoAdminDefs.RecordViewDetail instead.
    • ResponseRef from get_repo. Use models.ComAtprotoAdminDefs.RepoViewDetail instead.
    • ResponseRef from resolve_moderation_reports. Use models.ComAtprotoAdminDefs.ActionView instead.
    • ResponseRef from reverse_moderation_action. Use models.ComAtprotoAdminDefs.ActionView instead.
    • ResponseRef from take_moderation_action. Use models.ComAtprotoAdminDefs.ActionView instead.
    • ResponseRef from create_app_password. Use models.ComAtprotoServerCreateAppPassword.AppPassword instead.
  • These exceptions have been removed:
    • UnexpectedFieldError. Use ModelError instead.
    • MissingValueError. Use ModelError instead.
    • ModelFieldError. Use ModelError instead.
    • WrongTypeError. Use ModelError instead.
    • CBORDecodingError. Use DAGCBORDecodingError instead.

New Features

  • Unit tests for model serialization and deserialization.
  • Nested dictionaries support in DotDict models.
  • DotDict models now support __getitem__ and __setitem__ methods.
  • create_strong_ref helper function to convert ref-like models to strong refs.
  • Fields constraints for models. Now you can see the max items count for the image array, max string length, etc.
  • Better documentation of models.

Minor Changes

  • Fixed nesting of DotDict models.
  • Fixed serialization of Union types.
  • Fixed serialization of Literal types.
  • Fixed sending proper datetime values to the server.
  • Fixed printing tracebacks in the Firehose async client.
  • Fixed chaining of firehose exceptions.
  • Fixed locked and outdated typing-extensions dependency.
  • Fixed passing of arguments to ClientBase.

Full Changelog: v0.0.25...v0.0.26