bson
BSON codec for Python
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Package targets Python 2.6–3.6; compatibility with Python 3.7+ is not documented and may be broken.
- 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.
License · maintenance · safety
BSD (permissive) — Licensed under BSD (permissive), which allows use in most projects without restriction, but you should verify the specific BSD variant matches your compliance requirements.
last release 2020-05-26 (2271 days) · last repo commit 2025-11-27 · 467 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 967,185 downloads/mo, #4,617 on PyPI
Alternatives
Verify before relying
pip install bson
import bson
a = bson.dumps({"A": [1, 2, 3, 4, 5, "6", "7", {"C": "DS"}]})
b = bson.loads(a)- 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.
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 on this page. Verify before relying on it.
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
bson on PyPI
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.
Package targets Python 2.6–3.6; compatibility with Python 3.7+ is not documented and may be broken.
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)
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 | Not specified |
| Install friction | High. Source build required |
| Runtime dependencies | None |
| Maintenance | Aging 2,271 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 967,185 / month, #4,617 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Programming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6 |
Evidence: bson-0.5.10.tar.gz
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “bson encoder decoder”
- bsonEncodes and decodes BSON (Binary JSON) data independently of MongoDB,…
- x-transformersx-transformers provides modular transformer building blocks—encoder,…
- pylsqpackpylsqpack provides Python Decoder and Encoder objects for reading and…
Give your agent the search over MCP, or paste the wish link into any chat.
More Database packages
psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.
Python client library for connecting to and executing commands against Redis key-value stores, supporting both synchronous and asynchronous operations.
Install it if your application needs to interact with Redis; the only prerequisite is a running Redis server instance.
YDB Python SDK is the official client library for connecting to and querying YDB databases from Python applications.
Install it if you need to connect Python applications to YDB databases.
Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.
sqlparse tokenizes SQL text into a tree of statements, clauses, and expressions, and provides functions to split scripts, format queries, and inspect parsed tokens without validating dialect or syntax.
Install it if you need to manipulate, format, or analyze SQL text programmatically.
Provides base adapter protocols and shared functionality that database adapters use to integrate with dbt-core, handling connections, dialect translation, relation caching, and core interface management.
See also pymongo · pymongocrypt · pymongoarrow · mongomock · pymongo-auth-aws · py-ubjson · Flask-PyMongo · pymongo_inmemory · mongoengine · ytsaurus-yson