Skip to main content

PyPI - Version GitHub Actions Workflow Status

CSP.py

Native Python, async-friendly implementation of Cubesat Space Protocol.

Features

  • Python friendly async API
  • Sockets and connections
  • Interfaces
  • Socket options
  • 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-py allows to start and tear down entire node within single test without leaking anything between tests
  • Async API
    • Use asyncio to run communication, with gracefully handled timeouts and cancellations

Usage

  1. Install package using pip
    user$ pip install cubesat-space-protocol-py
    
  2. Create node:
    import csp_py
    
    node = csp_py.CspNode()
    
  3. 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))
    
  4. Start router task
    router_task = asyncio.create_task(node.router.arun())
    
  5. 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}')
    
  6. Stop router
    router_task.cancel()
    await router_task
    

Metadata

Release files for cubesat-space-protocol-py 1.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cubesat-space-protocol-py 1.5.0
File Size Uploaded
cubesat_space_protocol_py-1.5.0.tar.gz 23.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cubesat-space-protocol-py 1.5.0
File Interpreter ABI Platform
cubesat_space_protocol_py-1.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 43.9 kB

Release files / cubesat_space_protocol_py-1.5.0.tar.gz

Download URL cubesat_space_protocol_py-1.5.0.tar.gz
Size 23.6 kB
Tags Source
SHA-256 checksum
How to use checksums
82a79297e599ed9f175e793d1b355d6da001451aa7acd98a323013d9e9ab43d9
BLAKE2b-256 checksum
How to use checksums
83b4241b2e3b7f7e128dcef18aebcfaddafc26547cdc6b66b4190fd72343acfd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 22, 2026.

Transparency log

Release files / cubesat_space_protocol_py-1.5.0-py3-none-any.whl

Download URL cubesat_space_protocol_py-1.5.0-py3-none-any.whl
Size 20.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a52ed0f0322438ebd6c8b34b26cba7fd53cdbae94c8f26893fec88656043ee2
BLAKE2b-256 checksum
How to use checksums
2cc649792c8b215243121158daad60f65578a66195ba71fb8116ff24b0ae84f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 22, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.5.0 This release

2 release files

1.4.0

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page