Metadata-Version: 2.4
Name: sockcan
Version: 0.8.0
Summary: Provides a socketcan-alike interface other arbitrary CAN drivers
Project-URL: Homepage, https://github.com/Hedwyn/sockcan
Author: Baptiste Pestourie
Requires-Python: >=3.12
Provides-Extra: all-inclusive
Requires-Dist: cantools; extra == 'all-inclusive'
Requires-Dist: click; extra == 'all-inclusive'
Requires-Dist: python-can; extra == 'all-inclusive'
Provides-Extra: daemon
Requires-Dist: click; extra == 'daemon'
Requires-Dist: python-can; extra == 'daemon'
Provides-Extra: dev
Requires-Dist: cantools; extra == 'dev'
Requires-Dist: click; extra == 'dev'
Requires-Dist: hypothesis; extra == 'dev'
Requires-Dist: mypy; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: python-can; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs; extra == 'docs'
Requires-Dist: mkdocs-material; extra == 'docs'
Provides-Extra: lint
Requires-Dist: mypy; extra == 'lint'
Requires-Dist: ruff; extra == 'lint'
Provides-Extra: test
Requires-Dist: cantools; extra == 'test'
Requires-Dist: hypothesis; extra == 'test'
Requires-Dist: pytest; extra == 'test'
Requires-Dist: python-can; extra == 'test'
Provides-Extra: transcoders
Requires-Dist: python-can; extra == 'transcoders'
Description-Content-Type: text/markdown

# sockcan

Provides a socketcan-alike interface other arbitrary CAN drivers.

## Installing

```
pip install sockcan
```

## Documentation

Documentation is available [here](https://Hedwyn.github.io/sockcan/).

## Running benchmarks

Benchmarks can be run with `python -m sockcan.benchmarks`:

```shell
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:
```shell
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):
```shell
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\`).<br>
You can show hypothesis stats with `--hypothesis-show-statistics`:

```shell
python -m pytest -vv --hypothesis-show-statistics
```
