Comments (1)
let's think about the benefits.
- you write less and simpler code
- you don't need to care about "collection" arg
- you definitely know which record type is required for input. good auto-completion and type annotating
- you definitely know which record type will be returned. good auto-completion and type annotating
- return models are isolated from models of AT Protocol
create
low lvl API:
post_record = models.AppBskyFeedPost.Main(text='test record namespaces', created_at=client.get_current_time_iso())
client.com.atproto.repo.create_record(
models.ComAtprotoRepoCreateRecord.Data(
repo=client.me.did,
collection=ids.AppBskyFeedPost,
record=post_record
)
)
sugar:
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)
get
low lvl API:
post = client.com.atproto.repo.get_record(
models.ComAtprotoRepoGetRecord.Params(
collection=ids.AppBskyFeedPost,
repo=client.me.did,
rkey=rkey,
)
)
sugar:
post = client.app.bsky.feed.post.get(client.me.did, rkey)
delete
low lvl API:
self.com.atproto.repo.delete_record(
models.ComAtprotoRepoDeleteRecord.Data(
collection=ids.AppBskyFeedPost,
repo=did,
rkey=rkey,
)
)
sugar:
client.app.bsky.feed.post.delete(did, rkey)
list
low lvl API:
posts = client.com.atproto.repo.list_records(
models.ComAtprotoRepoListRecords.Params(
collection=ids.AppBskyFeedPost,
repo=client.me.did
)
)
sugar:
posts = client.app.bsky.feed.post.list(client.me.did)
from atproto.
Related Issues (20)
- Uploading an image as a blob to be used as a card image doesn't work ! HOT 1
- Python Version Depency Issue HOT 2
- Would you recommend any specific gunicorn settings for a feed? HOT 1
- AtUri.from_str() returns invalid host for some AT uri's (Fix included) HOT 2
- Add the ability to submit posts that include labels
- Delete deprecated "subject" argument of .like() and .repost() methods
- Delete deprecated record models called "Main" instead of "Record"
- Auth token handling improvements HOT 10
- Delete deprecated SessionString class
- decode_dag_multi does not decode fully HOT 4
- Misspelling in get_author_feed HOT 3
- Subscribing to feed? HOT 4
- Parsing Alt Text HOT 2
- Add support for event stream HOT 8
- get_blob errors on redirects HOT 2
- High memory usage: from atproto import Client HOT 3
- Failing on authentication HOT 2
- IpldLink model validation fails HOT 8
- delete_post not work HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atproto.