A framework that exposes a simple set of APIs enabling multi-process integration with the curses screen painting library
Project description
mpcurses is a framework that exposes a simple set of APIs enabling multi-process integration with the curses screen painting library.
With mpcurses, the complexities of setting up multi-processing within a curses environment are abstracted into a few simple APIs and constructs. The main features:
Execute a method across one or more concurrent processes
Queue method execution to ensure only a predefined number of processes are running
Define curses screen layout using a Python dict
Leverage built-in directives for updating screen dynamically * Keep numeric counts * Update text values * Update text colors * Maintain visual indicators * Update progress bars * Display table of data coming from concurrent proceses
How it works
The method you wish to execute concurrently is decorated with the queue handler decorator. The queue handler decorator creates a new log handler that will write all logged messages within the decorated method to a thread-safe queue. The main process creates the thread-safe message queue and handles the spawning of the desired number of concurrent processes, each process will be passed the reference to the message queue upon startup. As the process executes it will send all log messages to the message queue. The main process will then read messages from the message queue as they come in and update the curses screen accordingly.
The layout of the curses screen is defined as a dictionary and can leverage builtin constructs for capturing messages, incrementing counters, and processing side effects such as changing text colors when certain messages appear. The result is a screen that is being updated dynamically from one or more concurrent processes running in the background.
For samples checkout our home page: https://github.com/soda480/mpcurses
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
File details
Details for the file mpcurses-0.0.11.tar.gz
.
File metadata
- Download URL: mpcurses-0.0.11.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e872e19b3179d99640d3a66f173ad592eaf24bded9803c60cd7a76983b4ea8d3 |
|
MD5 | 24f7f046060d9467f232c186f497c551 |
|
BLAKE2b-256 | 7e9a2b19d7d71f6cef54720c4a5947b9b0acf27501fcf5e023994567f6547619 |
Provenance
File details
Details for the file mpcurses-0.0.11-py3-none-any.whl
.
File metadata
- Download URL: mpcurses-0.0.11-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d647c5780f2a600dc1fdc260911c524a64c3fc9751ee186253e99aa50fcf87bc |
|
MD5 | 0c4cd30af2913b1f3829823fcc78b688 |
|
BLAKE2b-256 | 262570ff2a1d900ed9cad51bf2dadc3bb10d1b241130736ee4bec228818e21ec |