--- id: bson version: "0.5.10" license: BSD license_treatment: permissive maintenance: aging --- # bson — BSON codec for Python License: permissive · Maintenance: aging · Downloads: 967.2K/mo ## What it is and what it does bson is a standalone BSON codec for Python that does not require MongoDB to be installed. It provides functions to serialize Python dictionaries and other objects into BSON binary format and deserialize BSON back into Python objects. The package also includes utilities for sending and receiving BSON objects over network sockets by patching the socket module. The package is useful when you need to work with BSON data outside of a MongoDB context—for example, when interoperating with other systems that use BSON as a data format, or when you want BSON serialization without the full MongoDB driver. It has no runtime dependencies, making it lightweight to add to a project. Use it for: - Serialize and deserialize BSON data in standalone Python applications that need to exchange data with BSON-based systems. - Communicate BSON objects over network sockets between Python processes or services. - Parse BSON-formatted data from files or external sources without installing MongoDB. - Embed BSON encoding/decoding in tools that work with MongoDB exports or BSON-compatible APIs. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Encodes and decodes BSON (Binary JSON) data independently of MongoDB, and can serialize BSON objects over network sockets. No—not recommended for new projects. The package has not been updated since 2020-05-26 and targets Python versions (2.6–3.6) that are no longer supported. Compatibility with modern Python (3.7+) is undocumented and likely broken. If you need BSON support, consider using the official pymongo library's BSON codec instead, which is actively maintained. ## Install pip install bson uv add bson poetry add bson ## Installing bson Before you install: High install friction: the package has not been updated since 2020-05-26 and is classified as aging. It targets Python 2.6 through 3.6, which are no longer actively supported. Compatibility with modern Python versions is unspecified. License in practice: Licensed under BSD (permissive), which allows use in most projects without restriction, but you should verify the specific BSD variant matches your compliance requirements. Quickstart: pip install bson import bson a = bson.dumps({"A": [1, 2, 3, 4, 5, "6", "7", {"C": "DS"}]}) b = bson.loads(a) Package targets Python 2.6–3.6; compatibility with Python 3.7+ is not documented and may be broken. Verify before relying: - Whether this package works reliably on Python 3.7 and later versions despite classifier claims ending at 3.6. - Active maintenance status and whether the repository accepts pull requests or is effectively unmaintained. - Whether the socket patching feature (bson.patch_socket) is still functional and tested. ## Package facts - License: BSD (permissive) - Python support: unspecified - Install friction: high - Maintenance: aging - Downloads: 967.2K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags bson encoder decoder, binary json codec, bson serialization, mongodb data format without mongodb, bson socket communication, bson python library, serialization, legacy [View on SkillFed](https://skillfed.io/packages/bson) · [View on PyPI](https://pypi.org/project/bson/)