sockcan
Provides a socketcan-alike interface other arbitrary CAN drivers.
Installing
pip install sockcan
Documentation
Documentation is available here.
Running benchmarks
Benchmarks can be run with python -m sockcan.benchmarks:
python -m sockcan.benchmarks --help
Usage: python -m sockcan.benchmarks [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
daemon Benchmarks all 4 scenarios: direct kernel vs userspace daemon,...
kernel Benchmarks python-can vs sockcan with direct kernel...
Kernel benchmark
Compares python-can and sockcan on direct kernel communications:
python -m sockcan.benchmarks kernel --rounds 200 --batch-size 100
Daemon benchmark
Compares all 4 scenarios: python-can + sockcan on both direct kernel and userspace daemon. Requires vcan0 and uses a virtual bus (no hardware needed):
python -m sockcan.benchmarks daemon --rounds 100 --batch-size 50 --port 18765
Running tests
Tests are based on pytest and hypothesis. Make sure to install this package with test extra (pip install .\[test\).
You can show hypothesis stats with --hypothesis-show-statistics:
python -m pytest -vv --hypothesis-show-statistics
Metadata
Release files for sockcan 0.9.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 | |
|---|---|---|---|
| sockcan-0.9.1.tar.gz | 32.1 kB | Details |
Release files / sockcan-0.9.1.tar.gz
| Download URL | sockcan-0.9.1.tar.gz |
|---|---|
| Size | 32.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
85560cdf13f7921cd33dedeb45097bceac19902c120c4f5ae6301c372fa7684d
|
|
BLAKE2b-256 checksum How to use checksums |
9fe9296eded0fbbc3fbf0415d055c26ffa24527cc5e26c48a8d927995b95ebb1
|
| 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 Jul 9, 2026.
Transparency log