connio
A python concurrency agnostic communication library.
Pass a URL to the single point API function connio.connection_for_url()
and it will return a communication object with a common generic API.
Helpful when dealing with instrumentation which work over serial line or TCP (and in future USB) with simple REQ-REP communication protocols (example: SCPI).
The request for a communication object is forwarded to the corresponding serialio or sockio libraries depending on the URL you give.
Written in asyncio with support for different concurrency models:
- asyncio
- classic blocking API
- future based API
- python 2 compatible blocking API (for those pour souls stuck with python 2)
Installation
From within your favorite python environment:
pip install connio
Usage
import asyncio
from connio import connection_for_url
async def main():
# A local async serial line
sl = connection_for_url("serial:///dev/ttyS0", parity="E")
print(await sl.write_readline(b"*IDN?\n"))
# An async serial line over telnet server
sl = connection_for_url("rfc2217://moxa.acme.org:7890", parity="E")
print(await sl.write_readline(b"*IDN?\n"))
# An async TCP connection
tcp = connection_for_url("tcp://gepace.acme.org:5025")
print(await tcp.write_readline(b"*IDN?\n"))
# An sync TCP connection
tcp = connection_for_url("tcp://gepace.acme.org:5025", concurrency="sync")
print(tcp.write_readline(b"*IDN?\n"))
asyncio.run(main())
Metadata
Release files for connio 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| connio-0.2.0.tar.gz | 2.8 kB | Without provenance | Details for connio-0.2.0.tar.gz |
Release files / connio-0.2.0.tar.gz
| Download URL | connio-0.2.0.tar.gz |
|---|---|
| Size | 2.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a06a4965d1ce6a4621b511183a98f04a1e2c50ae59ca20f55537d5fea3501aaa
|
|
BLAKE2b-256 checksum How to use checksums |
1994e7adc24adafd1230a122a259e5680cbddd73b5b0201aa92147f8431ba8f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0.post20201006 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.7
|
Security for connio 0.2.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.