Skip to main content

nbimgextract

License:MIT PyPI - Version codecov

nbimgextract is a command-line tool for extracting images from Jupyter Notebooks.

Usage

Usage: nbimgextract [OPTIONS] <FILE>

Arguments:
  <FILE>  path to ipynb file from which to extract files

Options:
  -o, --output-path <OUTPUT_PATH>  output directory for images
  -t, --tag-prefix <TAG_PREFIX>    Prefix for cell tags to create the file name
  -q, --quiet                      Disable output of written files
  -Q, --print-filenames            Output written files to terminal [default]
      --dry-run                    Do not write any files
      --write-files                Write image files [default]
  -h, --help                       Print help
  -V, --version                    Print version

Non Empty Dir Actions:
      --error      Raise an error when the target directory is not empty [default]
      --clear-dir  If target dir is not empty, delete it
      --proceed    Ignore non-empty target dir

Output File Names

By default, the names of the image files extracted from a notebook are based on the ordinal number of the cell, zero-padded to the width of the cell count: for example, the image from the third cell of a 13-cell notebook is named img-03.

However, you can also specify the desired file names within the notebook in a few ways.

  1. Comment in the cell code
  2. Cell tag

If a cell has a valid comment and a valid tag, the comment has priority. If a cell produces multiple images/plots, these will be numbered: name-1, name-2, and so on. If two cells would produce the same file name, the later one gets a numeric suffix; images never silently overwrite each other.

Labels must be plain file names: a label containing a path separator or .. is ignored with a warning, and files are always written inside the output directory.

Comment

nbimagextract allows you to specify the desired image filename via a comment in the cell's code. To be detected, the comment must begin with label: — after the # and an optional | — followed by the desired filename. Both # label: name and Quarto's #| label: name forms work; comments that merely contain the word, such as # xlabel: time, do not set the name. Any whitespace around the filename will be trimmed.

The comment must appear in the cell's leading comment block: the comment lines at the very top of the cell, before the first code or blank line. A label: comment further down the cell is ignored.

For example, the plot produced by the cell with the following code will be saved as sin-plot.

# label: sin-plot
x = np.linspace(0, 2 * np.pi, 100)
y = np.sin(x)
plt.plot(x, y)

This closely follows the convention Quarto uses for applying labels to plots for the purposes of cross referencing, with the | after the # made optional.

Cell Tags

You can use cell tags to specify the file name for the image generated by that cell. The tag should start with img and anything after that prefix will be used in the file name. You can override this prefix with the --tag-prefix option. Any spaces, hyphens or underscores immediately following the prefix will be ignored. That is to say, if the tag is img-my-chart, the resulting file names will be called my-chart.

Download files

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

Source Distribution

nbimgextract-0.3.1.tar.gz (158.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

nbimgextract-0.3.1-py3-none-win_amd64.whl (460.8 kB view details)

Uploaded Python 3Windows x86-64

nbimgextract-0.3.1-py3-none-win32.whl (424.1 kB view details)

Uploaded Python 3Windows x86

nbimgextract-0.3.1-py3-none-musllinux_1_2_x86_64.whl (672.6 kB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

nbimgextract-0.3.1-py3-none-musllinux_1_2_i686.whl (695.7 kB view details)

Uploaded Python 3musllinux: musl 1.2+ i686

nbimgextract-0.3.1-py3-none-musllinux_1_2_armv7l.whl (640.3 kB view details)

Uploaded Python 3musllinux: musl 1.2+ ARMv7l

nbimgextract-0.3.1-py3-none-musllinux_1_2_aarch64.whl (658.6 kB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

nbimgextract-0.3.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (620.0 kB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

nbimgextract-0.3.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl (651.9 kB view details)

Uploaded Python 3manylinux: glibc 2.17+ s390x

nbimgextract-0.3.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (741.9 kB view details)

Uploaded Python 3manylinux: glibc 2.17+ ppc64le

nbimgextract-0.3.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl (674.9 kB view details)

Uploaded Python 3manylinux: glibc 2.17+ i686

nbimgextract-0.3.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (605.2 kB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARMv7l

nbimgextract-0.3.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (605.5 kB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

nbimgextract-0.3.1-py3-none-macosx_11_0_arm64.whl (566.0 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

nbimgextract-0.3.1-py3-none-macosx_10_12_x86_64.whl (580.4 kB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file nbimgextract-0.3.1.tar.gz.

File metadata

  • Download URL: nbimgextract-0.3.1.tar.gz
  • Upload date:
  • Size: 158.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for nbimgextract-0.3.1.tar.gz
Algorithm Hash digest
SHA256 d87c3bb8c77c1312345bbe5860c637bfdf16bdad5f49dfe103569d2b8dc154d7
MD5 f45c1045be8cc519818625d9f8350cca
BLAKE2b-256 084b41631a9c194b32021e0da754da53302b1756f175b9bc257cb96106b96a73

See more details on using hashes here.

Provenance

The following attestation bundles were made for nbimgextract-0.3.1.tar.gz:

Publisher: CI.yml on felixgwilliams/nbimgextract

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nbimgextract-0.3.1-py3-none-win_amd64.whl.

File metadata

  • Download URL: nbimgextract-0.3.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 460.8 kB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for nbimgextract-0.3.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 a63febda3ed25cdd43d2ca478f54bcf734a1f491516841b2107d8ca80c57c849
MD5 8881eccceeb66114cf1420c0a72c8bde
BLAKE2b-256 db6bccefe89c536794d2d48e7cbb8e8f3c062234127e8130eb76a95b6fff1c70

See more details on using hashes here.

Provenance

The following attestation bundles were made for nbimgextract-0.3.1-py3-none-win_amd64.whl:

Publisher: CI.yml on felixgwilliams/nbimgextract

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nbimgextract-0.3.1-py3-none-win32.whl.

File metadata

  • Download URL: nbimgextract-0.3.1-py3-none-win32.whl
  • Upload date:
  • Size: 424.1 kB
  • Tags: Python 3, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for nbimgextract-0.3.1-py3-none-win32.whl
Algorithm Hash digest
SHA256 ee83cf7d1aa540523e68c856ac1e285cd4327afe3e6a690622cd8d7f42e24e87
MD5 9d04752dec4f9e32f88f5ccfa836177a
BLAKE2b-256 49cd770781e385b49b8ab5d6f05f3bbc1dd55bd9753c931a26268498bc22cbd1

See more details on using hashes here.

Provenance

The following attestation bundles were made for nbimgextract-0.3.1-py3-none-win32.whl:

Publisher: CI.yml on felixgwilliams/nbimgextract

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nbimgextract-0.3.1-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for nbimgextract-0.3.1-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 d9fc17c18f6fd96254197d398ca2d86ce7aa718b1e56fb1ba41dc9db412d49e3
MD5 d45c22e0f3dd498a4b40814933090ca0
BLAKE2b-256 be82442ec1f01bf0a33b143156b6bab91ed35265d7d6d37b187021595706cacd

See more details on using hashes here.

Provenance

The following attestation bundles were made for nbimgextract-0.3.1-py3-none-musllinux_1_2_x86_64.whl:

Publisher: CI.yml on felixgwilliams/nbimgextract

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nbimgextract-0.3.1-py3-none-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for nbimgextract-0.3.1-py3-none-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 81984916228756057af5c277827cc75d614a34ca49d0247c11827f7d16fe1cb1
MD5 f9c1e52e3354de6b678c8a9619a95289
BLAKE2b-256 89b463210bda3fb53ba32b872bc207ddfd6dcf44381b6fa1c6031470f8ff88b3

See more details on using hashes here.

Provenance

The following attestation bundles were made for nbimgextract-0.3.1-py3-none-musllinux_1_2_i686.whl:

Publisher: CI.yml on felixgwilliams/nbimgextract

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nbimgextract-0.3.1-py3-none-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for nbimgextract-0.3.1-py3-none-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 de06d1614d285ddfa12585410d80122e3dfc167fb3005f7d9f410961077c1c9f
MD5 90dc385efc3466ac3b97887978033519
BLAKE2b-256 6fbd02247f57fdbdde9fbd88258d73582eeba94fc463df1ee9d5bb40074f449b

See more details on using hashes here.

Provenance

The following attestation bundles were made for nbimgextract-0.3.1-py3-none-musllinux_1_2_armv7l.whl:

Publisher: CI.yml on felixgwilliams/nbimgextract

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nbimgextract-0.3.1-py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for nbimgextract-0.3.1-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 76ef7f01e6de6177cb3eb7c76de40a78526d4bc1ee4c34a8643efa78dc719595
MD5 faf8046101d496e3893f9c76456f93ae
BLAKE2b-256 9bfd443efba3c348b3882d2724750fee7a69442ad06d855e993868c44e08848d

See more details on using hashes here.

Provenance

The following attestation bundles were made for nbimgextract-0.3.1-py3-none-musllinux_1_2_aarch64.whl:

Publisher: CI.yml on felixgwilliams/nbimgextract

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nbimgextract-0.3.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for nbimgextract-0.3.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bdc0b07af80fddf17e0c65ce4ef2100172cd5659dd61e7d51488f83227a296e7
MD5 d199cfa83923631b6c2ba3ee16d2738b
BLAKE2b-256 c5a489579a9cfd8c33664a087bd1f73d4ec924c9776d9735adbcb1b5f0c77b77

See more details on using hashes here.

Provenance

The following attestation bundles were made for nbimgextract-0.3.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: CI.yml on felixgwilliams/nbimgextract

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nbimgextract-0.3.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for nbimgextract-0.3.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 cfbea9770ba50f641c1074aced91f199085a99af73d5960b7d55aae67915e1e5
MD5 8f7ef273e3286f14d979c01cb7899ff1
BLAKE2b-256 e6bd2675cd668be4ecb40189b231e6d9629c74af2f73a47c7911370569128097

See more details on using hashes here.

Provenance

The following attestation bundles were made for nbimgextract-0.3.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl:

Publisher: CI.yml on felixgwilliams/nbimgextract

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nbimgextract-0.3.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for nbimgextract-0.3.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 b2dc6fa6a824dd53e31ab08cdc663859ea3020b4dacad08b990bb771e601b876
MD5 89ac4c65111b8f776dfb8a81ab966197
BLAKE2b-256 8c55c829e5eb4485dd1aa0761376540d02821a4d9344bbf4ae79a4487c291ef4

See more details on using hashes here.

Provenance

The following attestation bundles were made for nbimgextract-0.3.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl:

Publisher: CI.yml on felixgwilliams/nbimgextract

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nbimgextract-0.3.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for nbimgextract-0.3.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 696bb6a9be1a9f2a34d4bb8101aa6d4c2c4b89a0a63291342e282c8047fd77d5
MD5 56ca97f8b7a8b9680b31b7e9f5a40785
BLAKE2b-256 cd8f13aaf4a1915fb467f2aa55c6b401326a7875161fe5ac3c76918583e0df3f

See more details on using hashes here.

Provenance

The following attestation bundles were made for nbimgextract-0.3.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl:

Publisher: CI.yml on felixgwilliams/nbimgextract

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nbimgextract-0.3.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for nbimgextract-0.3.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 cfc553b29c60e0d13f8387f438bc7a787b62148c9b5c33cd66c3d218869cfcf0
MD5 b3a54f98b2554e691ef6eeb05c20a62a
BLAKE2b-256 3f447410d3beb6090d3e1c4d95c357e356340e81b0260282439caea7d4b36cb9

See more details on using hashes here.

Provenance

The following attestation bundles were made for nbimgextract-0.3.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl:

Publisher: CI.yml on felixgwilliams/nbimgextract

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nbimgextract-0.3.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for nbimgextract-0.3.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f8accc6a95b0c8acb5d8171b224e3d2d35c1db9d9cf49e95cd3ca47088157e8f
MD5 d27141ae8511e6d3553aa2062aef7bc9
BLAKE2b-256 7b3d4276b531f2f815a241a9d30c08d847e272e2fe5e361300a6997d96bdedb8

See more details on using hashes here.

Provenance

The following attestation bundles were made for nbimgextract-0.3.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: CI.yml on felixgwilliams/nbimgextract

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nbimgextract-0.3.1-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for nbimgextract-0.3.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7061a809bceb81bee180a2ffcc7f3e300bf6c3b50ec15b4d909a7f429d29064f
MD5 74258bf3bf685775b49249dafb00ab02
BLAKE2b-256 cb2b32e0afdefcfa8497a6765c01e76b7b7ca46bec7328196a5d026957735503

See more details on using hashes here.

Provenance

The following attestation bundles were made for nbimgextract-0.3.1-py3-none-macosx_11_0_arm64.whl:

Publisher: CI.yml on felixgwilliams/nbimgextract

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nbimgextract-0.3.1-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for nbimgextract-0.3.1-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 caf4e4fd4449b3064c6ab0ddb5d8ffe641cc1061dedea5d018473460e569f9f5
MD5 6a79351cdb69ec0874abd6e733ae124e
BLAKE2b-256 868d9c55b8901df8ecd0c8179bac397996cc3e9f0191bf52e736385edaaf41f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for nbimgextract-0.3.1-py3-none-macosx_10_12_x86_64.whl:

Publisher: CI.yml on felixgwilliams/nbimgextract

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.3.1 This release

15 files

0.3.0

15 files

0.2.1

15 files

0.2.0

15 files

0.1.2

15 files

0.1.1

15 files

0.1.0

15 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page