Skip to main content

Celestial Rhapsody

A multi-body gravitational simulation, configured entirely through an input file. You give it initial masses, positions and velocities, and it gives you an animation of the orbits.

Three-body orbit

Install

pip install git+https://github.com/jam-sadiq/celestial-rhapsody.git

or, from a copy of this folder: pip install .

Quick start

nbody run examples/three_body.json        # -> examples/three_body.gif

A minimal input file:

{
  "G": 1.0,
  "dt": 0.01,
  "final_time": 10,
  "bodies": [
    {"name": "Star",   "mass": 1.0,   "position": [0, 0], "velocity": [0, 0]},
    {"name": "Planet", "mass": 0.001, "position": [1, 0], "velocity": [0, 1]}
  ]
}

The original .txt format ([Global] / [Planet] sections) also works. See examples/three_body.txt.

From Python:

from celestial_rhapsody import load_system, simulate, animate

trajectory = simulate(load_system("examples/three_body.json"), method="rk4")
animate(trajectory, "three_body.gif")

Documentation

Installation guide, tutorial, input format and API reference: https://jam-sadiq.github.io/celestial-rhapsody

To build it locally:

pip install -e ".[docs]"
cd docs && make html      # open docs/build/html/index.html

Development

pip install -e ".[test]"
pytest

Authors

Jam Sadiq, in collaboration with Valeria Monserrat Aceituno Salinas, and Aditya Swardiana

License

BSD 3-Clause. See LICENSE.txt.

Metadata

Release files for celestial-rhapsody 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for celestial-rhapsody 0.1.1
File Size Uploaded Provenance Actions
celestial_rhapsody-0.1.1.tar.gz 13.6 kB With provenance Details for celestial_rhapsody-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for celestial-rhapsody 0.1.1
File Interpreter ABI Platform Actions
celestial_rhapsody-0.1.1-py3-none-any.whl Python 3 none any Details for celestial_rhapsody-0.1.1-py3-none-any.whl

Total release size: 26.2 kB

Release files / celestial_rhapsody-0.1.1.tar.gz

Download URL celestial_rhapsody-0.1.1.tar.gz
Size 13.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4b5342e2f122bbadd88b55d8bca187a30b300abe1f7789d087b6947d14983f2a
BLAKE2b-256 checksum
How to use checksums
1fdde2ebb4253179bc92dac95b610e0a7343ddd839592ee20707e6bdf3837d88
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 Dec 2, 2026.

Transparency log

Release files / celestial_rhapsody-0.1.1-py3-none-any.whl

Download URL celestial_rhapsody-0.1.1-py3-none-any.whl
Size 12.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
212e200ee9fc3b7589c751aee63e31d3a594ff2fe8dd1725e3da8ea4ba2dfaf6
BLAKE2b-256 checksum
How to use checksums
ad278dfc9b2d6d27d810876cb248a1bcf46c819f6301cfc2c791a30c7c46fe83
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 Dec 2, 2026.

Transparency log

Security for celestial-rhapsody 0.1.1

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for celestial_rhapsody-0.1.1.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 Dec 2, 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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

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