Metadata-Version: 2.4
Name: jtexport
Version: 0.1.0
Summary: Export #export cells from Jupytext (py:percent) files into clean modules
Author: Assefa Seyoum
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# jtexport

Export only `#export`-tagged cells from Jupytext (py:percent) notebooks to a clean Python module tree under `exports/`.

## Why?

Working in Jupyter Lab with Jupytext is great, but the `# %%` cell markers and exploratory cells aren't what you want in your final codebase. `jtexport` lets you mark just the relevant cells (`#export`) and build a clean module mirror for packaging/testing.

## Usage

```bash
# Process one file
jtexport path/to/notebook.py


# Process a directory recursively
jtexport notebooks/


# Custom output directory and project root
jtexport notebooks/ --outdir build/exports --project-root .


# Keep magics, fail if a file has no export cells
jtexport . --keep-magics --fail-on-empty


## Example
Consider a Jupytext file nb/example.py like:
```python
# %%
#export
import math

def cos2(x):
  return math.cos(2 * x)

# %%
print(cos2(1.0)) # dev-only cell

```

Running:

`jtexport nb/example.py`

Produces:

`exports/nb/example.py`

With contents similar to:

```python
# This file was auto-generated by jtexport.
# Source: nb/example.py


import math


def cos2(x):
  return math.cos(2 * x)
```
