Skip to main content

bsky.social client library

Project description

gokyuzu - bluesky python client

Gökyüzü - "sky" in Turkish - is a python client for the bluesky social network.

Install

pip install gokyuzu

Sample Usage

from gokyuzu import Bluesky

bsky = Bluesky("handle.bsky.social", "PASSWORD")
response = bsky.resolveHandle("handle.bsky.social")
print(response.json())

Documentation

List of Implemented API Calls:

com.atproto.admin

  • def disableInviteCodes( codes=None, accounts=None)
  • def getInviteCodes( sort='recent', limit=100, cursor="")
  • def getModerationAction( action_id)
  • def getModerationActions( subject=None, limit=10, cursor="")
  • def getModerationReport( report_id)
  • def getModerationReports( subject=None, resolved=None, limit=10, cursor="")
  • def getRecord( uri=None, cid=None)
  • def getRepo( user_did)
  • def resolveModerationReports( action_id, report_ids, created_by)
  • def reverseModerationAction( action_id, reason, created_by)
  • def searchRepos( query, limit=10, cursor="")
  • def takeModerationAction( action, subject, reason, created_by)
  • def updateAccountEmail( account, email)
  • def updateAccountHandle( new_handle, handle=None, user_did=None)

com.atproto.identity

  • def resolveHandle( handle)
  • def updateHandle( handle)

com.atproto.label

  • def queryLabels( uri_patterns, sources=None, limit=10, cursor="")
  • def subscribeLabels( cursor="", is_stream=True)

com.atproto.repo

  • def applyWrites( repo, writes, validate=True, swapCommit=None)
  • def createRecord( repo, record, collection, record_key=None, validate=True, swapCommit=None)
  • def deleteRecord( repo, record, collection, swapRecord=None, swapCommit=None)
  • def describeRepo( repo)
  • def getAdminRecord( user_did, collection, record_key, commit=None)
  • def listRecords( user_did, collection, limit=10, record_key_start=None, record_key_end=None, reverse=False)
  • def putRecord( repo, collection, record_key, record, validate=True, swapRecord=None, swapCommit=None)
  • def uploadBlob( blob_bytes)
  • def uploadImage( image_path)
  • def followRecord( handle=None, user_did=None)
  • def unfollowRecord( handle=None, user_did=None)

com.atproto.server

  • def createAccount( email, handle, password, inviteCode)
  • def createAppPassword( name)
  • def createInviteCode( useCount, user_did=None)
  • def createInviteCodes( useCount, codeCount=1, user_did=None)
  • def deleteAccount( token, password, handle=None, user_did=None)
  • def describeServer()
  • def deleteSession()
  • def listAppPassword()
  • def getAccountInviteCodes( limit=10, includeUsed=True, create_available=True)
  • def getSession()
  • def requestAccountDelete()
  • def requestPasswordReset( email)
  • def resetPassword( email, password)
  • def refreshSession()
  • def revokeAppPassword( app_name)

com.atproto.sync

  • def getBlob( repo_did, blob_cid)
  • def getBlocks( did, cids)
  • def getCheckout( did, commit=None)
  • def getCommitPath( did, latest=None, earliest=None)
  • def getHead( did)
  • def getSyncRecord( did, collection, record_key, commit=None)
  • def getRepo( did, earliest=None, latest=None)
  • def listBlobs( did, latest, earliest)
  • def notifyOfUpdate( hostname)
  • def requestCrawl( hostname)
  • def subscribeRepos( cursor)

app.bsky.actor

  • def getProfile( user_did)
  • def getProfiles( user_dids)
  • def getSuggestions( limit=10, cursor="")
  • def searchActors( query, limit=10, cursor="")
  • def searchActorsTypeahead( query, limit=10, cursor="")

app.bsky.feed

  • def getAuthorFeed( handle=None, user_did=None, limit=10, cursor="")
  • def getLikes( post_id, limit=10, cursor="")
  • def getPostThread( post_id, limit=10, cursor="", depth=None)
  • def getRepostedBy( post_id, limit=10, cursor="", post_cid=None)
  • def getTimeline( limit=10, cursor="", algorithm="reverse-chronological")
  • def like( subject_uri, subject_cid, createdAt=None)
  • def unlike( repo, record_key)
  • def repost( subject_uri, subject_cid, createdAt=None)
  • def undo_repost( repo, record_key)

app.bsky.graph

  • def follow( handle=None, user_did=None)
  • def getFollowers( handle=None, user_did=None, limit=10, cursor="")
  • def getFollows( handle=None, user_did=None, limit=10, cursor="")
  • def getMutes( limit=10, cursor="")
  • def muteActor( handle=None, user_did=None)
  • def unmuteActor( handle=None, user_did=None)

app.bsky.notification

  • def getUnreadCount()
  • def listNotifications( limit=10, cursor="")
  • def updateSeen( limit=10, cursor="", seenAt=None)

app.bsky.unspecced

  • def getPopular( limit=10, cursor="")

app.bsky.richText

  • def facet( text)

Search sarch.bsky.social

  • def search( query_type="posts", query="")
  • def search_profiles( query)
  • def search_posts( query)

Other

  • def health()
  • def createLinkFromAtUri( at_uri)
  • def quote( text, repo, record_uri, record_cid, createdAt=None)
  • def delete_post( repo, record_key)
  • def comment( text, repo, reply_root_uri, reply_root_cid, reply_parent_uri, reply_parent_cid, createdAt=None)

Development

python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Running tests

python -m unittest

Publishing to PyPI

# Build for PyPI
python -m build

# Test PyPI
python -m twine upload --repository testpypi dist/*
pip install --index-url https://test.pypi.org/simple/ --no-deps gokyuzu

# PyPI
python -m twine upload dist/*
pip install gokyuzu

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gokyuzu-2.0.3.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gokyuzu-2.0.3-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file gokyuzu-2.0.3.tar.gz.

File metadata

  • Download URL: gokyuzu-2.0.3.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for gokyuzu-2.0.3.tar.gz
Algorithm Hash digest
SHA256 bbc8a557daa1770a6b616520e2deff7cfd3337d67dd31db719afdc1c49537ed5
MD5 245c74dcd114cbc30e81c8659ac534ae
BLAKE2b-256 28cbf0a4b5e32993f452197ca8f510ba93221b7b3134d423751a88cc6eb978df

See more details on using hashes here.

File details

Details for the file gokyuzu-2.0.3-py3-none-any.whl.

File metadata

  • Download URL: gokyuzu-2.0.3-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for gokyuzu-2.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3c458aeaf3a271b4daa59a54b2300cae41c09dbc238c23cb87bb8b5d65133cf2
MD5 11324a3b2558f9c8f8f0447dbe9c2dad
BLAKE2b-256 0c5c80ea5417b7c92bbbd1f8e9881c09e1b50e78b59fa6470e1fde39a10b3633

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page