AD
Boost Your Brand on BlueSky—Exclusive banner space to amplify your reach within the BlueSky community.
BSkyInfo LogoBskyInfo
All ToolsCategoriesCollectionsFeed DirectoryLabeler DirectoryArticlesGuidesGlossaryBluesky SDKsSponsor
Submit
All ToolsCategoriesCollectionsFeed DirectoryLabeler DirectoryGuidesGlossaryArticlesBluesky SDKsSponsorSubmit
  1. SDKs
  2. /Python
  3. /python-libipld
MarshalX

python-libipld

A Python SDK for Bluesky and AT Protocol by MarshalX

🏎️ Fast Python library to work with IPLD: DAG-CBOR, CID, CAR, multibase

GitHub Stats

20stars
3forks
3contributors
2open issues

Dates

Created:September 3, 2023
Last updated:March 6, 2025

README

The following content is from python-libipld's GitHub repository. All rights reserved by the original author.

Python IPLD

This project aims to speed up The AT Protocol SDK by using Rust for the heavy lifting. Only atproto related parts are implemented first.

Code snippet:

import libipld

# CID
print(libipld.decode_cid('bafyreig7jbijxpn4lfhvnvyuwf5u5jyhd7begxwyiqe7ingwxycjdqjjoa'))
# Output: {'hash': {'size': 32, 'code': 18, 'digest': b'\xdfHP\x9b\xbd\xbcYOV\xd7\x14\xb1{N\xa7\x07\x1f\xc2C^\xd8D\t\xf44\xd6\xbe\x04\x91\xc1)p'}, 'version': 1, 'codec': 113}
print(libipld.encode_cid(b'\x01q\x12 \xb6\x81\x1a\x1d\x7f\x8c\x17\x91\xdam\x1bO\x13m\xc0\xe2&y\xea\xfe\xaaX\xd6M~/\xaa\xd5\x89\x0e\x9d\x9c'))
# Output: bafyreifwqenb274mc6i5u3i3j4jw3qhcez46v7vkldle27rpvlkysdu5tq

# DAG-CBOR
print(libipld.decode_dag_cbor(b'\xa2aa\x0cabfhello!'))
# Output: {'a': 12, 'b': 'hello!'}
print(libipld.encode_dag_cbor({'a': 12, 'b': 'hello!'}))
# Output: b'\xa2aa\x0cabfhello!'

# multibase
print(libipld.decode_multibase('ueWVzIG1hbmkgIQ'))
# Output: ('u', b'yes mani !')
print(libipld.encode_multibase('u', b'yes mani !'))
# Output: ueWVzIG1hbmkgIQ

Features

  • Decode DAG-CBOR (decode_dag_cbor(bytes) -> dict, decode_dag_cbor_multi(bytes) -> list[dict])
  • Encode DAG-CBOR (encode_dag_cbor(obj) -> bytes)
  • Decode CID (decode_cid(str | bytes) -> dict). Accepts CID stringified form or CID raw byte form.
  • Encode CID (encode_cid(bytes) -> str). Encodes CID raw byte form to stringified form.
  • Decode Multibase (decode_multibase(str) -> tuple[str, bytes]). Returns base and data.
  • Encode Multibase (encode_multibase(str, bytes) -> str). Accepts base and data.
  • Decode CAR (decode_car(bytes) -> tuple[dict, dict[bytes, dict]]). Returns a header and blocks mapped by CID. CIDs in raw byte form.

Note: a stub file will be provided in the future.

Requirements

  • Python 3.8 or higher.

Installing

You can install or upgrade libipld via

pip install libipld

Contributing

Contributions of all sizes are welcome.

License

MIT

Topics

atprotociddag-cbordecodingencodingipldmultibase

Related SDKs

dannguyendancow-bluesky-fun-api-tool

Just having fun with python and Bluesky's AT Protocol. Trying to build a simple CLI and enough of SDK to easily explore and collect my own Bluesky data

1•Python
TahomaSoftSaxeBlueskyPython

A small python library to post basic text and media to bsky.app via atproto's xrpc API.

1•Python
Gorcenskiskeeter-deleter

A script for auto-deleting Bluesky posts

65•Python
Zetaphorbsky-altometer

A site that measures the current percentage of Bluesky posts missing alt text

7•Python
snarfedbridgy-fed

🌉 A bridge between decentralized social networks

1002•Python
snarfedgranary

💬 The social web translator

485•Python

Resources

GitHub RepositoryProject Website

License

MIT

Author

MarshalX
MarshalX

Activity

Last commit: March 6, 2025
Commit frequency: Unknown

Our Sponsors

Your Brand Here!

50K+ engaged viewers every month

Limited spots available!

📧 Contact us via email🦋 Contact us on Bluesky
BSkyInfo LogoBskyInfo

The Most Comprehensive Bluesky Tools Directory

Stay updated with the latest Bluesky tools and ecosystem news 🦋

Bluesky butterfly logo
Quick LinksSubmit a ToolSponsorAboutLegal Information
ToolsFeed DirectoryLabeler DirectorySchedulingAnalyticsAll ToolsCategoriesCollectionsTags
ResourcesArticlesBluesky GuidesBluesky GlossaryBluesky SDKsBluesky ResourcesSkyRaffleMeida Coverage
Our ProductsRaffleBlueAiTeach ToolsLaiewAI affiliate listFirsto

This website may contain affiliate links

© 2025 BskyInfo. All rights reserved.