v0.0.36
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