cobs
Consistent Overhead Byte Stuffing (COBS)
Decision gist · record as of 2026-08-14
Yes. COBS is a well-established, stable algorithm with a mature implementation (Production/Stable, MIT license). Install it if you need reliable packet framing in serial/network protocols or must eliminate zero bytes from binary data. Medium install friction is acceptable given the C extension fallback. No known vulnerabilities.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python >= 3.6; C extension compilation may fail on some platforms, but pure Python implementation is available as fallback.
- Medium install friction due to C extension compilation; pure Python fallback available.
- Package is stable (Production/Stable status) and actively maintained with recent release (2025-07-20), though maintenance cadence is aging.
License · maintenance · safety
permissive license (permissive) — MIT license (permissive) allows unrestricted use, modification, and distribution with minimal restrictions—suitable for both open-source and proprietary projects.
last release 2025-07-20 (390 days) · last repo commit 2025-07-20 · 50 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 119,210 downloads/mo, #12,083 on PyPI
Alternatives
Verify before relying
pip install cobs
from cobs import cobs
encoded = cobs.encode(b'Hello world\x00This is a test')
decoded = cobs.decode(encoded)- Performance characteristics of C extension vs. pure Python implementation for typical packet sizes.
- Whether the package handles edge cases like empty input or maximum-length packets as documented.
What it is and what it does
COBS is a byte-stuffing algorithm that encodes arbitrary binary data into a form containing no zero bytes (0x00), enabling zero bytes to serve as reliable packet delimiters in serial and network protocols. The package provides both basic COBS and COBS/R (a variant that reduces overhead) via Python modules with encode and decode functions. It includes a C extension for performance and a pure Python fallback for portability.
The encoding adds predictable overhead: always 1 byte plus potentially n/254 additional bytes for longer packets. This is more efficient than escape-based methods like PPP, which can double packet size in worst cases. The package accepts any buffer-protocol-compatible input (bytes, bytearray) and returns encoded/decoded bytes; framing (adding or stripping delimiter bytes) is left to the application.
Use it for
- Implement packet framing in serial communication protocols where zero bytes mark packet boundaries.
- Encode binary data for transmission over channels that cannot safely transmit zero bytes.
- Reduce packet size overhead compared to escape-based byte stuffing in bandwidth-constrained protocols.
- Use COBS/R variant to minimize encoding overhead for small message payloads in embedded systems.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
COBS is a well-established, stable algorithm with a mature implementation (Production/Stable, MIT license). Install it if you need reliable packet framing in serial/network protocols or must eliminate zero bytes from binary data. Medium install friction is acceptable given the C extension fallback. No known vulnerabilities.
Install
cobs on PyPI
Before you install
Medium install friction due to C extension compilation; pure Python fallback available. Package is stable (Production/Stable status) and actively maintained with recent release (2025-07-20), though maintenance cadence is aging.
Requires Python >= 3.6; C extension compilation may fail on some platforms, but pure Python implementation is available as fallback.
License in practice
MIT license (permissive) allows unrestricted use, modification, and distribution with minimal restrictions—suitable for both open-source and proprietary projects.
Quickstart
pip install cobs
from cobs import cobs
encoded = cobs.encode(b'Hello world\x00This is a test')
decoded = cobs.decode(encoded)
Verify before relying
- Performance characteristics of C extension vs. pure Python implementation for typical packet sizes.
- Whether the package handles edge cases like empty input or maximum-length packets as documented.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.6 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Aging 390 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 119,210 / month, #12,083 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 :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Topic :: Communications |
Evidence: cobs-1.2.2-cp312-cp312-win32.whl; cobs-1.2.2-cp312-cp312-win_amd64.whl; cobs-1.2.2-cp313-cp313-win32.whl; cobs-1.2.2-cp313-cp313-win_amd64.whl; cobs-1.2.2-cp314-cp314-win32.whl; cobs-1.2.2-cp314-cp314-win_amd64.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 › “byte stuffing encoding”
- cobsEncodes and decodes data using Consistent Overhead Byte Stuffing…
- base58checkEncodes and decodes byte arrays using the Base58Check scheme, a…
- cchardetcchardet detects the character encoding of byte strings using a C…
Give your agent the search over MCP, or paste the wish link into any chat.
More Communications packages
Pyasn1 encodes and decodes ASN.1 data structures using BER, CER, DER, and native Python codecs, allowing you to serialize complex data for network protocols and file formats.
Install it if you need to work with ASN.1-based protocols or formats; it is the standard library for this in Python and has no known vulnerabilities.
Provides a collection of ASN.1 data structures expressed as Python classes, built on the pyasn1 library, for working with ASN.1-based protocols and standards.
Kombu is a messaging library that provides a high-level Python interface to AMQP and other message brokers, supporting pluggable transports for RabbitMQ, Redis, MongoDB, Amazon SQS, and others.
Install it if you are building any distributed system that requires reliable message passing.
Formats and parses numbers, file sizes, timespans, and other values into human-readable text; provides terminal interaction utilities including ANSI text styling and user prompts.
Adds colored output to Python's standard logging module using ANSI escape sequences, with automatic fallback support for Windows terminals.
However, it is abandoned and receives no maintenance, so it will not adapt to future Python changes or platform updates.
Parse, validate, format, and analyze international phone numbers across all countries, with support for extracting geographic, carrier, and timezone information from phone number data.
See also scalecodec · spacepackets · simplefix · bbpb · canoser · mbstrdecoder · xmhuffman · reedsolo · bytesparse · pyiso8583