Metadata-Version: 2.1
Name: jupyter-process-manager
Version: 0.1.12
Summary: Python package with widget to simplify work with many processes in jupyter
Home-page: https://github.com/stas-prokopiev/jupyter_process_manager
License: MIT
Author: Stanislav Prokopyev
Author-email: stas.prokopiev@gmail.com
Requires-Python: >=3.7,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: char (>=0.1.2,<0.2.0)
Requires-Dist: ipywidgets (>=7.7.0,<8.0.0)
Requires-Dist: local-simple-database (>=0.1.10,<0.2.0)
Requires-Dist: nest-asyncio (>=1.5.5,<2.0.0)
Requires-Dist: psutil (>=5.9.0,<6.0.0)
Requires-Dist: round-to-n-significant-digits (>=0.1.5,<0.2.0)
Requires-Dist: tabulate (>=0.8.9,<0.9.0)
Requires-Dist: yaspin (>=2.1.0,<3.0.0)
Project-URL: Repository, https://github.com/stas-prokopiev/jupyter_process_manager
Description-Content-Type: text/x-rst

=======================
jupyter_process_manager
=======================

.. image:: https://img.shields.io/github/last-commit/stas-prokopiev/jupyter_process_manager
   :target: https://img.shields.io/github/last-commit/stas-prokopiev/jupyter_process_manager
   :alt: GitHub last commit

.. image:: https://img.shields.io/github/license/stas-prokopiev/jupyter_process_manager
    :target: https://github.com/stas-prokopiev/jupyter_process_manager/blob/master/LICENSE.txt
    :alt: GitHub license<space><space>

.. image:: https://travis-ci.org/stas-prokopiev/jupyter_process_manager.svg?branch=master
    :target: https://travis-ci.org/stas-prokopiev/jupyter_process_manager

.. image:: https://img.shields.io/pypi/v/jupyter_process_manager
   :target: https://img.shields.io/pypi/v/jupyter_process_manager
   :alt: PyPI

.. image:: https://img.shields.io/pypi/pyversions/jupyter_process_manager
   :target: https://img.shields.io/pypi/pyversions/jupyter_process_manager
   :alt: PyPI - Python Version


.. contents:: **Table of Contents**

Overview.
=========================

This is a library which helps working with many processes in a jupyter notebook in a very simple way.

Installation via pip:
======================

.. code-block:: bash

    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.


.. code-block:: python

    # 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:

.. code-block:: python

    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
--------------------------------------------------------------------------------------------------

.. code-block:: python

    process_manager.show_jupyter_widget(
        int_seconds_step=2,
        int_max_processes_to_show=20
    )

.. image:: images/2.PNG

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
--------------------------------------------------------------------------------------------------

.. code-block:: python

    process_manager.wait_till_all_processes_are_over(int_seconds_step=2)

.. image:: images/1.PNG


How to Debug
--------------------------------------------------------------------------------------------------

.. code-block:: python

    # arguments are the same as in **add_function_to_processing(...)**
    process_manager.debug_run_of_1_function(func_to_process, *args, **kwargs)

Links
=====

    * `PYPI <https://pypi.org/project/jupyter_process_manager/>`_
    * `readthedocs <https://jupyter_process_manager.readthedocs.io/en/latest/>`_
    * `GitHub <https://github.com/stas-prokopiev/jupyter_process_manager>`_

Project local Links
===================

    * `CHANGELOG <https://github.com/stas-prokopiev/jupyter_process_manager/blob/master/CHANGELOG.rst>`_.

Contacts
========

    * Email: stas.prokopiev@gmail.com
    * `vk.com <https://vk.com/stas.prokopyev>`_
    * `Facebook <https://www.facebook.com/profile.php?id=100009380530321>`_

License
=======

This project is licensed under the MIT License.

