Skip to main content

SQLAlchemy-Utc

https://badge.fury.io/py/SQLAlchemy-Utc.svg? https://travis-ci.org/spoqa/sqlalchemy-utc.svg?branch=master https://codecov.io/github/spoqa/sqlalchemy-utc/coverage.svg?branch=master

This package provides a drop-in replacement of SQLAlchemy’s built-in DateTime type with timezone=True option enabled. Although SQLAlchemy’s built-in DateTime type provides timezone=True option, since some vendors like SQLite and MySQL don’t provide timestamptz data type, the option doesn’t make any effect on these vendors.

UtcDateTime type is equivalent to the built-in DateTime with timezone=True option enabled on vendors that support timestamptz e.g. PostgreSQL, but on SQLite or MySQL, it shifts all datetime.datetime values to UTC offset before store them, and returns always aware datetime.datetime values through result sets.

Long story short, UtcDateTime does:

  • take only aware datetime.datetime,

  • return only aware datetime.datetime,

  • never take or return naive datetime.datetime,

  • ensure timestamps in database always to be encoded in UTC, and

  • work as you’d expect.

A SQLAlchemy helper function, utcnow(), is provided as an alternative to func.now() for generating UtcDateTime values on the server. For example: Column('time', UtcDateTime(), default=utcnow()).

Written by Hong Minhee at Spoqa, and distributed under MIT license.

Changelog

0.10.0

Released on January 25, 2018.

  • Dropped support of older Python versions: 2.6, 3.2, and 3.3. [#2 by George Leslie-Waksman]

  • Added sqlalchemy_utc.utcnow() function as an alternative to sqlalchemy.sql.functions.now() for generating UtcDateTime values on the database server. [#4 by George Leslie-Waksman]

0.9.0

First version. Released on June 22, 2016.

Metadata

Release files for SQLAlchemy-Utc 0.10.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 SQLAlchemy-Utc 0.10.0
File Size Uploaded Provenance Actions
SQLAlchemy-Utc-0.10.0.tar.gz 3.9 kB Without provenance Details for SQLAlchemy-Utc-0.10.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for SQLAlchemy-Utc 0.10.0
File Interpreter ABI Platform Actions
SQLAlchemy_Utc-0.10.0-py2.py3-none-any.whl Python 2, Python 3 none any Details for SQLAlchemy_Utc-0.10.0-py2.py3-none-any.whl

Total release size: 10.4 kB

Release files / SQLAlchemy-Utc-0.10.0.tar.gz

Download URL SQLAlchemy-Utc-0.10.0.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
fed53af37d250168b99eba8f9908a50e34e10dab3c32d38df3e65601ac951baf
BLAKE2b-256 checksum
How to use checksums
760b27d7010ff4d208a5b839388a67ba48ebaa5a4a213cc66e79b34fcdb449b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / SQLAlchemy_Utc-0.10.0-py2.py3-none-any.whl

Download URL SQLAlchemy_Utc-0.10.0-py2.py3-none-any.whl
Size 6.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
ec5395dfa4d237239c162a1b83283d88c8e2a94219512708634c55329c900278
BLAKE2b-256 checksum
How to use checksums
7e8485cb683933ac5c2e1d5d3d33de06e72d761c9e172dc627e2b0b73a327d1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for SQLAlchemy-Utc 0.10.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.

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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