NSB for Python
Night-sky background evaluation and observation planning for astronomy.
nsb-py provides Python bindings to NSB's Rust scientific engine. Evaluate
integrated optical night-sky background at a ground-based observer, UTC instant
and sky direction, or search for observing windows satisfying brightness and
visibility constraints.
Install
Python 3.10 or newer is required:
python -m pip install nsb-py
The installed distribution is nsb-py; the import is nsb.
Compatible siderust and tempoch Python runtime packages are installed as
dependencies. Version 0.2.0 requires successful registry publication.
Evaluate a point
This example uses geographic coordinates of CTAO South with generic clear-sky assumptions, not a site-calibrated observatory profile. All times must be timezone-aware.
from datetime import datetime, timezone
import nsb
import siderust
observer = siderust.Observer(
lon_deg=-70.31634, lat_deg=-24.683427, height_m=2184.6
)
target = siderust.Direction(ra_deg=266.41683, dec_deg=-29.00781)
evaluator = nsb.NsbEvaluator()
query = nsb.PointQuery(
observer,
datetime(2026, 6, 19, 3, tzinfo=timezone.utc),
target,
)
result = evaluator.evaluate(query)
print(f"{result.integrated_photons_cm2_ns_sr:.3e} ph/(cm² ns sr)")
Point outputs integrate 300–650 nm in ph cm^-2 ns^-1 sr^-1. See the
Python API guide
for component breakdowns, observing-window searches and model configuration.
Scientific applicability
NSB combines zodiacal light, integrated starlight, airglow and scattered moonlight. The default configuration is a planning model, not a prediction of absolute night-sky brightness calibrated at an observatory.
In 0.2.0, Automatic Airglow selects experimental PALACE Oxygen, limited to standard continuum geometry and zenith distance ≤60°. Out-of-domain queries raise errors; no alternative model is silently substituted. The bundled Gaia-derived Starlight map has verified provenance and cross-implementation evidence, not independently established absolute observational accuracy. CTAO planning presets are not observatory calibrations.
Before scientific use, consult validation and limitations and the model-maturity specification.
License, data and citation
NSB source code is AGPL-3.0-only. Scientific datasets retain separate licenses and conditions; Gaia-derived Starlight is subject to applicable CC BY-NC 3.0 IGO terms, potentially restricting commercial use. See third-party notices and source terms. Cite the software using CITATION.cff.
The NSB repository contains Rust, Python and CLI guides, runnable examples and reproducible scientific evidence.
Metadata
Release files for nsb-py 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nsb_py-0.2.0.tar.gz | 6.5 MB | With provenance | Details for nsb_py-0.2.0.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| nsb_py-0.2.0-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details for nsb_py-0.2.0-cp310-abi3-win_amd64.whl |
| nsb_py-0.2.0-cp310-abi3-manylinux_2_28_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ x86-64 | Details for nsb_py-0.2.0-cp310-abi3-manylinux_2_28_x86_64.whl |
| nsb_py-0.2.0-cp310-abi3-manylinux_2_28_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ ARM64 | Details for nsb_py-0.2.0-cp310-abi3-manylinux_2_28_aarch64.whl |
| nsb_py-0.2.0-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details for nsb_py-0.2.0-cp310-abi3-macosx_11_0_arm64.whl |
| nsb_py-0.2.0-cp310-abi3-macosx_10_12_x86_64.whl | CPython 3.10 | abi3 | macOS 10.12+ x86-64 | Details for nsb_py-0.2.0-cp310-abi3-macosx_10_12_x86_64.whl |
Total release size: 56.4 MB
Release files / nsb_py-0.2.0.tar.gz
| Download URL | nsb_py-0.2.0.tar.gz |
|---|---|
| Size | 6.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
958ff252a321730a9169760ef56868901ce4a4b5de845cc114c1e90c1a3b1e77
|
|
BLAKE2b-256 checksum How to use checksums |
f7fca45eba2270af600a37612542aa73371665dacc1e4c12a09d15df70bb7743
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 25, 2026.
Transparency logRelease files / nsb_py-0.2.0-cp310-abi3-win_amd64.whl
| Download URL | nsb_py-0.2.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 9.8 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
4d75347a6fc19a91ed55c3b73ca55c09c23f0248c03e403d228db0b592bee637
|
|
BLAKE2b-256 checksum How to use checksums |
5d58652ab20324f4571a75135abbc7f0ee8e4eea5e78d7b774abfa5734ac1a5e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 25, 2026.
Transparency logRelease files / nsb_py-0.2.0-cp310-abi3-manylinux_2_28_x86_64.whl
| Download URL | nsb_py-0.2.0-cp310-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 10.0 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
09757783817f5a142aca42e2383d70cecb0e8fdc69eac99d0d986528d7153f9f
|
|
BLAKE2b-256 checksum How to use checksums |
d738266ea22fe187ebdebc981b79b45c8f4c63abf5a7aec50d17649598348a79
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 25, 2026.
Transparency logRelease files / nsb_py-0.2.0-cp310-abi3-manylinux_2_28_aarch64.whl
| Download URL | nsb_py-0.2.0-cp310-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 10.1 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
f9d2e2d4180a5fd8c01c2f727a0f1acc58abd74ac117af3b4a1f9c403bb117a7
|
|
BLAKE2b-256 checksum How to use checksums |
0b0ef95b9cafff7187a139018d646c96a7859711abe1fdcc77b225fa7f30f3dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 25, 2026.
Transparency logRelease files / nsb_py-0.2.0-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | nsb_py-0.2.0-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 10.0 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
aa852dd0cb37e6700faeb709ba9e21ba1ad962e80324877a4776d0c99b63a248
|
|
BLAKE2b-256 checksum How to use checksums |
0381886d1c244ba003df836467fa36cba1b7f2cc49a048b9251482e6d41ef0e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 25, 2026.
Transparency logRelease files / nsb_py-0.2.0-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | nsb_py-0.2.0-cp310-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 10.0 MB |
| Tags | CPython 3.10 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
2a7145524e7e46f6e3e7614ed2e7411a36c49ea29ca2bb3c819b908c611ba65d
|
|
BLAKE2b-256 checksum How to use checksums |
d66d88a5c759f77b1a9ac0f6df36e2017632fc79b3a1d7e259773ff77a2ee3de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 25, 2026.
Transparency logSecurity for nsb-py 0.2.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
All 6 files in this release have been uploaded with provenance metadata.
Attestation for nsb_py-0.2.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 Oct 25, 2026.
Transparency logA 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.