CSP.py
Native Python, async-friendly implementation of Cubesat Space Protocol.
Features
- Python friendly async API
- Sockets and connections
- Interfaces
- CAN Fragmentation Protocol v1 (compatible with https://github.com/libcsp/libcsp)
- CAN Fragmentation Protocol v2 (compatible with https://github.com/libcsp/libcsp)
- Serializing interface for easy intergration with other applications
- Interface pair for in-memory testing between two nodes
- Socket options
- CRC32 (compatible with https://github.com/libcsp/libcsp)
- CIDR Routing table
- Hooks for inspecting and/or modifying packets going through node
- System services
- Ping
Missing features compared to libcsp
- RDP
- Packet flags
- HMAC
- Remaining system sevices: uptime, reboot/shutdown, process list, memory free query, CSP Management Protocol
- Simple fragmentation protocol
When to use over libcsp?
- Easy use (pure Python library, no native dependencies)
- Testing
csp-pyallows to start and tear down entire node within single test without leaking anything between tests
- Async API
- Use
asyncioto run communication, with gracefully handled timeouts and cancellations
- Use
Usage
- Install package using
pipuser$ pip install cubesat-space-protocol-py - Create node:
import csp_py node = csp_py.CspNode()
- Add interface
from csp_py.interfaces.serializing_interface import CspSerializingInterface async def capture_frame(frame: bytes) -> None: # TODO: frame contains entire serialized packet including header # send it over some communication channel pass async def handle_incoming_frames(iface: CspSerializingInterface) -> None: while True: # TODO: fetch frame from communication channel frame: bytes = await recv_frame() await iface.on_incoming_frame(frame) iface = CspSerializingInterface(capture_frame) # TODO: make sure addresses are correct node.router.add_interface(iface, address=1, netmask_bits=10) asyncio.create_task(handle_incoming_frames(iface))
- Start router task
router_task = asyncio.create_task(node.router.arun())
- Use sockets
connection = await node.connect(dst=0, port=20) await connection.send(b'Hello, world!') response = await connection.recv() print(f'Got response: {response.data}')
- Stop router
router_task.cancel() await router_task
Metadata
Release files for cubesat-space-protocol-py 1.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cubesat_space_protocol_py-1.5.1.tar.gz | 24.7 kB | With provenance | Details for cubesat_space_protocol_py-1.5.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cubesat_space_protocol_py-1.5.1-py3-none-any.whl | Python 3 | none | any | Details for cubesat_space_protocol_py-1.5.1-py3-none-any.whl |
Total release size: 45.1 kB
Release files / cubesat_space_protocol_py-1.5.1.tar.gz
| Download URL | cubesat_space_protocol_py-1.5.1.tar.gz |
|---|---|
| Size | 24.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
553467667c9011ceba85bdb417feebd1d6322364a94e4d4eb11cbd9d47c0dfab
|
|
BLAKE2b-256 checksum How to use checksums |
ce5a1091e7d4ce2afabaad9dc4dce57b723d9eb9f31096f021eaf6f6910caf73
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.
Transparency logRelease files / cubesat_space_protocol_py-1.5.1-py3-none-any.whl
| Download URL | cubesat_space_protocol_py-1.5.1-py3-none-any.whl |
|---|---|
| Size | 20.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4610a3bd746e3f74064a4a69b635b16d262bcc39b5992d0c12bb540baac7c559
|
|
BLAKE2b-256 checksum How to use checksums |
afc55f61c5a3974df0f0e0c7417546412a80291c92325bce897ce3322f679f92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.
Transparency logSecurity for cubesat-space-protocol-py 1.5.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for cubesat_space_protocol_py-1.5.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.