Skip to main content

Provides a socketcan-alike interface other arbitrary CAN drivers

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sockcan-0.8.0.tar.gz (30.4 kB view details)

Uploaded Source

File details

Details for the file sockcan-0.8.0.tar.gz.

File metadata

  • Download URL: sockcan-0.8.0.tar.gz
  • Upload date:
  • Size: 30.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sockcan-0.8.0.tar.gz
Algorithm Hash digest
SHA256 fae42bd7968b6db5615cc80f4407d9d17cee8b7f931a8fb0f6d077095c7d7824
MD5 d8826dc0adb77de4ceb82a036a25b705
BLAKE2b-256 b50390a1467ec9de525feb3b8889d680fdb21859949ecca3ab8c3ad9b4cf1d69

See more details on using hashes here.

Provenance

The following attestation bundles were made for sockcan-0.8.0.tar.gz:

Publisher: publish-to-pypi.yml on Hedwyn/sockcan

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page