Coder Social home page Coder Social logo

gettimer's Introduction

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
developers using the module can edit the top string, bottom string, and initial time shown to the user
customizable
rollover mode can be enabled or disabled as necessary
rollover

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

  • Nicer gifs/documentation
  • 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

gettimer's People

Contributors

maxwellgerber avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.