Metadata-Version: 2.1
Name: nbmodular
Version: 0.0.1
Summary: Convert notebooks to modular code
Home-page: https://github.com/JaumeAmoresDS/nbmodular
Author: Jaume Amores
Author-email: jaume.dsdev@gmail.com
License: Apache Software License 2.0
Keywords: nbdev jupyter notebook python
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: License :: OSI Approved :: Apache Software License
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Provides-Extra: dev
License-File: LICENSE

nbmodular
================

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

Convert data scientist notebooks with poor modularity to fully modular
notebooks and / or python modules.

## Roadmap

- Convert cell code into functions:
  - Inputs are those variables detected in current cell and also
    detected in previous cells. This solution requires that created
    variables have unique names across the notebook. However, even if a
    new variable with the same name is defined inside the cell, the
    resulting function is still correct.
  - Outputs are, at this moment, all the variables detected in current
    cell that are also detected in posterior cells.
- Filter out outputs:
  - Variables detected in current cell, and also detected in previous
    cells, might not be needed as outputs of the current cell, if the
    current cell doesn’t modify those variables. To detect potential
    modifications:
    - AST:
      - If variable appears only on the right of assign statements or in
        if statements.
      - If it appears only as argument of functions which we know don’t
        modify the variable, such as `print`.
    - Comparing variable values before and after cell:
      - Good for small variables where doing a deep copy is not
        computationally expensive.
    - Using type checker:
      - Making the variable `Final` and using mypy or other type checker
        to see if it is modified in the code.
  - Provide hints:
    - Variables that come from other cells might not be needed as
      output. The remaining are most probably needed.
    - Variables that are modified are clearly needed.

## Install

``` sh
pip install nbmodular
```
