Skip to main content

Python module for accessing the CANEdge2 via HTTP

Project description

CANedge HTTP

Python module for accessing the CANedge2 via HTTP. The CANedge2 HTTP interface can e.g. be used to automatically poll and then delete log files from the CANedge2.

The module supports download, deletion, and listing of files on the CANedge2.

Installation

pip install canedge_http

Usage examples

See example_canedge_http.py for a more comprehensive example.

Import

from canedge_http import CANedgeHTTP

Connect

with CANedgeHTTP(host="192.168.0.128").connect() as cnt:
    ...

LIST

for elm, is_dir in cnt.list(path=Path("/"), recursive=True):
   ...

Download

Download takes a file-like object

f = io.BytesIO()
res = cnt.download(elm, f)

or

with open("somefile", 'wb') as f:
    res = cnt.download(elm, f)

Delete

res = cnt.delete(elm)

Test

Tests are implemented using pytest and can be found in test_canedge_http.py.

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

CANedge_HTTP-0.0.1.tar.gz (19.0 kB view hashes)

Uploaded Source

Built Distribution

CANedge_HTTP-0.0.1-py3-none-any.whl (8.5 kB view hashes)

Uploaded Python 3

Supported by

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