Skip to main content

Period Iterator

Project description

Period Iterator

Period Iterator is a library easing you to iterate through given period.

Usage

from period_iterator.period_iterator import period_iterator

period = period_iterator('2020-02-01,2020-02-03', 'Asia/Bangkok')

while True:
    print(period.cursor.begin()) # Begin of day
    print(period.cursor.end()) # End of day
    print(period.cursor.date()) # Date
    if not period.next():
        break

# Expected Output
#
# 2020-02-01T00:00:00+07:00
# 2020-02-01T23:59:59+07:00
# 2020-02-01
# 2020-02-02T00:00:00+07:00
# 2020-02-02T23:59:59+07:00
# 2020-02-02
# 2020-02-03T00:00:00+07:00
# 2020-02-03T23:59:59+07:00
# 2020-02-03

License

MIT

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

period-iterator-1.3.0.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

period_iterator-1.3.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file period-iterator-1.3.0.tar.gz.

File metadata

  • Download URL: period-iterator-1.3.0.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for period-iterator-1.3.0.tar.gz
Algorithm Hash digest
SHA256 ad5f92949cbfe31ea518b89a0a02e303cdd2f0419f619f323caa93b0e43cb2d1
MD5 7b59493818afa320415eed632864618a
BLAKE2b-256 3ea80acc3bf18c4634e69364068fb4dbdd62667a82b8b434d3f02c74197d9beb

See more details on using hashes here.

File details

Details for the file period_iterator-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for period_iterator-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 41ef910e66c8fc9c1626febe2a37e9f96fbcf76097b462463bb13807cf80d2c3
MD5 51a7195eae95323c0e826c30a648a7f4
BLAKE2b-256 fa3defa08ad8edd5e8fc4be3d725c5bbb4f8f9aeaabcc6896aef16b920e75c1e

See more details on using hashes here.

Supported by

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