Skip to main content

Convert jupyter notebooks to reports, with different levels of detail based on tags

Project description

JupDoc: Convert Jupyter Notebooks with Role-Based Access Control

PyPI Version Python Versions License

JupDoc is a Python package that simplifies the process of converting Jupyter Notebooks into multiple docx files or other formats while applying role-based access control based on cell tags.

Please note that this package is still under development, and the documentation is not complete. There may be bugs and the API may change.

Features

  • Convert Jupyter Notebooks to docx, PDF, HTML, and more.
  • Define access roles using cell tags.
  • Generate separate documents for each access role.

Installation

You can install JupDoc using pip:

pip install jupdoc

JupDoc is based on Quarto to convert ipynb files to other formats. The instructions to install quarto can be found here.

Usage

We support two ways to convert notebooks to docs. The first one is using the command line interface. The second one is using the python API.

Command Line Interface

The command line interface can be used as follows:

jupdoc --config <config_file>

In case of absence of the config file, the configs can be passed as command line arguments:

jupdoc --filename <filename> --tags <tags> --prefix <prefix> --output <output> --format <format>

The arguments are as follows:

  • filename: The path to the notebook file.
  • tags: The tags to be used for access control. Multiple tags can be passed as a comma-separated string.
  • prefix: The prefix to be used for the output files.
  • output: The path to the output directory.
  • format: File format to be exported to.

Python API

The python API can be used as follows:

from jupdoc import convert
args = {
    "filename": "notebook.ipynb",
    "tags": ["tag1", "tag2"],
    "prefix": "prefix",
    "output": "output",
    "format": "docx"
}
convert(**args)

To Do

  1. Improve documentation.
  2. Provide upload to Google Drive option.
  3. Add support for report templates.
  4. Add support for multiple cell tags.

License

This project is licensed under the terms of the MIT license.

Acknowledgements

This project is based on Quarto.

Contributing

Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given. You can contribute in many ways:

  • Report bugs.
  • Fix bugs and submit pull requests.
  • Write, clarify, or fix documentation.
  • Suggest or add new features.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jupdoc-0.0.2.tar.gz (5.0 kB view hashes)

Uploaded Source

Built Distribution

jupdoc-0.0.2-py3-none-any.whl (7.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page