Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mpcurses-0.0.9.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

mpcurses-0.0.9-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file mpcurses-0.0.9.tar.gz.

File metadata

  • Download URL: mpcurses-0.0.9.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.5

File hashes

Hashes for mpcurses-0.0.9.tar.gz
Algorithm Hash digest
SHA256 0178329109f61bdf8908db059b7bab763c65f6cd4e2b657aa615a3320a5fd807
MD5 9f43cdff094fec1773f57aff47d017b0
BLAKE2b-256 a4d8a64f8d36b9efdb8318208329d95366909a85fdbb00adc4b8493c44613a7b

See more details on using hashes here.

Provenance

File details

Details for the file mpcurses-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: mpcurses-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.5

File hashes

Hashes for mpcurses-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 5485f42c86ed5b183176f0605093d5f5c5205b6e7c25b4714313f249621fdc3e
MD5 b82b45341609fda5060aee1c614d2b11
BLAKE2b-256 4d35cb282da9ee75f8fe1eee1812887b10f4dd3cb539adfb4675b309aa048fc3

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page