Skip to main content

SciNumTools3 for Python

PyPI version Python License: MIT

SciNumTools3 provides unit-aware quantities and validated scientific configuration for Python. Use it to convert physical units, perform dimension-aware calculations, and load typed parameters whose units and constraints are checked at runtime.

The package includes:

  • scinumtools3.puq for quantities, uncertainties, unit systems, and conversions
  • scinumtools3.dip for typed, validated configuration files
  • scinumtools3.api for formatted, command-style evaluation
  • NumPy interoperability for array values

Evaluated DIP environments can generate reports in TeX, PDF, Markdown, reStructuredText, HTML, Typst, plain text, or Brief++ document JSON with Environment.generate_report(ReportFormat.HTML, "report.html") (or another ReportFormat). See the Python guide.

Installation

SciNumTools3 requires Python 3.9 or later and depends on NumPy.

pip install scinumtools3

Quick start

from scinumtools3.puq import Quantity

distance = Quantity(1.5, "km")
time = Quantity("2*min")

speed = (distance / time).convert("m*s-1")
print(speed)  # 12.5*m*s-1

Incompatible dimensions are rejected instead of being combined silently.

Quantities and units

Quantity accepts strings, Python numbers and sequences, and NumPy arrays. It supports unit-aware arithmetic, comparisons, uncertainties, and conversion between compatible units and unit systems.

Quantity-aware NumPy operations include np.add, np.sqrt, and np.sum over all elements. Quantity ** exponent and scinumtools3.puq.sqrt(quantity) also preserve units. The sum keeps the quantity's units and adds absolute uncertainties linearly. Use .to_numpy() or .value(numpy=True) when you explicitly want a plain NumPy array without units.

PUEL (Physical Units Expression Language) expressions may contain scalar or array values, uncertainties, dimensions, constants, and units. For example:

from scinumtools3.puq import Quantity

lengths = Quantity("[2,3,4]*km")
measurement = Quantity("1.346591(30)e27*kg")

For conversions between unit systems, pass the target system and, when the dimensions are ambiguous between systems, the physical-quantity context:

from scinumtools3.puq import Quantity
from scinumtools3.puq.systems import ESU

current = Quantity("23*A").convert("statA", ESU, "I")

Input parameters

DIP parses DIPL (Dimensional Input Parameter Language) definitions from strings or files. DIPL provides typed parameters, units, constraints, dependencies, groups, lists, maps, and references.

Given parameters.dip:

simulation
  timestep float = 0.5 fs
    !condition ({.} > 0 fs)
  steps int = 1000000
    !condition ({.} > 1)
  duration float = ( {?simulation.timestep} * {?simulation.steps} ) fs

Parse it into an environment:

from pathlib import Path
from scinumtools3.dip import DIP

dip = DIP()
dip.add_file(Path("parameters.dip"))
env = dip.parse()

You can also add definitions directly:

dip = DIP()
dip.add_string("length float = 2.5 dm")
dip.add_string("count int = 42")
env = dip.parse()

Accessing nodes

There are two main ways to access nodes in an environment:

  • Cursor: use env["path"] to inspect a known path or traverse groups and collections.
  • Select: use env.select(...) to discover value nodes by path and tags and inspect snapshots of the results.

Cursor: inspect a known path

cursor = env["length"]
print(cursor.value, cursor.units, cursor.metadata.description)

A cursor accesses a path in the environment. Use cursor.elements() to traverse list elements and cursor.items() to traverse named items in a map. Cursor values are ordinary Python values: bool, int, float, str, or nested lists. Use cursor.to_numpy() to obtain a NumPy array. A cursor also exposes its units, shape, and child traversal methods. To convert a unit-bearing DIPL result, construct a quantity from its value and the string representation of its units:

from scinumtools3.puq import Quantity

length = env["length"]
length_cm = Quantity(length.value, length.units.to_string()).convert("cm")
print(length_cm)  # 25*cm

Select: discover and inspect nodes

Use select() to discover values and inspect their tags and metadata directly:

dip = DIP()
dip.add_string('''physics
  speed float = 2 m/s
    !tags ["export", "runtime", "hydro"]
    ?descr "Flow speed"
''')
env = dip.parse()
for node in env.select(
    "?physics.",
    tags_all=["export", "runtime"],
    tags_any=["hydro", "gravity"],
    tags_none=["internal", "deprecated"],
):
    print(node.name, node.value, node.tags, node.metadata.description)

The three filters combine with AND; omitted or empty filters impose no restriction. Only explicitly assigned tags match: children do not inherit their parent's tags. ? selects the whole environment, ?physics. selects a subtree including its value-bearing root and collection members, and ?physics.speed selects an exact node. Results retain fully qualified paths in environment order, with each node returned once. No matches returns an empty list.

Selected nodes are independent snapshots; selection does not modify the environment. Tags are returned as a separate Python list, and metadata remains valid while its Python wrapper is alive.

Additional request helpers remain available in the Python API reference.

Command-style API helpers

The scinumtools3.api.puq and scinumtools3.api.dip modules expose the same application-oriented operations as the snt command-line interface:

from scinumtools3.api.puq import PUQEval

command = PUQEval("1*cm + 2*dm")
print(command.execute())  # 21*cm

Use Quantity and DIP when you need typed Python objects; use the API helpers when you want formatted command-style output without starting a subprocess.

Documentation

License

SciNumTools3 is distributed under the MIT License.

Metadata

Release files for scinumtools3 0.9.13

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

Source distribution (sdist)

Source distribution for scinumtools3 0.9.13
File Size Uploaded Provenance Actions
scinumtools3-0.9.13.tar.gz 36.8 MB With provenance Details for scinumtools3-0.9.13.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for scinumtools3 0.9.13
File Actions
scinumtools3-0.9.13-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for scinumtools3-0.9.13-cp313-cp313-win_amd64.whl
scinumtools3-0.9.13-cp313-cp313-manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64 Details for scinumtools3-0.9.13-cp313-cp313-manylinux_2_28_x86_64.whl
scinumtools3-0.9.13-cp313-cp313-macosx_14_0_arm64.whl CPython 3.13 CPython 3.13 macOS 14.0+ ARM64 Details for scinumtools3-0.9.13-cp313-cp313-macosx_14_0_arm64.whl
scinumtools3-0.9.13-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for scinumtools3-0.9.13-cp312-cp312-win_amd64.whl
scinumtools3-0.9.13-cp312-cp312-manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64 Details for scinumtools3-0.9.13-cp312-cp312-manylinux_2_28_x86_64.whl
scinumtools3-0.9.13-cp312-cp312-macosx_14_0_arm64.whl CPython 3.12 CPython 3.12 macOS 14.0+ ARM64 Details for scinumtools3-0.9.13-cp312-cp312-macosx_14_0_arm64.whl
scinumtools3-0.9.13-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for scinumtools3-0.9.13-cp311-cp311-win_amd64.whl
scinumtools3-0.9.13-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details for scinumtools3-0.9.13-cp311-cp311-manylinux_2_28_x86_64.whl
scinumtools3-0.9.13-cp311-cp311-macosx_14_0_arm64.whl CPython 3.11 CPython 3.11 macOS 14.0+ ARM64 Details for scinumtools3-0.9.13-cp311-cp311-macosx_14_0_arm64.whl
scinumtools3-0.9.13-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for scinumtools3-0.9.13-cp310-cp310-win_amd64.whl
scinumtools3-0.9.13-cp310-cp310-manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64 Details for scinumtools3-0.9.13-cp310-cp310-manylinux_2_28_x86_64.whl
scinumtools3-0.9.13-cp310-cp310-macosx_14_0_arm64.whl CPython 3.10 CPython 3.10 macOS 14.0+ ARM64 Details for scinumtools3-0.9.13-cp310-cp310-macosx_14_0_arm64.whl

Total release size: 396.5 MB

Release files / scinumtools3-0.9.13.tar.gz

Download URL scinumtools3-0.9.13.tar.gz
Size 36.8 MB
Tags Source
SHA-256 checksum
How to use checksums
1d4167a12425fd015ac01917958c3b8ae40d03727f26b5ea0ad9b7f5c741e288
BLAKE2b-256 checksum
How to use checksums
03394978c368db89986824c44e28bb0feef0f28aa00ad41ec34977629b9deb0f
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 Oct 30, 2026.

Transparency log

Release files / scinumtools3-0.9.13-cp313-cp313-win_amd64.whl

Download URL scinumtools3-0.9.13-cp313-cp313-win_amd64.whl
Size 51.1 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
4f0997d8ed65c37aace647aa6fbbc368bf0e250559313a000c02af462c004d1c
BLAKE2b-256 checksum
How to use checksums
ac612df2ace30a30adc849188c8a6027b95715ff0e9407c2e80886851f57f66c
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 Oct 30, 2026.

Transparency log

Release files / scinumtools3-0.9.13-cp313-cp313-manylinux_2_28_x86_64.whl

Download URL scinumtools3-0.9.13-cp313-cp313-manylinux_2_28_x86_64.whl
Size 20.7 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
beedc48637299ab49e89ba5145390e6b9ba50840419833fb5b239792d1835442
BLAKE2b-256 checksum
How to use checksums
204f2369f28d887c3b22dfa2a360e59c2fed1168a6dc8c8051fd4acc15bcefda
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 Oct 30, 2026.

Transparency log

Release files / scinumtools3-0.9.13-cp313-cp313-macosx_14_0_arm64.whl

Download URL scinumtools3-0.9.13-cp313-cp313-macosx_14_0_arm64.whl
Size 18.1 MB
Tags CPython 3.13 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
9281a4b4d556602c289db53e92623b62e363bd19a610a662b8262a6377f6f741
BLAKE2b-256 checksum
How to use checksums
3839a0714c596e6f9928476b377f980e4d17a6ac2129021aa8532484dc35c719
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 Oct 30, 2026.

Transparency log

Release files / scinumtools3-0.9.13-cp312-cp312-win_amd64.whl

Download URL scinumtools3-0.9.13-cp312-cp312-win_amd64.whl
Size 51.1 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
5ea8635a98bde85fecfae38989d4e5f914316ab2b7879dbc64e26b24cc47fd17
BLAKE2b-256 checksum
How to use checksums
8aacc9ae8a88d72ad84000f14da72eced51eff33dfb972cd75b5784b34b43989
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 Oct 30, 2026.

Transparency log

Release files / scinumtools3-0.9.13-cp312-cp312-manylinux_2_28_x86_64.whl

Download URL scinumtools3-0.9.13-cp312-cp312-manylinux_2_28_x86_64.whl
Size 20.7 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
d5df0f8da35593a815a833e8d9524970fb6f3281fca5d2241059797a56ab9a09
BLAKE2b-256 checksum
How to use checksums
accdece38602d6ba5e1fd48bc9994d49fa59f604a765bce5a14f5820c77bd19c
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 Oct 30, 2026.

Transparency log

Release files / scinumtools3-0.9.13-cp312-cp312-macosx_14_0_arm64.whl

Download URL scinumtools3-0.9.13-cp312-cp312-macosx_14_0_arm64.whl
Size 18.1 MB
Tags CPython 3.12 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
ff3c187b5d8d8a2b43c646b784b4e2fda312017dd4f2f8d69d4adbfec27ddee0
BLAKE2b-256 checksum
How to use checksums
3e4dc21e6b7672e68e3b4e8d0e1c40446ac92023cb4a80fd1d8e38729f241cb0
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 Oct 30, 2026.

Transparency log

Release files / scinumtools3-0.9.13-cp311-cp311-win_amd64.whl

Download URL scinumtools3-0.9.13-cp311-cp311-win_amd64.whl
Size 51.1 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
9a686e3bc4d6deb728bdf8912ba30879451c1291519786667a5edff74e9c13f8
BLAKE2b-256 checksum
How to use checksums
7066e906c74cd6f31015daf65d0db02dc700bdbd37e46065e630a15d63837924
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 Oct 30, 2026.

Transparency log

Release files / scinumtools3-0.9.13-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL scinumtools3-0.9.13-cp311-cp311-manylinux_2_28_x86_64.whl
Size 20.7 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
f2e868e95871faa0c544ebc08b4cbe47664b5c1f48598595bf916930ef69ef42
BLAKE2b-256 checksum
How to use checksums
5f636eaca04d040e41983676363c72dec1dd21f52904d2e7ced5e130cc1a6f40
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 Oct 30, 2026.

Transparency log

Release files / scinumtools3-0.9.13-cp311-cp311-macosx_14_0_arm64.whl

Download URL scinumtools3-0.9.13-cp311-cp311-macosx_14_0_arm64.whl
Size 18.1 MB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
00ac5c93c5f99819ed9f3f25ef3900388b2d51443561cc9d8dc1084da75a63ef
BLAKE2b-256 checksum
How to use checksums
92d576cdb01cbca8f514cb590ddc2ca6e6625f8c2cf7684e0b2a0b3066715c90
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 Oct 30, 2026.

Transparency log

Release files / scinumtools3-0.9.13-cp310-cp310-win_amd64.whl

Download URL scinumtools3-0.9.13-cp310-cp310-win_amd64.whl
Size 51.1 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
ed9f487073b55313f924ec4a492f8f5037a9538f01e422f69ce4cf5ec641c28b
BLAKE2b-256 checksum
How to use checksums
b16fd87e4de6004ef51005d7e32f3fbb53f4b8a412d934599d0258b7bc1bcc4b
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 Oct 30, 2026.

Transparency log

Release files / scinumtools3-0.9.13-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL scinumtools3-0.9.13-cp310-cp310-manylinux_2_28_x86_64.whl
Size 20.7 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
fad633333aecf44a5d025f0e1d5347cd53a83e1c72b88595f3219ae320e70a3c
BLAKE2b-256 checksum
How to use checksums
b653d9b0524b42eb8c79f9e26c0f04cfc7cf64c5c583bac45f31b9278d6f816f
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 Oct 30, 2026.

Transparency log

Release files / scinumtools3-0.9.13-cp310-cp310-macosx_14_0_arm64.whl

Download URL scinumtools3-0.9.13-cp310-cp310-macosx_14_0_arm64.whl
Size 18.1 MB
Tags CPython 3.10 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
0c452297b7955764bb0b24a9e91177c1eabf0a87817d71f386a680d7ec829e8d
BLAKE2b-256 checksum
How to use checksums
6d2ff1704b04a6e2cf17d06fd174749fadf0602d24e6e78e05b8f62f4a496403
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 Oct 30, 2026.

Transparency log

Security for scinumtools3 0.9.13

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 13 files in this release have been uploaded with provenance metadata.

Select from 13 files

Attestation for scinumtools3-0.9.13.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 30, 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