Skip to main content

PyPI License: MIT Language tests badge Docs

Time-Stream

Time Series Toolkit for Rapid Environmental Analysis and Monitoring: A Python library for handling and analysing timeseries data with a focus on maintaining the integrity of the temporal properties of the data.

Overview

Time-Stream provides robust tools for working with timeseries data, built on top of Polars, with special attention to:

  • Precise temporal handling with Period-based time manipulations
  • Smart temporal aggregation
  • Quality control checks and infilling of missing data
  • A flexible flagging system

Installation

pip install ukceh-time-stream

or with uv:

uv add ukceh-time-stream

The package is imported as time_stream:

import time_stream as ts

See the documentation for a quick start, user guides and the full API reference.

License

This project is licensed under the MIT license.

Contributing

Contributions are welcome. Please feel free to submit a Pull Request.

  1. Clone the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Please make sure your code passes all tests and follows the coding style before submitting a PR. See developer setup below, and CONTRIBUTING.md, for more information.

Developer Setup

This is for active development on the time-stream package itself.

Requirements

Install uv

Official instructions

Clone the repository

git clone https://github.com/NERC-CEH/time-stream.git
cd time-stream

Setting up and activating a virtual environment

uv sync
source .venv/bin/activate

Checking your changes

To format, lint, type check and test in one go (run this before submitting a PR):

make qa

Run make help to list all the available commands. The individual checks are below.

Linting

Linting uses ruff with the config in pyproject.toml.

uv run ruff check --fix

Formatting

Formatting uses ruff with the config in pyproject.toml, which follows the default black settings.

uv run ruff format .

Type checking

Type checking uses pyright, which must report no errors.

make type-check

Testing

Testing uses pytest. The tests are in the tests/ directory, and the examples in the docstrings under src/ are run as tests too.

make test

To run the tests on every supported Python version, use make testall.

Pre commit hooks

Run below to set up the pre-commit hooks.

make install-hooks

This will set this repo up to use the git hooks in the .githooks/ directory. The hook runs ruff format --check and ruff check to prevent commits that are not formatted correctly or have errors. The hook intentionally does not alter the files, but informs the user which command to run.

Using an unreleased version in another project

To use time-stream from a branch, or from a local clone you are editing, rather than a release on PyPI:

uv add git+https://github.com/NERC-CEH/time-stream.git@develop
uv add --editable /path/to/time-stream

With --editable, changes to the clone are immediately available to the project using it.

Releasing

Merging to main with a new version in pyproject.toml tags the release, creates a GitHub release from CHANGELOG/<version>.md, and publishes the package to PyPI.

Documentation

For full documentation, visit https://nerc-ceh.github.io/time-stream/

To build the documentation locally (the documentation dependencies are installed by uv sync by default):

make docs-build

The built documentation is in docs/_build/html/index.html. Alternatively, make docs-serve serves the documentation at http://localhost:8000 and rebuilds it as you edit.

Citation

If you use this software, please cite it using the metadata in CITATION.cff.

Built with Cookiecutter and the NERC-CEH/fdri-cookiecutter-pypackage template.

Metadata

Release files for ukceh-time-stream 4.0.0

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

Source distribution (sdist)

Source distribution for ukceh-time-stream 4.0.0
File Size Uploaded Provenance Actions
ukceh_time_stream-4.0.0.tar.gz 862.7 kB With provenance Details for ukceh_time_stream-4.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ukceh-time-stream 4.0.0
File Interpreter ABI Platform Actions
ukceh_time_stream-4.0.0-py3-none-any.whl Python 3 none any Details for ukceh_time_stream-4.0.0-py3-none-any.whl

Total release size: 936.8 kB

Release files / ukceh_time_stream-4.0.0.tar.gz

Download URL ukceh_time_stream-4.0.0.tar.gz
Size 862.7 kB
Tags Source
SHA-256 checksum
How to use checksums
625a8874cd68bf82c6fd5abd6ea39981368a8612dc6276f9e663bc7a92f53bd3
BLAKE2b-256 checksum
How to use checksums
496a822d5f6696c0430b9ceac04daecca16f97310cdc32f130f5ea8be57c0e6c
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 Nov 2, 2026.

Transparency log

Release files / ukceh_time_stream-4.0.0-py3-none-any.whl

Download URL ukceh_time_stream-4.0.0-py3-none-any.whl
Size 74.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b6c781d741ef8feabfbf08cb5e0c2da632209b04bdc2968d8805edf8dfd20e13
BLAKE2b-256 checksum
How to use checksums
c91662d87d58499d281de629e485b8d6fe1ace00a7cd3b34bfde55af59517ec4
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 Nov 2, 2026.

Transparency log

Security for ukceh-time-stream 4.0.0

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ukceh_time_stream-4.0.0.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 Nov 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

4.0.0 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