Skip to main content

Timestamp enumerator

Project description

tsenum

Tests

A timestamp generator.

Install

You can use pip to install from the repository

pip install tsenum

or download sources and run pip from this directory

git clone https://github.com/aboehm/tsenum
pip install .

Usage

tsenum provides an CLI. For help run:

tsenum -h

To count 7 days back from yesterday via CLI, run:

tsenum --offset -1 --count -7 --step day --pattern "%Y-%m-%d: Hello world!"
2016-05-27: Hello world!
2016-05-28: Hello world!
2016-05-29: Hello world!
2016-05-30: Hello world!
2016-05-31: Hello world!
2016-06-01: Hello world!
2016-06-02: Hello world!

To do it programmatically:

from datetime import datetime
import tsenum

print(
    tsenum.enumerate_times(
        datetime.now().astimezone(),
        offset=-1,
        count=-7,
        step=tsenum.Step.DAY,
        pattern='%Y-%m-%d'
    )
)

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

tsenum-1.2.0.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

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

tsenum-1.2.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file tsenum-1.2.0.tar.gz.

File metadata

  • Download URL: tsenum-1.2.0.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for tsenum-1.2.0.tar.gz
Algorithm Hash digest
SHA256 2ce07a32c25414dc670b22fbd135bd25ee2d575e40eeb774e6e7374527b9e13a
MD5 7cbb78b815ea897a46bb0893e8e29af3
BLAKE2b-256 4ea8af8bbce03fe151992ff5256f1d5f3407ae31318166b8ebd3b3637c54ad8a

See more details on using hashes here.

File details

Details for the file tsenum-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: tsenum-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for tsenum-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1eb410016f1f2eb4e6a06cd14ddcd7f86bd3fd56a3dca1faaa2fe3f9d5b2b98f
MD5 ed6bae9c30a5c097166ba58787fed9ca
BLAKE2b-256 d4f48d5ab64806076b46f9b40a19838f3325545f440c86ee8992b425491a1184

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