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.0.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.0-py3-none-any.whl (3.8 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: metaphysica-1.3.0.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.0.tar.gz
Algorithm Hash digest
SHA256 d67bed1d33da1794669b27461dd30b80fb265e043c3848c237ef4ea0dd457fef
MD5 2d59650d048ff8d3529445e6911a3369
BLAKE2b-256 4451b39b324dc0e17cf356299f21dccf195d2cc7fae375fe8349e44e321fbb35

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: metaphysica-1.3.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f92d75bcb2e20b3bfe0f70be537ca378433c40c79665618a4728ed873b019968
MD5 3648be881e0d87eee02ccac0b2572b85
BLAKE2b-256 58d63f5255fb703d4e25ae8acdd6889c0860ca4791ec58770f8154b16305a830

See more details on using hashes here.

Provenance

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