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).
source: <http://github.com/Yelp/dateglob>
documentation: <http://packages.python.org/dateglob/>
datetime.strftime(): <http://docs.python.org/library/datetime.html#strftime-and-strptime-behavior>
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
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | a19080a0191d4f3e5e9d1dbff14e0fd60f782d7bce1748c685be6d059cc91407 |
|
MD5 | 8c6efe2b13fb953836558bc3f482074d |
|
BLAKE2b-256 | e1112eb67baf9e55cec5a9f3b9642f8283d271d1ec7f41722b43f195708eddbd |
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccc218e81468dce131749d1a6c46fb4c33b845bf7e578be1c13ac12ec52d2b57 |
|
MD5 | b208851be7514fda00a2c0e674c0fc3b |
|
BLAKE2b-256 | 65f1944b1b0a6d5d4a1b3d23ce1433f3c45b3e19ac1f7faa7acfd0a293fa2817 |