Skip to main content

jbpy

PyPI - Version PyPI - Python Version PyPI - License SPEC 0 — Minimum Supported Dependencies
Tests Documentation Status

jbpy is a library for reading and writing Joint BIIF Profile files. Including:

  • National Imagery Transmission Format (NITF)
  • North Atlantic Treaty Organisation (NATO) Secondary Imagery Format (NSIF)

The Joint BIIF Profile is available from the NSG Standards Registry. See: https://nsgreg.nga.mil/doc/view?i=5674

Install

jbpy can be installed using pip:

$ python -m pip install jbpy

jbpy can also be installed using conda and the conda-forge channel:

$ conda install --channel conda-forge jbpy

License

This repository is licensed under the MIT license.

Features

Jbp objects

jbpy.Jbp objects provide a dict-like interface to JBP files.

>>> from tempfile import TemporaryFile
>>> import jbpy
>>> ntf = jbpy.Jbp()
>>> ntf["FileHeader"]["OSTAID"].value = "README"
>>> ntf.finalize()
>>> file = TemporaryFile()
>>> _ = ntf.dump(file)
>>> ntf2 = jbpy.Jbp()
>>> _ = file.seek(0)
>>> _ = ntf2.load(file)
>>> ntf2["FileHeader"]["OSTAID"].print()
OSTAID                  10 @          15 b'README    '

Utilities

jbpy command-line utilities make it easy to inspect JBP files.

$ jbpdump NITF_TXT_POS_04.ntf --text-segment 0
Text Only Segment.

Directly accessing URLs is possible when smart_open is installed.

$ jbpinfo https://capella-open-data.s3.amazonaws.com/data/2020/12/7/CAPELLA_C02_SM_SICD_HH_20201207083444_20201207083448/CAPELLA_C02_SM_SICD_HH_20201207083444_20201207083448.ntf | head -n 7
FHDR                     4 @           0 b'NITF'
FVER                     5 @           4 b'02.10'
CLEVEL                   2 @           9 b'06'
STYPE                    4 @          11 b'BF01'
OSTAID                  10 @          15 b'CAPELLA HQ'
FDT                     14 @          25 b'20230701003316'
FTITLE                  80 @          39 b'SICD: CAPELLA_C02_SM_SICD_HH_20201207083444_20201207083448.ntf                  '

Support Data Extensions

The JBP document provides extensibility through Support Data Extensions (SDEs) such as Tagged Record Extensions (TREs) and Data Extension Segments (DES). To mimic this extensibility, jbpy defines two entry point groups which are used to load SDE plugins:

  1. jbpy.extensions.tre
  2. jbpy.extensions.des_subheader

jbpy provides a number of built-in SDEs and will load additional SDEs from separately installed packages provided they are declared under these entry point groups as described below.

TREs

A TRE plugin is named using a 6-character (left-justified and space-padded) TRETAG. The object reference must resolve to a function with no required arguments that instantiates a jbpy.core.Tre object.

pyproject.toml example:

[project.entry-points."jbpy.extensions.tre"]
"MYTRE " = "my_package.my_module:my_tre_func"

Once registered, a TRE object can be instantiated using jbpy.tre_factory:

>>> import jbpy
>>> tre = jbpy.tre_factory("MYTRE")  # note: tag passed to factory must have trailing spaces stripped

DES Subheaders

A DES subheader plugin is named using a 27-character string formed by concatenating the 25-character DESID and 2-digit DESVER. The object reference must resolve to a function that accepts a string-valued name and instantiates a jbpy.core.DataExtensionSubheader object.

pyproject.toml example:

[project.entry-points."jbpy.extensions.des_subheader"]
"MY DES SUBHEADER         24" = "my_des_subheader_func"

Once registered, a DES subheader object can be instantiated using jbpy.des_subheader_factory:

>>> import jbpy
>>> des_subhdr = jbpy.des_subheader_factory("MY DES SUBHEADER", 24)

Testing

Some tests rely on the JITC Quick Look Test Data. If this data is available, it can be used by setting the JBPY_JITC_QUICKLOOK_DIR environment variable.

JBPY_JITC_QUICKLOOK_DIR=<path> pytest

Metadata

Release files for jbpy 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jbpy 0.7.0
File Size Uploaded Provenance Actions
jbpy-0.7.0.tar.gz 63.5 kB With provenance Details for jbpy-0.7.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jbpy 0.7.0
File Interpreter ABI Platform Actions
jbpy-0.7.0-py3-none-any.whl Python 3 none any Details for jbpy-0.7.0-py3-none-any.whl

Total release size: 110.5 kB

Release files / jbpy-0.7.0.tar.gz

Download URL jbpy-0.7.0.tar.gz
Size 63.5 kB
Tags Source
SHA-256 checksum
How to use checksums
997e3e1e8ffa3c1e23ed06b6dc731170712aa0f6aad7d69f95280e3ab51a9e68
BLAKE2b-256 checksum
How to use checksums
302f0c5e9987e89f3586c68f3e92bd2ce36a7872189bceb6f519c9b2200fa6e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / jbpy-0.7.0-py3-none-any.whl

Download URL jbpy-0.7.0-py3-none-any.whl
Size 47.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4a62b3d9ad6d8f5316b360ef612e9b254091f853906db9e59a88cffa769f6ee2
BLAKE2b-256 checksum
How to use checksums
310b10d8fd92a42bc735739b1a24234a02c150b24b8d5a71b39859b1afaf1da4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Security for jbpy 0.7.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for jbpy-0.7.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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