Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
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:
From within your favorite python environment:
pip install connio
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())
FAQs
Concurrency agnostic socket API
We found that connio demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.