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.0a0.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.0a0-cp313-cp313-win_amd64.whl (4.0 MB view details)

Uploaded CPython 3.13Windows x86-64

metaphysica-2.0.0a0-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.0a0-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.0a0-cp313-cp313-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

metaphysica-2.0.0a0-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.0a0-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.0a0-cp312-cp312-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

metaphysica-2.0.0a0-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.0a0-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.0a0-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.0a0.tar.gz.

File metadata

  • Download URL: metaphysica-2.0.0a0.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.0a0.tar.gz
Algorithm Hash digest
SHA256 f13cfb0475358048bcc6eebb6f5d4e4631ab892e7593c1e051d7fa5ea1552eaf
MD5 3460d5a5123ed7404cdb11361b966374
BLAKE2b-256 29b1ee25943547c7060d10704a3b5f364fd1ca21c6b5d4189d64c1372e4291ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaphysica-2.0.0a0.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.0a0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for metaphysica-2.0.0a0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 2d0d006eb6d3eead8783936c11f0bac7303933e44d12df73b6ab26fd74007ddd
MD5 1a78db745357af89640518d7ffb85ff6
BLAKE2b-256 ffb9e5b919b5f8211f4582bff5c86cc33f416c0195b73b389c0404544ded55ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaphysica-2.0.0a0-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.0a0-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for metaphysica-2.0.0a0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 f77f73bb3caf39ead2688bd1ae6430fb654232d61ffc06c808df4841ace3b671
MD5 fd666462df5303ec7de633fa07c4aef5
BLAKE2b-256 4251d2a4448e7170d0da2559eec9d828fc2331a46bd3fb2f03de649476794756

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaphysica-2.0.0a0-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.0a0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for metaphysica-2.0.0a0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8f504fe3d4b80f8df806609a2d3330f5fe76b366bf8cb013bdab3d319bfb6ffe
MD5 ce6227bba43f5e68b9f805295731b883
BLAKE2b-256 28c14dca1c1d32a2f770f0a4b771cc53b255bb13759742eea29f82af5f242b26

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaphysica-2.0.0a0-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.0a0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for metaphysica-2.0.0a0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4fd5aa1b45d72c66eb3e2cd0a1c5ce97d252d8a79491fbb1e3935f76e87eed6c
MD5 651aa3fd9be9dea9b9ea1845b19c987d
BLAKE2b-256 bb5f48c69dcde32b6ec98d33ed5715e655b3b17a8833a3679d2af9315daace56

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaphysica-2.0.0a0-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.0a0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for metaphysica-2.0.0a0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 cb4de5c22eeaa8edd66afaf361334ec815b01558889b4ceceef4c27dc5d50332
MD5 c0ad76892497925fa75732f691c8d7e4
BLAKE2b-256 1ddfe75ebea38c54e76faad6096d4f101130cf07ec23952e6527dd17263312e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaphysica-2.0.0a0-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.0a0-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for metaphysica-2.0.0a0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 b09c948384f4817cb9a8cdc36626d179815566b4032e44c87393ce6973708aa5
MD5 6b0cf89ba5aa3961c30dd7f2621e6cd4
BLAKE2b-256 388716eb6d64bbf20b4d4b842b9ff44219a08d7f0003707ef2db065296bb7003

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaphysica-2.0.0a0-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.0a0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for metaphysica-2.0.0a0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 19ca43b4b8bc4280d0347b1b913f96e0a14815574fcdcd8a8e4b8a251d070a64
MD5 796abec75436da4fc515bd91589a1d6c
BLAKE2b-256 851fbc76b56536ddf8e37c5bae0d24136e88c753effeeb9bfc406bad762f5ca1

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaphysica-2.0.0a0-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.0a0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for metaphysica-2.0.0a0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cbadea7f744e670b8d7f11a0bf8e2647851b6442b4d356b781238c08661d720e
MD5 522f8abe12494fe7dc17ce8d461404bd
BLAKE2b-256 6422465a9c5d10be8a9d3f19ddb5436d9d711e91592fff24f23cf17246fd38b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaphysica-2.0.0a0-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.0a0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for metaphysica-2.0.0a0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d071ef8b0138918612805a36fa5c8c9e89d804b5fdb40940d8e3618caa122e2a
MD5 eaa5fd161e7657b92807a8563ec7e45d
BLAKE2b-256 b2ba7ee12dd39ed69c715447555e6fc7d1a0ccc9e74d7fe9e7f9ae5fc905f944

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaphysica-2.0.0a0-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.0a0-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for metaphysica-2.0.0a0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 785efdc657cfc32250b0e32f421261c7a09bd8901dc7343917f6fc62399acae9
MD5 551f7f56c9b9d27681c003a1850d55fe
BLAKE2b-256 44c7ea3506801c2e97472cc2333cd6c70508a04618c6869afc6a2df4f29b0a8d

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaphysica-2.0.0a0-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.0a0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for metaphysica-2.0.0a0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1d0521edc5b32f4a417b2153fa1982d8f004b287c0c5dabadd93d9442ed09062
MD5 2bcf5b3190a812e0675723009d5a00d8
BLAKE2b-256 09125e51875ca2328b0c2ecab6c7ec741042932bb8c04097c2b8a06c573fb20a

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaphysica-2.0.0a0-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.0a0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for metaphysica-2.0.0a0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 18e1fee1240f21c4f130cb3b641b2cf0dbe2ac88f82d778cbc79673da91f113b
MD5 bab2315aa6df116327229e2f77f055b0
BLAKE2b-256 960b88434d9f98fd84c3f10ae59fd7e2c7ff83750e8fa5de063c748acbf7c389

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaphysica-2.0.0a0-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