Skip to main content

Datetime helpers (linspace, normalize_timestamp, format helpers) — standalone module from the SciTeX ecosystem

Project description

scitex-datetime

SciTeX

Small datetime helpers — linspace, normalize, parse, format.

Full Documentation · uv pip install scitex-datetime[all]

PyPI Python Tests Coverage Docs License: AGPL v3


Installation

pip install scitex-datetime

Architecture

scitex_datetime/
├── __init__.py                ← public API (linspace, normalize_timestamp,
│                                 to_datetime, format_for_filename, ...)
├── _linspace.py               ← linearly-spaced datetime arrays
└── _normalize_timestamp.py    ← parse + standardize heterogeneous strings

Pure-stdlib datetime helpers; the umbrella scitex.datetime import path is preserved via a sys.modules-alias bridge.

Quick Start

import scitex_datetime as sxd

dt = sxd.to_datetime("2026/04/27 10:30:00")
print(sxd.format_for_filename(dt))   # "2026-04-27_103000"

1 Interfaces

Python API
import scitex_datetime as sxd

# Linearly spaced timestamps
sxd.linspace(start, stop, num=100)

# Parse and standardize timestamps
sxd.normalize_timestamp("2026-04-27T10:30:00")
sxd.to_datetime("2026/04/27 10:30:00")
sxd.validate_timestamp_format("2026-04-27 10:30:00")

# Format
sxd.format_for_display(dt)       # "2026-04-27 10:30:00"
sxd.format_for_filename(dt)      # "2026-04-27_103000"

# Time deltas
sxd.get_time_delta_seconds(dt1, dt2)

Demo

flowchart LR
    S1["'2026/04/27 10:30:00'"] --> P["sxd.to_datetime()"]
    S2["'2026-04-27T10:30:00'"] --> N["sxd.normalize_timestamp()"]
    P --> D["datetime"]
    N --> D
    D --> F["sxd.format_for_filename()<br/>→ '2026-04-27_103000'"]
    A["start, stop"] --> L["sxd.linspace(num=100)"]
    L --> R["[datetime, ...]"]

Status

Standalone fork of scitex.datetime. The umbrella package's scitex.datetime import path is preserved via a sys.modules-alias bridge. STANDARD_FORMAT is read from a scitex CONFIG when available, falling back to "%Y-%m-%d %H:%M:%S".

Part of SciTeX

scitex-datetime is part of SciTeX. Install via the umbrella with pip install scitex[datetime] to use as scitex.datetime (Python) or scitex datetime ... (CLI).

Four Freedoms for Research

  1. The freedom to run your research anywhere — your machine, your terms.
  2. The freedom to study how every step works — from raw data to final manuscript.
  3. The freedom to redistribute your workflows, not just your papers.
  4. The freedom to modify any module and share improvements with the community.

AGPL-3.0 — because we believe research infrastructure deserves the same freedoms as the software it runs on.

License

AGPL-3.0-only (see LICENSE).


SciTeX

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scitex_datetime-0.1.3.tar.gz (22.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scitex_datetime-0.1.3-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

Details for the file scitex_datetime-0.1.3.tar.gz.

File metadata

  • Download URL: scitex_datetime-0.1.3.tar.gz
  • Upload date:
  • Size: 22.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scitex_datetime-0.1.3.tar.gz
Algorithm Hash digest
SHA256 b75e7ec3a164d8bb2258d1f294d64162b75c6675bb0832f6abcb649f6dc2648b
MD5 345fd623b4300a977815643fd258b7d1
BLAKE2b-256 bcc618e6550b743873ec5e57c00fbe491f34f10309a4992867d89d573050e2fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for scitex_datetime-0.1.3.tar.gz:

Publisher: publish-pypi.yml on ywatanabe1989/scitex-datetime

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scitex_datetime-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: scitex_datetime-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 22.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scitex_datetime-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 27c5ff09e4101e59cadff78acc74bc340e8408700aa0bb0c53e8f4dbb60b1f2d
MD5 2c1787bb96aa96ccce182f8eec3e06ee
BLAKE2b-256 3f7efe7aab12e0f6b24c3da53a3f7cb8cc40acc3a881a9b39e3587aefcb6378c

See more details on using hashes here.

Provenance

The following attestation bundles were made for scitex_datetime-0.1.3-py3-none-any.whl:

Publisher: publish-pypi.yml on ywatanabe1989/scitex-datetime

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page