Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bsky-bridge

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bsky-bridge

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

  • 1.0.7
  • PyPI
  • Socket score

Maintainers
1

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
  • Installation
  • Usage
  • Contribution
  • License

Features

  • Easy authentication with the BlueSky API.
  • Functions to post text and images to BlueSky via the API.
  • Parser to identify and extract mentions (@handle), links (URLs), and hashtags (#tags) from text, useful for processing and formatting posts.

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

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc