bencode.py
Simple bencode parser (for Python 2, Python 3 and PyPy)
Decision gist · record as of 2026-08-14
Yes, if you need bencode support. Low install friction, no dependencies, active maintenance, and no known vulnerabilities make it a straightforward choice. The main caveat is the unclear license status—verify BitTorrent Open Source License compatibility with your project's constraints before committing to production use.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low install friction with no runtime dependencies.
- Actively maintained as of 2026-07-07 with recent release history.
License · maintenance · safety
BitTorrent Open Source License (unclear) — Licensed under BitTorrent Open Source License (license_treatment: unclear). The license status is not mapped to a standard SPDX identifier, so review the raw license terms before use in proprietary or restricted contexts.
last release 2026-07-07 (38 days) · last repo commit 2026-07-07 · 57 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 203,862 downloads/mo, #9,619 on PyPI
Alternatives
Verify before relying
pip install bencode.py
import bencodepy
# Encode
bencodepy.encode({'title': 'Example'})
# b'd5:title7:Examplee'
# Decode
bencodepy.decode('d5:title7:Examplee')
# {b'title': b'Example'}- Whether BitTorrent Open Source License permits use in closed-source or commercial projects without restrictions
- Specific Python version support (requires_python field is unspecified in metadata)
What it is and what it does
bencode.py is a parser for the bencode format, the binary encoding scheme used in BitTorrent and related peer-to-peer protocols. It provides both encoding (Python objects to bencode strings) and decoding (bencode strings back to Python objects) with configurable handling of string encoding, dictionary ordering, and nesting depth limits.
The package offers a simple functional API (encode/decode) for quick use, plus a class-based API (Bencode, BencodeEncoder, BencodeDecoder) for fine-grained control over encoding behavior, fallback strategies, and file I/O. It has no runtime dependencies and works across Python 2, Python 3, and PyPy, making it portable for legacy and modern codebases alike.
Use it for
- Parse and extract metadata from .torrent files or BitTorrent protocol messages
- Serialize Python data structures into bencode format for peer-to-peer applications
- Build tools that interact with BitTorrent clients or DHT (Distributed Hash Table) networks
- Handle bencode-encoded configuration or data interchange in legacy systems
- Decode bencode strings with custom encoding fallback strategies for mixed or corrupted data
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need bencode support.
Low install friction, no dependencies, active maintenance, and no known vulnerabilities make it a straightforward choice. The main caveat is the unclear license status—verify BitTorrent Open Source License compatibility with your project's constraints before committing to production use.
Install
bencode-py on PyPI
Before you install
Low install friction with no runtime dependencies. Actively maintained as of 2026-07-07 with recent release history.
License in practice
Licensed under BitTorrent Open Source License (license_treatment: unclear). The license status is not mapped to a standard SPDX identifier, so review the raw license terms before use in proprietary or restricted contexts.
Quickstart
pip install bencode.py
import bencodepy
# Encode
bencodepy.encode({'title': 'Example'})
# b'd5:title7:Examplee'
# Decode
bencodepy.decode('d5:title7:Examplee')
# {b'title': b'Example'}
Verify before relying
- Whether BitTorrent Open Source License permits use in closed-source or commercial projects without restrictions
- Specific Python version support (requires_python field is unspecified in metadata)
Package facts
| License | BitTorrent Open Source License unclear |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 38 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 203,862 / month, #9,619 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: Other/Proprietary LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 3Programming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries |
Evidence: bencode_py-4.1.0-py3-none-any.whl
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 › “bencode encoder decoder”
- bencode.pyEncodes and decodes bencode format, the binary encoding used in…
- 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 Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also java-manifest · pylzss · libtorrent · asn1 · py-multibase · ecoji · x690 · pynvvideocodec · pyasn1 · pylsqpack