Skip to main content

UTC-first datetime utilities for Python & ORMs: parse any tz, store as UTC, convert for display.

Project description

time-to-sail

UTC-first datetime utilities for Python apps and ORMs.

  • Always store timezone-aware UTC datetimes.
  • Parse strings in many formats (via python-dateutil) and coerce to UTC.
  • Convert for display using IANA zones (zoneinfo).
  • SQLAlchemy helpers to force UTC on write/read.

Quickstart

from timetosail import now_utc, to_utc, now_in
from timetosail.sqlalchemy import UTCDateTime, utc_now

dt = now_utc()  # aware UTC
to_utc("2025-09-16 08:30", tzname="America/Lima")

SQLAlchemy

from sqlalchemy.orm import Mapped, mapped_column
from timetosail.sqlalchemy import UTCDateTime, utc_now

fecha_creacion: Mapped[datetime] = mapped_column(
    UTCDateTime(timezone=True), default=utc_now, nullable=False
)

Install Manual

pip install -e .

Build & Publish

pip install build twine
python -m build
python -m twine upload dist/*

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

time_to_sail-0.1.0.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

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

time_to_sail-0.1.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file time_to_sail-0.1.0.tar.gz.

File metadata

  • Download URL: time_to_sail-0.1.0.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for time_to_sail-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8950c0017b7570dcc1819293586c009449e97b9789b0a2a9b826faa01979452f
MD5 6da558d68233736718a802e00b0c8dc5
BLAKE2b-256 068b5c13d65ee2cd458874aeedf9d2b8221c2a691dce373e9816ad34676d4570

See more details on using hashes here.

File details

Details for the file time_to_sail-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: time_to_sail-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for time_to_sail-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d10de8ca405e8ebd18abaf3c66884e4f44f921d57023510fc11182319322a364
MD5 f2dfff9435034335bdf43c7b62b9a2d4
BLAKE2b-256 90ac22c8ab55a88d0ea7387cd9b3f53aa3ea56e10d0474dc9c3b961f901a654f

See more details on using hashes here.

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