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.10

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.10
File Size Uploaded Provenance Actions
scinumtools3-0.9.10.tar.gz 32.5 MB With provenance Details for scinumtools3-0.9.10.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for scinumtools3 0.9.10
File Actions
scinumtools3-0.9.10-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for scinumtools3-0.9.10-cp313-cp313-win_amd64.whl
scinumtools3-0.9.10-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.10-cp313-cp313-manylinux_2_28_x86_64.whl
scinumtools3-0.9.10-cp313-cp313-macosx_14_0_arm64.whl CPython 3.13 CPython 3.13 macOS 14.0+ ARM64 Details for scinumtools3-0.9.10-cp313-cp313-macosx_14_0_arm64.whl
scinumtools3-0.9.10-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for scinumtools3-0.9.10-cp312-cp312-win_amd64.whl
scinumtools3-0.9.10-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.10-cp312-cp312-manylinux_2_28_x86_64.whl
scinumtools3-0.9.10-cp312-cp312-macosx_14_0_arm64.whl CPython 3.12 CPython 3.12 macOS 14.0+ ARM64 Details for scinumtools3-0.9.10-cp312-cp312-macosx_14_0_arm64.whl
scinumtools3-0.9.10-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for scinumtools3-0.9.10-cp311-cp311-win_amd64.whl
scinumtools3-0.9.10-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.10-cp311-cp311-manylinux_2_28_x86_64.whl
scinumtools3-0.9.10-cp311-cp311-macosx_14_0_arm64.whl CPython 3.11 CPython 3.11 macOS 14.0+ ARM64 Details for scinumtools3-0.9.10-cp311-cp311-macosx_14_0_arm64.whl
scinumtools3-0.9.10-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for scinumtools3-0.9.10-cp310-cp310-win_amd64.whl
scinumtools3-0.9.10-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.10-cp310-cp310-manylinux_2_28_x86_64.whl
scinumtools3-0.9.10-cp310-cp310-macosx_14_0_arm64.whl CPython 3.10 CPython 3.10 macOS 14.0+ ARM64 Details for scinumtools3-0.9.10-cp310-cp310-macosx_14_0_arm64.whl

Total release size: 374.3 MB

Release files / scinumtools3-0.9.10.tar.gz

Download URL scinumtools3-0.9.10.tar.gz
Size 32.5 MB
Tags Source
SHA-256 checksum
How to use checksums
787cabbc1aaa469037d27e6764e2f32d4ccb1e9bc17f067b39ae799c3da22918
BLAKE2b-256 checksum
How to use checksums
e742f8273d9752b40aa69cb3774dd2ec28698c8a7bc7f8b8f337d276fce5bd6e
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 25, 2026.

Transparency log

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

Download URL scinumtools3-0.9.10-cp313-cp313-win_amd64.whl
Size 48.3 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
df45cf0f115f958d8cb8917d978de2717b47baf20a6b54edfb1e523abba49c5b
BLAKE2b-256 checksum
How to use checksums
e50ca3f5a1afc8d99d3fbb76a81c7916a7712f23cf615e909e0577f999b6a41f
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 25, 2026.

Transparency log

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

Download URL scinumtools3-0.9.10-cp313-cp313-manylinux_2_28_x86_64.whl
Size 19.8 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
1dd0fdd15c480d6116bafbdf45c0b58f5f1964f7384fdab0964b889ee027da2d
BLAKE2b-256 checksum
How to use checksums
11074958ba7bc185f51689d5bad073dc30ad5f02ce1ce42d2efd05573e731543
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 25, 2026.

Transparency log

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

Download URL scinumtools3-0.9.10-cp313-cp313-macosx_14_0_arm64.whl
Size 17.3 MB
Tags CPython 3.13 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
1eece8a6ae1e11dd2881e145f06c70b865ea51a2b926ab127bc1e7d9c1748912
BLAKE2b-256 checksum
How to use checksums
0cae79d19aa219e8a15ee0917d9ddacf07668655c6a41a9ee6f6914c48ac7d65
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 25, 2026.

Transparency log

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

Download URL scinumtools3-0.9.10-cp312-cp312-win_amd64.whl
Size 48.3 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
992739760715a4da35cc892896fc9f5d93cb79127614f8f663737996b046f638
BLAKE2b-256 checksum
How to use checksums
ce7fdb1a8f41d6102b122d86045012415935675c0be54a70ad1e0edeeef6b1dd
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 25, 2026.

Transparency log

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

Download URL scinumtools3-0.9.10-cp312-cp312-manylinux_2_28_x86_64.whl
Size 19.8 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
84dd6c5f919106e21db0d29da5aca5102a55a8f0a316af51da2876ea66d9531c
BLAKE2b-256 checksum
How to use checksums
c09a6ee83ef61aef7d106f7b5e74d09c40d58482cc4204ea9d369872817704ad
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 25, 2026.

Transparency log

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

Download URL scinumtools3-0.9.10-cp312-cp312-macosx_14_0_arm64.whl
Size 17.3 MB
Tags CPython 3.12 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
3e3184e1076f91d01c71c427bee26af43044eb13289faaa4e102361fbb3dc28f
BLAKE2b-256 checksum
How to use checksums
3c3d6359a83c30bcde71a612b51cbf9af9ebf1e29acc1d1b1eefe421358fbb57
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 25, 2026.

Transparency log

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

Download URL scinumtools3-0.9.10-cp311-cp311-win_amd64.whl
Size 48.3 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
b6dbe0c24e0e336c32f17d2494f4c23290808d7ce189d406c903a26c369df264
BLAKE2b-256 checksum
How to use checksums
3efcc747e61cf36b86ca05ddb9f4fe6633b9a655da75a7bb60b69994b1f131dc
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 25, 2026.

Transparency log

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

Download URL scinumtools3-0.9.10-cp311-cp311-manylinux_2_28_x86_64.whl
Size 19.8 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
49943f2c94c91a6c4a5b99a5ea91fa9b06323efae91fefb3c2f5b1bebee92520
BLAKE2b-256 checksum
How to use checksums
c6673d0f87da5bbf024c70d03076c1b8c87978dc8acb314c7b19e0442c11102f
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 25, 2026.

Transparency log

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

Download URL scinumtools3-0.9.10-cp311-cp311-macosx_14_0_arm64.whl
Size 17.3 MB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
733cda39123239330b64ddd2ec5dd007dc38ca00f912196ad3ec70db0ff97959
BLAKE2b-256 checksum
How to use checksums
07c701984bb137255e63eb6783d7e51c3fe1b654ddd4f5702ba2a6e77ee33e0b
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 25, 2026.

Transparency log

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

Download URL scinumtools3-0.9.10-cp310-cp310-win_amd64.whl
Size 48.3 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
08a1fb84f5a7c51ff498d345cb349e7f6f990cfe54e82bb7d52aeb0d4022254c
BLAKE2b-256 checksum
How to use checksums
a254bfdbaa8bd61581989272eaeff05fde050ff7c390bd866e5c519d17e0500a
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 25, 2026.

Transparency log

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

Download URL scinumtools3-0.9.10-cp310-cp310-manylinux_2_28_x86_64.whl
Size 19.8 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
f0fdbaaebbc46d907bd1861f06d5619e5f8c1f1cd06f56086e16ae2ae61e57f6
BLAKE2b-256 checksum
How to use checksums
8459e2691f7c6993a7a8a8d043fc40720db1e145ab2ae2bb3cf33c0aee8068bc
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 25, 2026.

Transparency log

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

Download URL scinumtools3-0.9.10-cp310-cp310-macosx_14_0_arm64.whl
Size 17.3 MB
Tags CPython 3.10 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
cea5c666aa4d346547b2bd10837a8abf8a876d0aed73eec283b42699ce54ffe9
BLAKE2b-256 checksum
How to use checksums
bdfb778bda4b350826214e20e568a75aa3b2cec3455434df6f1e12b073715a72
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 25, 2026.

Transparency log

Security for scinumtools3 0.9.10

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.10.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 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