Helpers for asynchronous line processing. Some asynchronous readline implementations consume data if a readline() call times out. This is a wrapper for those implementations, guranteeing that either full lines are returned or nothing.
Project description
Atomic-Lines
Warning
The project is in its proof of concept phase: it might cease to exist, and the code quality is lacking. Documentation is currently nonexisting. Use at your own risk.
Intro
A toy project, wrapping asynchronous one byte readers into a sane(?) readline semantic. If no end of line is found the request is considered timedout, and the data is kept in the buffer, otherwise lines are returned (without the EOL character) for further processing.
The main goal is to help wrap i.e. serial access or other apis which consume data if readline times out.
Logging configuration
Logging can be configured by pointing the environment variable ATOMICLINES_LOG_CONFIG
to a yaml file.
ATOMICLINES_LOG_CONFIG=logging_configuration.yaml pytest
The yaml file, should contain a logging dict. Example file:
version: 1
disable_existing_loggers: true
formatters:
standard:
format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
error:
format: "%(levelname)s <PID %(process)d:%(processName)s> %(name)s.%(funcName)s(): %(message)s"
handlers:
console:
class: logging.StreamHandler
level: DEBUG
formatter: standard
stream: ext://sys.stdout
loggers:
atomiclines:
level: INFO
handlers: [console]
propogate: no
For Developers
Bash Completion for pytest
pip install argcomplete # is a dev dependency too
activate-global-python-argcomplete
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for atomic_lines-0.1.0a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab65dce5adab3c35d19c023f9dc9ae00082b48c3c988bbdc71ca0f1f55813480 |
|
MD5 | c42a3b1b12287f524bb2302dc557761b |
|
BLAKE2b-256 | 1d90e77e596a76828ae50e557754cc57867b186aeb3935ef06459277e84a933a |