Registry / ligotimegps

ligotimegps

JSON →
library2.1.0pypypi✓ verified 84d ago

A pure Python implementation of LIGOTimeGPS, used for converting between LIGO time (GPS seconds) and standard time formats. Current version is 2.1.0, requiring Python >=3.11. Released irregularly with minor version bumps.

pip install ligotimegps
INSTALL
IMPORT
SIG · LIGOTIMEGPS
L
ligotimegps
pythonv2.1.0
Install
1.6s avg
Import
14ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.0.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.014s · 17.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.014s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

LIGOTimeGPS
from ligotimegps import LIGOTimeGPS
from ligotimegps.ligotimegps import LIGOTimeGPS
Many users mistakenly import from the internal submodule path; the top-level import is the correct public API.

Create a LIGOTimeGPS object from GPS seconds and nanoseconds, then print its string representation, float value, and components.

from ligotimegps import LIGOTimeGPS t = LIGOTimeGPS(1234567890, 0) print(t) print(float(t)) print(t.gpsSeconds, t.gpsNanoSeconds)
Debug
Known issues
gotchaThe constructor accepts two integers (seconds, nanoseconds), but nanoseconds can be negative. This can cause confusion when converting from other time representations.
fix
Ensure nanoseconds are normalized (0 <= ns < 1e9) before passing to the constructor, or use the from_float method.
affects: all
deprecatedArithmetic operations like +, -, <, > are supported, but there is no official documentation for edge cases (e.g., overflow). Relying on undocumented behavior may break in future versions.
fix
Use explicit conversion to float for comparisons and arithmetic.
affects: all
breakingThe ability to compare LIGOTimeGPS with integers/floats directly may be removed. In version 2.x, this works implicitly, but future versions might require explicit conversion.
fix
Always convert to float for comparisons: float(t) > 1e9.
affects: 2.x
Errors
Common errors & fixes
AttributeError: module 'ligotimegps' has no attribute 'LIGOTimeGPS'
Multiple installs or importing from wrong path after an incomplete import.
fix
Run 'pip show ligotimegps' to verify installation. Import using 'from ligotimegps import LIGOTimeGPS'.
TypeError: 'LIGOTimeGPS' object cannot be interpreted as an integer
Trying to use LIGOTimeGPS directly in functions expecting an integer, like range() or indexing.
fix
Convert to int or float: int(t.gpsSeconds) or float(t).
ValueError: invalid format for LIGOTimeGPS: '1234567890.0'
Passing a float string to LIGOTimeGPS. The constructor does not parse strings.
fix
Use LIGOTimeGPS.from_float(1234567890.0) or parse the string yourself.
Upgrade
Version history
2.1.0latest on PyPI · released Oct 7, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
ligotimegps — pip install ligotimegps · libregistry