Skip to main content

A Python interface for interacting with the BlueSky social network's API.

Project description

bsky-bridge: A Python Library for the BlueSky API

bsky-bridge is a Python library designed to bridge the interaction between Python applications and the BlueSky Social Network via its API.

Table of Contents

Features

  • Easy authentication with the BlueSky API.
  • Functions to post text and images to BlueSky via the API.

Installation

pip install bsky-bridge

Usage

Creating a Session

Start by establishing a session with your BlueSky handle and App passwords (To be created in your account settings):

from bsky_bridge import BskySession

session = BskySession("your_handle.bsky.social", "your_APPpassword")

Posting Content

After initializing a session, you can post text to BlueSky:

from bsky_bridge import BskySession, post_text

session = BskySession("your_handle.bsky.social", "your_APPpassword")

response = post_text(session, "Hello BlueSky!")
print(response)

Posting Images

To post images along with text, you can use the post_image method:

from bsky_bridge import BskySession, post_image

session = BskySession("your_handle.bsky.social", "your_APPpassword")

postText = "Check out this cool image!"
imagePath = "path_to_your_image.jpeg"
altText = "An awesome image"
response = post_image(session, postText, imagePath, altText)
print(response)

Note: The library automatically handles resizing and compressing larger images to ensure they do not exceed 1 MB in size, all while maintaining a quality balance. This ensures efficient and quick image uploads.

Contribution

Contributions are welcome! Please submit issues for any bug or problem you discover, and pull requests for new features or fixes.

License

MIT License

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

bsky_bridge-1.0.3.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

bsky_bridge-1.0.3-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file bsky_bridge-1.0.3.tar.gz.

File metadata

  • Download URL: bsky_bridge-1.0.3.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for bsky_bridge-1.0.3.tar.gz
Algorithm Hash digest
SHA256 3a80756ff8be4f59ff4f53f4fbe9bfbad876fcdb713f8ad8d1073c4926812a1e
MD5 3b7c24fe77cbcbbb2131187bf4b7a2e8
BLAKE2b-256 78891373a23ffa9280d21e138f1ba703eea36002934370fd7d17ceeb7f5183a2

See more details on using hashes here.

File details

Details for the file bsky_bridge-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: bsky_bridge-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for bsky_bridge-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9fec433c982c8f2ad40e353ed114f39ef06159e3edcb33773075742c44310c42
MD5 053d675122450f56a10cc4300c240dad
BLAKE2b-256 f2a5e9cd085fe266b09c92eb8a39f9fdda3f7492ea32838c73d9654f3f3bb135

See more details on using hashes here.

Supported by

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