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

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

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-1.3.1.tar.gz (3.5 MB view details)

Uploaded Source

Built Distribution

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

metaphysica-1.3.1-py3-none-any.whl (3.8 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: metaphysica-1.3.1.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-1.3.1.tar.gz
Algorithm Hash digest
SHA256 bc51806a2d738e02b6cc6e4dd7a4ca00c96966ad2938de4c1cedaab263bba342
MD5 d981912b0e9057182ab9ccb26f2d70c1
BLAKE2b-256 70e961775d89f1b9eb2c5dbc94121ac65ad01f0354979263a4259c7df866b420

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaphysica-1.3.1.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-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: metaphysica-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for metaphysica-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 16cfce806be6c60ca2ef02ebe3d4d9fb7ea0f6d044a17b8ab2e9fe75aa845018
MD5 7a7d9ddf618f10dd9bc5c58a0989f1f8
BLAKE2b-256 5ef732877eb6f28f950d35f51853f6892065dfee6b806f1c728ddae19fcac708

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaphysica-1.3.1-py3-none-any.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