Skip to main content

No project description provided

Project description

Python binding to Rust uem_reader crate

This is a Python binding for MicroEM reader support crate in Rust.

Note on using libusb

On Linux you need to add write permissions to the device you want to use, e.g.:

sudo chmod o+w /dev/bus/usb/002/008

To work with Windows you need to install libusb driver for a reader.

Usage

You can find module sources on GitHub.

import uem_reader_py
rdrs = uem_reader_py.find_usb_readers()
assert len(rdrs) > 0
rdrs[0].open()
print(rdrs[0].send([0x64]))  # Get Version
print(rdrs[0].send([0x22]))  # Get Serial
rdrs[0].send([0x05, 0x03])  # Beep 3 times
rdrs[0].close()

Module development process

sudo apt-get install curl
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
python3 -m venv .env
source ./.env/bin/activate
pip3 install maturin
maturin develop
pip3 install hypothesis
python3 ./python/tests/test.py
sudo apt install docker.io
sudo docker run --rm -v $(pwd):/io ghcr.io/pyo3/maturin build --release
# maturin build --release --bindings pyo3
sudo docker run --rm -v $(pwd):/io ghcr.io/pyo3/maturin publish --username LumaRay --password 

License

This work is dual-licensed under MIT or Apache 2.0. You can choose between one of them if you use this work.

SPDX-License-Identifier: MIT OR Apache-2.0

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

uem_reader_py-0.1.2.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

uem_reader_py-0.1.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (264.7 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

File details

Details for the file uem_reader_py-0.1.2.tar.gz.

File metadata

  • Download URL: uem_reader_py-0.1.2.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/0.14.12

File hashes

Hashes for uem_reader_py-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5793487e3dcc0deaf5492c1639ef90dedd675bce588d3e77be847aeb09ccf252
MD5 358bb2e1c769f9d6698cd1effc0a84c3
BLAKE2b-256 622b140b9a98513932294f34bf9355bf63111d126a98198f34527e5be383e464

See more details on using hashes here.

File details

Details for the file uem_reader_py-0.1.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for uem_reader_py-0.1.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d1bfc4bd05df37a6fdcd00a79aae4f67694595fa8eeda8e84d6267979f2ff107
MD5 c40316797352662f3aa29c0dd50c60b6
BLAKE2b-256 4d81e5ab2d529d9880e9c8ae7d56024e484a02e4554f0adf6c059c4dad7d4205

See more details on using hashes here.

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