Python package with widget to simplify work with many processes in jupyter
Project description
Overview.
This is a library which helps working with many processes in a jupyter notebook in a very simple way.
Installation via pip:
pip install jupyter_process_manager
Usage examples
# In the file test_function.py
def test_just_wait(int_seconds, test_msg=""):
if test_msg:
print(test_msg)
for int_num in range(int_seconds):
print(int_num)
sleep(1)
Then to run it you just need to do the following:
from jupyter_process_manager import JPM
# OR from jupyter_process_manager import JupyterProcessManager
from .test_function import test_just_wait
# Create an object which will be handling processes
process_manager = JPM(".")
for seconds_to_wait in range(5, 30, 5):
process_manager.add_function_to_processing(
test_just_wait,
seconds_to_wait,
test_msg="hi" * seconds_to_wait
)
All the processes were started and now you can check what is happening with them
WARNING: Please do NOT try to use functions defined inside jupyter notebook, they won’t work.
Show processes output as widget
process_manager.show_jupyter_widget(
int_seconds_step=2,
int_max_processes_to_show=20
)
JPM arguments
str_dir_for_output: Directory where to store processes output
is_to_delete_previous_outputs=True: Flag If you want to delete outputs for all previous processes in the directory
Usual print output
process_manager.wait_till_all_processes_are_over(int_seconds_step=2)
How to Debug
# arguments are the same as in **add_function_to_processing(...)**
process_manager.debug_run_of_1_function(func_to_process, *args, **kwargs)
Links
Project local Links
Contacts
License
This project is licensed under the MIT License.
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 jupyter_process_manager-0.1.12.tar.gz
.
File metadata
- Download URL: jupyter_process_manager-0.1.12.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.7 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32a0035cbd22a93c74fed4cd7efc9e6927de8ee1aa575045baa66f6d1f2f2028 |
|
MD5 | 1d923e3b4bfcae19c2d54df97af918fd |
|
BLAKE2b-256 | de102e0696975605d377bfe85fc6e03206985e20ef6785cf588812f1ac92a453 |
Provenance
File details
Details for the file jupyter_process_manager-0.1.12-py3-none-any.whl
.
File metadata
- Download URL: jupyter_process_manager-0.1.12-py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.7 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a280a8a3c14ab3193964b8b441075b15e95e8be5f1b12e5c4a8236e9f0e91286 |
|
MD5 | bfee5617116f4399224472ebe72ab2e9 |
|
BLAKE2b-256 | 4982bfe3dfb30b32a0a710a7c6c08cd77d3bbbef8703edc7628d1640e73133b4 |