=============================================
## Sequece of dates
`dts` generate sequence of datetimes.
```
$ dts 20180401 20180403
20180401
20180402
20180403
```
If you do it using `seq`, it will like below.
```bash
$ seq 1 3
1
2
3
$ seq -f '%02g' 1 3 | xargs -I {} echo "201804{}"
20180401
20180402
20180403
```
## Install
```bash
pip install dts
```
## How to use: Simple
```bash
$ dts -h
usage: dts [-h] [-i INTERVAL] [-f FORMAT] FIRST LAST
dts is a seq util for datetimes
Examples:
$ dts 20180501 20180503
20180501
20180502
20180503
$ dts 20180501-0900 20180501-1200 -i h1 -f '%Y-%m-%dT%H:%M:%S'
2018-05-01T09:00:00
2018-05-01T10:00:00
2018-05-01T11:00:00
2018-05-01T12:00:00
Github: https://github.com/KwangYeol/dts
positional arguments:
FIRST first date of the seq. For example, 2018-05-01, 20180501, 20180501-0900, 2018-05-01T09:00
LAST last date of the seq. See also, FIRST
optional arguments:
-h, --help show this help message and exit
-i INTERVAL, --interval INTERVAL
interval: h1, d1, w1. default value is d1
-f FORMAT, --format FORMAT
see also, datetime.strftime
```
* `-i`: It has two parts. (time unit) + (interval).
- time unit: `h` menas hours, `d` means days, and `w` menas weeks
- interval: numbers
- `h1` means 1-hour interval, `d3` means 3-day interval, etc.
- default value is `d1`
* `-f`: It has datetime format. See this (https://docs.python.org/2/library/datetime.html#strftime-strptime-behavior)
## How to use: with Pipeline
```bash
$ dts 20180401 20180430 -i d7
20180401
20180408
20180415
20180422
20180429
$ dts 20180510-0900 20180510-1400 -i h1 -f '%Y%m%d-%H00'
20180510-0900
20180510-1000
20180510-1100
20180510-1200
20180510-1300
20180510-1400
$ dts 20180510-0900 20180510-1400 -i h1 -f '%Y-%m-%dT%H:00'
2018-05-10T09:00
2018-05-10T10:00
2018-05-10T11:00
2018-05-10T12:00
2018-05-10T13:00
2018-05-10T14:00
```
### How to use
For examle, you have hive table named `credit` which has daily partition `yyyymmdd` like below.
```bash
hadoop fs -ls /hive/warehouse/sales.db/credit/yyyymmdd=20180401
```
You can find the data size in some range with `dts`.
```bash
$ dts 20180401 20180410 | xargs -I {} hadoop fs -ls /hive/warehouse/sales.db/credit/yyyymmdd={}
```
## Development
python setup.py install
python setup.py sdist
python setup.py sdist bdist bdist_wheel
Metadata
Release files for dts 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dts-0.1.3.tar.gz | 5.9 kB | Without provenance | Details for dts-0.1.3.tar.gz |
Release files / dts-0.1.3.tar.gz
| Download URL | dts-0.1.3.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
51968dc946d2e60241faca615c14dccb550d2e23e44ed0496293254597e0b778
|
|
BLAKE2b-256 checksum How to use checksums |
933ebb28ee0dc1b1b713934d5bc2a3a858de930277ee0e1f631f38ee809e58b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for dts 0.1.3
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.