Skip to main content

G2-manifold-derived theoretical physics framework: 125 derived constants, quark + constant datasheet API, bundled static-website generator.

Project description

metaphysica

PyPI Python License: Apache-2.0

G2-manifold-derived theoretical physics framework: 125+ derived constants, a uniform Get() JSON-datasheet API for quarks + physics constants, and a bundled static-website generator.

Installation

pip install metaphysica            # slim core: numpy / scipy / sympy / mpmath / eml-math
                                   #   → enough for the Get() datasheet API
pip install metaphysica[sims]      # + eml-spectral (advanced algebras for the sim engine)
pip install metaphysica[plots]     # + matplotlib + pandas (plot regeneration)
pip install metaphysica[pdf]       # + xhtml2pdf (PDF paper export)
pip install metaphysica[full]      # everything above (recommended for `metaphysica-build`)
pip install metaphysica[dev]       # + pytest, black, mypy, build, twine
pip install metaphysica[rust]      # + optional Rust acceleration (see below)

metaphysica ships with py.typed, so type checkers see it as fully typed.

Optional Rust acceleration

metaphysica ships an optional Rust core (rust/physica_core/) that mirrors the Python public API behind a _HAS_RUST guard. The pure-Python install path is always the default; the Rust extension is strictly opt-in:

# Build via maturin (recommended for ad-hoc development):
pip install maturin
maturin develop --features python

# Or via pip extras (uses the [tool.maturin] section in pyproject.toml):
pip install metaphysica[rust]

When the extension is built, metaphysica._physica_core becomes importable and metaphysica._HAS_RUST flips to True; if it is missing (slim install, unsupported platform, or build skipped) every call transparently falls back to the pure-Python implementation. The slim pip install metaphysica path is unchanged and never invokes Rust.

Get() — datasheet API

metaphysica.Get(name) returns a JSON-shaped datasheet for any quark or named physics constant. It's the entry point that downstream layers (periodica, future apps) consume.

import metaphysica

metaphysica.Get('Up')['Mass_MeVc2']                       # 2.16
metaphysica.Get('Top')['pm_prediction']['phi_scaling_N']  # 0
metaphysica.Get('m_planck')['value']                      # 2.435e18
metaphysica.Get('alpha_em')['value']                      # 0.00729735...

metaphysica.list_quarks()                                 # 12 names (6 SM + 6 anti)
metaphysica.list_constants()                              # ~35 curated constants

Quark name aliases (case-insensitive): "Up", "up", "u", "Up Quark", "AntiUp", "anti-up", …

The quark schema is a strict superset of periodica's data/active/quarks/*.json — every periodica field plus a pm_prediction block (Yukawa φ-scaling N, predicted mass, EML expression, CKM couplings) and a _provenance block.

For shell use: metaphysica.Get('Up', as_json=True) returns a JSON string instead of a dict.

Bundled snapshots

Every entry returned by Get() is a pre-generated JSON shipped inside the wheel (metaphysica/data/quarks/, metaphysica/data/constants/, metaphysica/data/parameters.json), so calls do not re-run the simulation. To regenerate the snapshots after touching the underlying theory:

python -m metaphysica.generators.generate_datasheets
# or, equivalently:
metaphysica-datasheets

This step is also wired into metaphysica.build so a full website build refreshes them automatically.

Build pipeline

from metaphysica import build
build(out_dir='./site')   # full build: sims + JSON + JS + HTML + datasheets + plots + PDF

Or from the shell:

metaphysica-build                   # rebuild into the current directory
metaphysica-build --out ./site      # rebuild into ./site
metaphysica-build --fast            # skip plot regeneration
metaphysica-build --skip-sims       # only refresh downstream generators
metaphysica-build --only "EML"      # run a single step

Steps whose optional extras are missing are skipped with a friendly install hint, so a slim install never produces a broken build.

Compatibility

  • Python 3.9 – 3.13
  • OS: Linux, macOS, Windows (pure Python wheel, no native deps in the slim install)

Testing

pip install metaphysica[full,dev]
pytest                              # 655 tests, ~20s

Stack

The EML stack is layered. Each layer's Get(name) returns a JSON datasheet derived from that layer's theory:

Layer Package Get() returns
Maths eml-math math constants (e, π, φ, …)
Physics metaphysica (this package) quarks + physics constants
Materials periodica (future) element / compound datasheets

Related repositories

  • PrincipiaMetaphysica — thin static-site host. Calls metaphysica.build() to render and serve the rendered theory site at metaphysicæ.com.
  • metaphysica-app — interactive PC + mobile (APK) GUI on top of metaphysica. Browse the framework, explore constants, run derivations interactively.

Changelog

See CHANGELOG.md for the v1.0.0 release notes.

License

Apache-2.0 — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

metaphysica-2.0.2.tar.gz (3.5 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

metaphysica-2.0.2-cp313-cp313-win_amd64.whl (4.0 MB view details)

Uploaded CPython 3.13Windows x86-64

metaphysica-2.0.2-cp313-cp313-musllinux_1_2_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

metaphysica-2.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

metaphysica-2.0.2-cp313-cp313-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

metaphysica-2.0.2-cp312-cp312-win_amd64.whl (4.0 MB view details)

Uploaded CPython 3.12Windows x86-64

metaphysica-2.0.2-cp312-cp312-musllinux_1_2_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

metaphysica-2.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

metaphysica-2.0.2-cp312-cp312-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

metaphysica-2.0.2-cp311-cp311-win_amd64.whl (4.0 MB view details)

Uploaded CPython 3.11Windows x86-64

metaphysica-2.0.2-cp311-cp311-musllinux_1_2_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

metaphysica-2.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

metaphysica-2.0.2-cp311-cp311-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file metaphysica-2.0.2.tar.gz.

File metadata

  • Download URL: metaphysica-2.0.2.tar.gz
  • Upload date:
  • Size: 3.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for metaphysica-2.0.2.tar.gz
Algorithm Hash digest
SHA256 2f19071e1ab8948726954549dbcf95a21afab2062da08dfc5c9dd124017e8b30
MD5 8d50d877d57f3dac47c018a0eeb31422
BLAKE2b-256 8cfa5c71ecad4b1836622b81374c08cf2e9e5b6f378804222ceeb62a0f6745e9

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaphysica-2.0.2.tar.gz:

Publisher: workflow.yml on andrewkwatts-maker/metaphysica

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file metaphysica-2.0.2-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for metaphysica-2.0.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 18d867ae77834dea45daaed6ea7634a404c712b560512ad4d3cae2dd245a4c5b
MD5 adf124070bb51d121db197b9406b1273
BLAKE2b-256 a3607c32f5c239dd4edf36875c0690224ec6fdda1283058d258022bf3d6f3f36

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaphysica-2.0.2-cp313-cp313-win_amd64.whl:

Publisher: workflow.yml on andrewkwatts-maker/metaphysica

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file metaphysica-2.0.2-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for metaphysica-2.0.2-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 d938c87b1d47b4ac517179f4d73078275703e800cab4ef43aa52abfa6a026cde
MD5 2d5eef18481096e32a3ed6f478c55413
BLAKE2b-256 bafc4f4fe96748e9c3d0c30d528593819f9e076cd2ebeb0b37766cc9f4c2e768

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaphysica-2.0.2-cp313-cp313-musllinux_1_2_x86_64.whl:

Publisher: workflow.yml on andrewkwatts-maker/metaphysica

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file metaphysica-2.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for metaphysica-2.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3f27c6f6e8ae2dcc633b3ad7e18480d405ab4849c3825644c6189a05696c0489
MD5 4b1796ee43a0b34177ead23fb36eb366
BLAKE2b-256 67a9bdf5753a4d98590c5cd06bd9829ca9f7b41f8d2dec3e6395d7d1a8948625

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaphysica-2.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: workflow.yml on andrewkwatts-maker/metaphysica

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file metaphysica-2.0.2-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for metaphysica-2.0.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bda26569932a51983ce84633ca4c91e94ef5403e6482e7fe5e78928201dc315f
MD5 2adb833018893458b6b50431ad89c65b
BLAKE2b-256 93b5b0a6233210e90de409344420df93858a2406fba3c5a79d30de7322f30765

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaphysica-2.0.2-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: workflow.yml on andrewkwatts-maker/metaphysica

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file metaphysica-2.0.2-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for metaphysica-2.0.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d16e14818ac681589944aabdfcfa4c11a300434646cf0cb169751733b65e6c81
MD5 fde578e217f1ad28d6d2eaa12d394188
BLAKE2b-256 bc1c2560cdd0673a097f2bad4e6667e4f32895a557bc0c7e435b690e1c3b3dd3

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaphysica-2.0.2-cp312-cp312-win_amd64.whl:

Publisher: workflow.yml on andrewkwatts-maker/metaphysica

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file metaphysica-2.0.2-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for metaphysica-2.0.2-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a1320ba64d910a5ebf1e60fe070e721034a5351983a2c9cbcf10f29289ac31a7
MD5 639454be3889b5da835ea57d0ad402aa
BLAKE2b-256 62779ccf0aa63464fe69b1322a6d8c5747a3e67129e5c9d9b789c63dcb2a422c

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaphysica-2.0.2-cp312-cp312-musllinux_1_2_x86_64.whl:

Publisher: workflow.yml on andrewkwatts-maker/metaphysica

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file metaphysica-2.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for metaphysica-2.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e906b0d8ef3acb6321f9deefbf3f91e21430b2de61693b4a3af0c131afe7268f
MD5 60143585774ff2850b578fedb9b4b240
BLAKE2b-256 9f05d282c3f3988fa95286e074b68440fab4eb45228f52768dce42cb4c161627

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaphysica-2.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: workflow.yml on andrewkwatts-maker/metaphysica

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file metaphysica-2.0.2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for metaphysica-2.0.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2cd61a05617646ed691b7818f9fbe043894a1b9469855198cbdb64b4be6fb091
MD5 ea49cf85d747566c5931bd92a1ea5f4f
BLAKE2b-256 6e81721a8e151510dbea721a0df3f026b2fb5447ccfafd6c5affd6fd741bc438

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaphysica-2.0.2-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: workflow.yml on andrewkwatts-maker/metaphysica

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file metaphysica-2.0.2-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for metaphysica-2.0.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0be270927febeaf3783f1dc8f599ee84ff2dae9769555f7b8d845a495e4f0ea1
MD5 a190fcf35196d9798191ae16bd91406e
BLAKE2b-256 6d34f4038b1cbbba9578d426b88146df5e2cbff854e064c9839b4158f3ca9012

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaphysica-2.0.2-cp311-cp311-win_amd64.whl:

Publisher: workflow.yml on andrewkwatts-maker/metaphysica

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file metaphysica-2.0.2-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for metaphysica-2.0.2-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 13de7d66b0a1714633e3766a0bdb644a3d33026feeb62f0439f3f3d401aaf090
MD5 2d093e038cfb9549790430918020b351
BLAKE2b-256 8c8d33c66869534ae81d14c20c0bfca2679db6bfc930c4e3d48a46c0f99997e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaphysica-2.0.2-cp311-cp311-musllinux_1_2_x86_64.whl:

Publisher: workflow.yml on andrewkwatts-maker/metaphysica

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file metaphysica-2.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for metaphysica-2.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ccf1bfe296928ef10d86a89d2f4314ab6d10519c3b4799b7344db90bfe269e7a
MD5 fb00c3e2767ec26e287688b685444683
BLAKE2b-256 6408fd08c5932cdca745d41de7aafbde1929e8b3e59d0f834f828e32f6ae525f

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaphysica-2.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: workflow.yml on andrewkwatts-maker/metaphysica

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file metaphysica-2.0.2-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for metaphysica-2.0.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b454deffe2abbd47e7bc3f23252f7a20c4248175a3b7635a7a97488d5399a401
MD5 05ab0ee288f20ee0b001110952ddd72e
BLAKE2b-256 6968b3fbc91b834ac882965fa3934f699dfe6af5c708ee2320a783115f4712ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaphysica-2.0.2-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: workflow.yml on andrewkwatts-maker/metaphysica

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page