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
Lets say that you want to run some function defined in file test_function.py
with different arguments as separate processes and have control over them.
# In the file test_function.py
def test_just_wait(int_seconds):
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 JupyterProcessesManager
from .test_function import test_just_wait
# Create an object which will be handling processes
process_manager = JupyterProcessesManager(".")
for seconds_to_wait in range(5, 50, 5):
process_manager.add_function_to_processing(test_just_wait, 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
)
JupyterProcessesManager 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)
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
Close
Hashes for jupyter_process_manager-0.1.9.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 940490d8738c4fac2528f7d1a126955c39fc3423faf7b858ded392fb101b18de |
|
MD5 | 7ed4be5842b428fed757af9ad16e5fe9 |
|
BLAKE2b-256 | 8ea4d57666675a968bcdb3f8a147aa65b321934e4fa1fb263e6d04b9e3633877 |