aioreadline
Python has a builtin readline module. However, the builtin module is difficult to use in async Python code. This module provides an interface around the async-compatible functions of libreadline using a ctypes wrapper.
Example
import asyncio, atexit
async def _main():
while True:
line = await aiorl.getLine()
if line is None or line == b"quit":
aiorl.stop()
loop.stop()
break
elif len(line) > 0:
aiorl.add_history(line)
print(line)
loop = asyncio.get_event_loop()
loop.create_task(_main())
aiorl = AIOReadline(prompt="> ", loop=loop, history_file=".aioreadline_history")
atexit.register(lambda: aiorl.stop())
try:
loop.run_forever()
except KeyboardInterrupt:
loop.stop()
Metadata
Release files for aioreadline 2024.1.25
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 |
|---|---|---|---|---|
| aioreadline-2024.1.25.tar.gz | 3.9 kB | Without provenance | Details for aioreadline-2024.1.25.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aioreadline-2024.1.25-py3-none-any.whl | Python 3 | none | any | Details for aioreadline-2024.1.25-py3-none-any.whl |
Total release size: 9.0 kB
Release files / aioreadline-2024.1.25.tar.gz
| Download URL | aioreadline-2024.1.25.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1fd1b6c9c682f855a1ef6ab2c2457822ff233161029c5e7ef54478ca895a6b37
|
|
BLAKE2b-256 checksum How to use checksums |
e07514fdf4824de264202a0016755d6ef36b84a3f2e1ee0eec3713a8aae82083
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Release files / aioreadline-2024.1.25-py3-none-any.whl
| Download URL | aioreadline-2024.1.25-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
493d1a969978d41f578d9dea2204629a12c3634675db002e0776c675214e5b74
|
|
BLAKE2b-256 checksum How to use checksums |
8ed11e7f4231f6ce586933e3655dca32dc92ba526d0ff976a0db8546726b6fd7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Security for aioreadline 2024.1.25
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.