Skip to main content

PDF export for Drawio diagrams in JupyterLab

Project description

IPyDrawio Export

binder-badge install from pypi install from conda-forge build coverage

PDF export of drawio diagrams for JupyterLab.

See the main project repo for more information.

Installation

Note: the mamba/conda installation method ensures nodejs is available

mamba install -c conda-forge ipydrawio-export  # recommended, or...
conda install -c conda-forge ipydrawio-export  # or...
pip install ipydrawio-export

Server Extension

ipydrawio-export runs as a server extension. When installed, it should be automatically configured. If problems arise, it can be manually enabled:

jupyter server extension list   # If you don't see it here...
jupyter server extension enable --sys-prefix --py ipydrawio_export  # run this...
jupyter server extension list   # ... then check it again

Note: If you are starting your server with jupyter notebook (not jupyter lab), the commands above will be serverextension instead of server extension!

Command-Line Usage

Exporting PDF

PDF can also be generated from the command line:

jupyter drawio-export pdf some_file.dio

If needed, the nodejs application will be installed into the Jupyter data path.

jupyter config --paths  # it uses the one in the environment

In the future, it's hoped this can be packaged more conveniently.

Provisioning

To ensure the nodejs application is installed without exporting a PDF (e.g when building a docker container).

jupyter ipydrawio-export provision

Provision locations

If defined, these environment variables will be respected, and an ipydrawio_export folder will be created within:

  • $JUPYTER_DATA_DIR
  • $IPYDRAWIO_DATA_DIR

Otherwise, ipydrawio-export will provision its files into {sys.prefix}/share/jupyter/ipydrawio_export.

Of note:

  • access to the internet is required
  • this location must be writeable by the user
  • there must be about 400MiB available, primarily for puppeteer's chromium

The effective location can be verified with:

jupyter ipydrawio-export provision --workdir

Open Source

This work is licensed under the Apache-2.0 License.

The vendored code from @jgraph/draw-image-export2 is also licensed under the Apache-2.0 License.

Copyright 2021 ipydrawio contributors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Download files

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

Source Distribution

ipydrawio-export-1.1.2.tar.gz (89.6 kB view details)

Uploaded Source

Built Distribution

ipydrawio_export-1.1.2-py3-none-any.whl (109.2 kB view details)

Uploaded Python 3

File details

Details for the file ipydrawio-export-1.1.2.tar.gz.

File metadata

  • Download URL: ipydrawio-export-1.1.2.tar.gz
  • Upload date:
  • Size: 89.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for ipydrawio-export-1.1.2.tar.gz
Algorithm Hash digest
SHA256 b780a5fd4e5678f20f5e687d1e75c169534383f59fbaede5c96c3b20d0cb6c24
MD5 825c80c7f4563f7e01c228df594728f6
BLAKE2b-256 45f23aa341356162831b54835cdbc827672770ba9edae059bf1020f0c5b80cee

See more details on using hashes here.

Provenance

File details

Details for the file ipydrawio_export-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: ipydrawio_export-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 109.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for ipydrawio_export-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1b717d013b980bed38136777af57f27facec704eb0a9d22cc356b7c355924cf7
MD5 0b9f8120500afe7ca349b2480e5d65a2
BLAKE2b-256 2f2ab588b2235bfa020eceef5fa1a1dc48cd17ebb2702d9be11d2082d84c2376

See more details on using hashes here.

Provenance

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