Skip to main content

tscat — Time Series Catalogues

Test Status Coverage Status

tscat is a Python library for managing catalogues of time intervals (events). It is the catalogue backend for SciQLop and is designed for space physics workflows — storing event lists such as magnetopause crossings, ICMEs, or any user-defined intervals with arbitrary metadata.

Events are persisted in a local SQLite database. No server required.

Installation

pip install tscat

Quick start

from datetime import datetime
from tscat import create_event, create_catalogue, add_events_to_catalogue, save

catalogue = create_catalogue("Bow shock crossings", author="Alice",
                             tags=["MMS", "bow_shock"])

events = [
    create_event(datetime(2023, 1, 1, 10, 0), datetime(2023, 1, 1, 10, 30),
                 author="Alice", tags=["inbound"], Bz_max=12.5),
    create_event(datetime(2023, 1, 3, 14, 0), datetime(2023, 1, 3, 14, 45),
                 author="Alice", tags=["outbound"], Bz_max=8.3),
]

add_events_to_catalogue(catalogue, events)
save()

Any keyword argument beyond the fixed fields (start, stop, author, tags, products, rating) becomes a custom attribute stored alongside the event.

Filtering

Retrieve events matching conditions using a natural Python DSL:

from tscat import get_events
from tscat.filtering import event, In, Field

# Events after a date
get_events(event.start >= datetime(2023, 1, 2))

# Combine predicates with &, |, ~
get_events((event.author == "Alice") & In("inbound", Field("tags")))

# Filter on custom attributes
get_events(event.Bz_max > 10.0)

Dynamic catalogues

A catalogue with a predicate automatically includes all matching events:

from tscat import create_catalogue
from tscat.filtering import event

dynamic = create_catalogue(
    "High Bz events", author="Alice",
    predicate=event.Bz_max > 10.0,
)

Import / export

Share catalogues as JSON or VOTable (AMDA-compatible):

from tscat import export_json, import_json, export_votable_str

json_str = export_json(catalogue)
import_json(json_str)  # into another database

Documentation

Full usage guide: docs/usage.rst

Development

This project uses uv:

uv sync --extra test
uv run pytest
uv run flake8 tscat tests

License

GNU General Public License v3

Metadata

Release files for tscat 0.5.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 tscat 0.5.1
File Size Uploaded Provenance
tscat-0.5.1.tar.gz 58.4 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 89.6 kB

Release files / tscat-0.5.1.tar.gz

Download URL tscat-0.5.1.tar.gz
Size 58.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1f7fb6750c05534f042542c754f5a6d5e92b38b184891e7c37952c593e9e8b5e
BLAKE2b-256 checksum
How to use checksums
bde06629b9cee90954670bc093dc89922f93cb7c3f6b4776d3755c4fadf3e0f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / tscat-0.5.1-py3-none-any.whl

Download URL tscat-0.5.1-py3-none-any.whl
Size 31.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5604b084c3f59a3fefbb20683403b87f03de42b635c95179f5fae31cce012c0e
BLAKE2b-256 checksum
How to use checksums
ae3c60c1b465f3cc4422284b01ce3c49a5a550aea96b896eca4bb9c1652b75c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for tscat 0.5.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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