Skip to content

v0.0.36

Compare
Choose a tag to compare
@MarshalX MarshalX released this 23 Dec 15:35
· 136 commits to main since this release
2b617c3

What's Changed

The AT Protocol Identity package has been implemented! It allows the resolution of DIDs and Handles using various techniques like DNS, HTTP, and PLC directory. Abstract and in-memory caching has been brought too. And as always, it provides both sync and async interfaces. Check the docs below!

🌐 Identity resolvers for DID and Handle

Code snippet:

from atproto import IdResolver  # for async use AsyncIdResolver

resolver = IdResolver()
did = resolver.handle.resolve('test.marshal.dev')
did_doc = resolver.did.resolve(did)

print(did)
print(did_doc)

Code snippet with cache:

from atproto import DidInMemoryCache, IdResolver  # for async AsyncDidInMemoryCache and AsyncIdResolver

cache = DidInMemoryCache()
resolver = IdResolver(cache=cache)
did_doc = resolver.did.resolve('did:web:feed.atproto.blue')

# Now did_document is cached and could be retrieved without network request
did_doc = resolver.did.resolve('did:web:feed.atproto.blue')

# Clear cache
cache.clear()

# Now did_document is not cached and will be retrieved with network request
did_doc = resolver.did.resolve('did:web:feed.atproto.blue')

Full Changelog: v0.0.35...v0.0.36