Skip to main content

Convert a set of dates into a compact list of globs

Project description

dateglob converts a set of dates into a list of globs. For example:

>>> import dateglob; from datetime import date, timedelta
>>> # build list of dates from 2009-12-31 thru 2011-02-01
>>> dates = [date(2009, 12, 31) + timedelta(i) for i in xrange(1+365+31+1)]
>>> dateglob.strftime(dates, '%Y-%m-%d')
['2009-12-31', '2010-*-*', '2011-01-*', '2011-02-01']

The original use case for this library was to generate compact command lines for command that take daily log files as input, for example:

>>> args += dateglob.strftime(dates, '/logs/foo/%Y/%m/%d/*.gz')

dateglob.strftime() handles all of the standard arguments to datetime.strftime(). Currently, it only does something special with full months, years, and full ten-day periods (we don’t glob weeks).

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

dateglob-1.1.1.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

dateglob-1.1.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file dateglob-1.1.1.tar.gz.

File metadata

  • Download URL: dateglob-1.1.1.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for dateglob-1.1.1.tar.gz
Algorithm Hash digest
SHA256 a19080a0191d4f3e5e9d1dbff14e0fd60f782d7bce1748c685be6d059cc91407
MD5 8c6efe2b13fb953836558bc3f482074d
BLAKE2b-256 e1112eb67baf9e55cec5a9f3b9642f8283d271d1ec7f41722b43f195708eddbd

See more details on using hashes here.

File details

Details for the file dateglob-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: dateglob-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for dateglob-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ccc218e81468dce131749d1a6c46fb4c33b845bf7e578be1c13ac12ec52d2b57
MD5 b208851be7514fda00a2c0e674c0fc3b
BLAKE2b-256 65f1944b1b0a6d5d4a1b3d23ce1433f3c45b3e19ac1f7faa7acfd0a293fa2817

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