Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add record namespaces with get, list, create, delete methods #263

Merged
merged 8 commits into from
Feb 3, 2024

Conversation

MarshalX
Copy link
Owner

@MarshalX MarshalX commented Feb 2, 2024

The implementation is hardcoded but works well... now input and returned records are well-typed. and record namespaces provide some kind of syntax sugar (i hope)

usage example:

client = Client(base_url='https://bsky.social')
client.login(os.environ['USERNAME'], os.environ['PASSWORD'])

posts = client.app.bsky.feed.post.list(client.me.did, limit=10)
for uri, post in posts.records.items():
     print(uri, post.text)

post = client.app.bsky.feed.post.get(client.me.did, AtUri.from_str(uri).rkey)
print(post.value.text)

post_record = models.AppBskyFeedPost.Main(text='test record namespaces', created_at=client.get_current_time_iso())
new_post = client.app.bsky.feed.post.create(client.me.did, post_record)
print(new_post)

deleted_post = client.app.bsky.feed.post.delete(client.me.did, AtUri.from_str(new_post.uri).rkey)
print(deleted_post)

rly idk will it helps a lot

closes #233

@MarshalX MarshalX merged commit d277df1 into main Feb 3, 2024
25 checks passed
@MarshalX MarshalX deleted the record-namespaces branch February 3, 2024 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement autogenerated Record Namespaces
1 participant