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 and DIPH5 archives
  • 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

Load it into an environment:

from scinumtools3.dip import DIP

env = DIP.load("parameters.dip")

DIP.load also accepts .dipl files, a DIPfile project manifest, and .diph5 archives. Use a DIP parser when combining inputs or adding definitions, units, schemas, and overrides before evaluation:

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.entries() to traverse direct group children, list elements, or map items in order, and cursor.entry_names() when you need only their names or indices as strings. children(), elements(), and items() remain available for specific container types. 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.10.1

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.10.1
File Size Uploaded Provenance Actions
scinumtools3-0.10.1.tar.gz 37.0 MB With provenance Details for scinumtools3-0.10.1.tar.gz

Built distributions (wheels)

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

Total release size: 412.9 MB

Release files / scinumtools3-0.10.1.tar.gz

Download URL scinumtools3-0.10.1.tar.gz
Size 37.0 MB
Tags Source
SHA-256 checksum
How to use checksums
fd743813945bc819c9f967d82107efebec8a484f91f4c128f2e75a7dc789d0ce
BLAKE2b-256 checksum
How to use checksums
2ea41890b0465ec804b63d4365c1aa4b0d85cc3ee505b3c28e8a7497bf888761
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 6, 2026.

Transparency log

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

Download URL scinumtools3-0.10.1-cp313-cp313-win_amd64.whl
Size 54.1 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
2440c749ad38eb3e24cda3ecb216fd9cb96c13313917cac427ca185f52962ede
BLAKE2b-256 checksum
How to use checksums
083f1afb634dd852e3c0b50bb04a55d20d1190bb0f6a8a359f5f86d03e74c112
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 6, 2026.

Transparency log

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

Download URL scinumtools3-0.10.1-cp313-cp313-manylinux_2_28_x86_64.whl
Size 21.7 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
1179be69590126a9a4f1939ab52092284bd82b9bf63aa1e623a7693ea7924009
BLAKE2b-256 checksum
How to use checksums
6b83958b93a5d88a63641b0308505c30965731499928504d424d7b8846492ba4
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 6, 2026.

Transparency log

Release files / scinumtools3-0.10.1-cp313-cp313-macosx_15_0_arm64.whl

Download URL scinumtools3-0.10.1-cp313-cp313-macosx_15_0_arm64.whl
Size 18.2 MB
Tags CPython 3.13 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
36e603cdb4b4549f1a438b44327cb457105b7412a796f1319cc2ce58af3bee19
BLAKE2b-256 checksum
How to use checksums
6f1a88c0a63f8cb622f1caa1259ec74969a4989676dbd5654841f00683a3f0c7
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 6, 2026.

Transparency log

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

Download URL scinumtools3-0.10.1-cp312-cp312-win_amd64.whl
Size 54.1 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
4908ea8aaab81cd1f103ee1374f659c15375144609c1080547ae38527296b3e2
BLAKE2b-256 checksum
How to use checksums
ced8c914e70f01eb17b3af66514198fe5c8beb160d798c8e64770ab3c35663a7
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 6, 2026.

Transparency log

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

Download URL scinumtools3-0.10.1-cp312-cp312-manylinux_2_28_x86_64.whl
Size 21.7 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
a876bca09a8078f6a4470ea312494b8bd69c860eebc92af6ec33589fade6d1aa
BLAKE2b-256 checksum
How to use checksums
f42fa718344725eee856177a92e0b44b5edd0bcbd2f1c1885b482749e2f89448
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 6, 2026.

Transparency log

Release files / scinumtools3-0.10.1-cp312-cp312-macosx_15_0_arm64.whl

Download URL scinumtools3-0.10.1-cp312-cp312-macosx_15_0_arm64.whl
Size 18.2 MB
Tags CPython 3.12 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
a7ce6283eb9c22ccfea73fd7fba05eed8a60beacf3bc5919ef63b7be0d90667b
BLAKE2b-256 checksum
How to use checksums
ae08adda40f4bc3e486dadbd4eac232da9107e9ee6e5898b6056de4d5f87b620
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 6, 2026.

Transparency log

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

Download URL scinumtools3-0.10.1-cp311-cp311-win_amd64.whl
Size 54.1 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
5000fec1249ebd2b8600fa2c91ca5fd4cbf6e6086529095252617806f8440136
BLAKE2b-256 checksum
How to use checksums
58c18efe5011d600063dba849336a87e2a601ffbb657ea1f941ebf9f0114fe03
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 6, 2026.

Transparency log

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

Download URL scinumtools3-0.10.1-cp311-cp311-manylinux_2_28_x86_64.whl
Size 21.7 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
e5002c3c15c5a05755e6decad2ab295bb22a40e89d96a1afa5ef38adaedb00b9
BLAKE2b-256 checksum
How to use checksums
fbfbadf424f90acbb34721a2898f9df6c85d9ea63ce1e7bbe92c94318322e3bf
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 6, 2026.

Transparency log

Release files / scinumtools3-0.10.1-cp311-cp311-macosx_15_0_arm64.whl

Download URL scinumtools3-0.10.1-cp311-cp311-macosx_15_0_arm64.whl
Size 18.2 MB
Tags CPython 3.11 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
c5b3c4ac8c03e69f3f5cd4abf5d7b0ff21044f0e0412130e7089bd198d4b07df
BLAKE2b-256 checksum
How to use checksums
50ece4ab9053da9f7d631156be5e48a32f10933b931b094c7cd6716bfc109a7b
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 6, 2026.

Transparency log

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

Download URL scinumtools3-0.10.1-cp310-cp310-win_amd64.whl
Size 54.1 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
b381ab508469bcb00650b54ff3c2bfe9a54e4f632278c5ce69981a2036778ef7
BLAKE2b-256 checksum
How to use checksums
6e23e822ac7ddb5b370a5d1bb0eeff81a7120540887b244eda9ff47602215daa
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 6, 2026.

Transparency log

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

Download URL scinumtools3-0.10.1-cp310-cp310-manylinux_2_28_x86_64.whl
Size 21.7 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
58b1bdac9e17d5c61846dadcd24ad5377be96249fa7e82387f18c7adb17b6ae6
BLAKE2b-256 checksum
How to use checksums
b6f1a4ae5b662a64b83a8944ef29ad77fe95ee805f362058a58f85a19a136afc
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 6, 2026.

Transparency log

Release files / scinumtools3-0.10.1-cp310-cp310-macosx_15_0_arm64.whl

Download URL scinumtools3-0.10.1-cp310-cp310-macosx_15_0_arm64.whl
Size 18.2 MB
Tags CPython 3.10 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
dca105e75c1891bf3855b44f9f63bd0122732ea59503653f2f81715281df67a2
BLAKE2b-256 checksum
How to use checksums
5728ad428de43341b51de17eb53e1b2cdbe0167dbb51f8d9fd2f3f9bc5c3badb
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 6, 2026.

Transparency log

Security for scinumtools3 0.10.1

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.10.1.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 6, 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