Skip to main content

SpacetimeLib

SpacetimeLib is a special relativity physics library for Python.

SpacetimeLib performs mathematical operations on events, velocities, and worldlines in N+1 Minkowski spacetime.

You can calculate Lorentz transformations, time dilation, length contraction, and more.

Documentation and getting started

The documentation for the latest main branch is found here: https://kurtamohler.github.io/spacetimelib/

The Start Here - Twin Paradox tutorial page is a good starting point to see what SpacetimeLib can do.

Installation

Pip

pip install spacetimelib

From source

Install Miniconda: instructions

Clone SpacetimeLib the repository.

git clone https://github.com/kurtamohler/spacetimelib.git && cd spacetimelib

Run the following to create and activate an environment with all dependencies.

conda env create -f environment.yaml -n spacetimelib && conda activate spacetimelib

Then install SpacetimeLib.

pip install -e .

Build documentation:

python -m sphinx doc/source/ doc/_build

How to import SpacetimeLib

To access SpacetimeLib, import it into your Python code:

>>> import spacetimelib as st

Shorten the imported name to st for better code readability, but you can just use the unshortened name if you want.

Metadata

Release files for spacetimelib 0.0.3

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

Source distribution (sdist)

Source distribution for spacetimelib 0.0.3
File Size Uploaded
spacetimelib-0.0.3.tar.gz 24.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spacetimelib 0.0.3
File Interpreter ABI Platform
spacetimelib-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 42.8 kB

Release files / spacetimelib-0.0.3.tar.gz

Download URL spacetimelib-0.0.3.tar.gz
Size 24.1 kB
Tags Source
SHA-256 checksum
How to use checksums
806b4000a8e4132d1e1065af0f2b8f58ab523cd5dbcd47bc027a51509ea557c5
BLAKE2b-256 checksum
How to use checksums
3aecf22d9a8701e17aaacf81026deacdb3ce4487b55166dc404d766868f7716b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / spacetimelib-0.0.3-py3-none-any.whl

Download URL spacetimelib-0.0.3-py3-none-any.whl
Size 18.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
826a909da0b622329c33d74de84117d50cfbd19e3217766183a281b8f03967ab
BLAKE2b-256 checksum
How to use checksums
940b6b7b9a9f2e17823ed29f15138ac791933396b8594268956574f786b33722
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

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