Skip to main content

Get python datetime objects from CLI users easily

Project description

# getTimer
#### Alpha Version
Python utilities library for getting time inputs from users in CLI Apps as datetime objects.

#### Installation
```
$ pip install getTimer
```
#### Examples
```
>>> date = getTimer.getUserDate()
>>> date
datetime.date(2016, 2, 12)
>>> date.day
12
```
getTimer makes it easy to get properly formatted date, time, and datetime python objects from your users in Command Line Interface applications. Users may use either the arrow keys or their numeric keypad to enter data.
![basic_usage](https://raw.githubusercontent.com/maxwellgerber/getTimer/master/gifs/basic_usage.gif)
developers using the module can edit the top string, bottom string, and initial time shown to the user
![customizable](https://raw.githubusercontent.com/maxwellgerber/getTimer/master/gifs/customizable.gif)
rollover mode can be enabled or disabled as necessary
![rollover](https://raw.githubusercontent.com/maxwellgerber/getTimer/master/gifs/rollover.gif)
#### Usage
The module currently contains three functions:
`getTimer.getUserDate(topString = 'Input your Date', bottomString = 'Press Enter when done', rollover = False, start = None)`
* returns a python datetime.date object containing the user's input
* topString and bottomString controll text displayed to user
* rollover controlls behavior of widget
* start must be a datetime.date object. Defaults to datetime.date.today()

`getTimer.getUserTime(topString = 'Input your Date', bottomString = 'Press Enter when done', rollover = False, start = None)`
* returns a python datetime.time object containing the user's input
* topString and bottomString controll text displayed to user
* rollover controlls behavior of widget
* start must be a datetime.time object. Defaults to datetime.time()

`getTimer.getUserDateTime(topString = 'Input your Date', bottomString = 'Press Enter when done', rollover = False, start = None)`
* returns a python datetime.datetime object containing the user's input
* topString and bottomString controll text displayed to user
* rollover controlls behavior of widget
* start must be a datetime.datetime object. Defaults to datetime.datetime.now()
#### Todo
- [ ] 12 hour AM/PM timestamp
- [ ] verbose option (e.g. print month names instead of int)
- [ ] Integration testing?
- [ ] Enable rollover between date and time in getUserDateTime

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

getTimer-0.1.2.linux-x86_64.tar.gz (9.4 kB view details)

Uploaded Source

File details

Details for the file getTimer-0.1.2.linux-x86_64.tar.gz.

File metadata

File hashes

Hashes for getTimer-0.1.2.linux-x86_64.tar.gz
Algorithm Hash digest
SHA256 deb6e14da2e49977d83cb3fd8637897e3adcb95b922697899862c870b8f37953
MD5 0984f734ba11d5b445ec6b42d211cfe9
BLAKE2b-256 ecbacf6edeff886023e3c823408c93c3e0c6c94f41fa3da5173c8fdf4c20b7e1

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