Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add date/time prompt #178

Open
wants to merge 50 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
f81d557
:arrow_up: update dependencies
NicDom Oct 31, 2021
e5b02d2
:tada: first commit for date prompt feature
NicDom Oct 31, 2021
8a6d9e8
:sparkles: add simple date validation
NicDom Oct 31, 2021
705fe03
:sparkles: add date completion via arbitrary date parsers
NicDom Oct 31, 2021
af88016
:sparkles: add date validation via arbitrary date parsers
NicDom Oct 31, 2021
6f5e2aa
:sparkles: add date completion combining simple completion and parser…
NicDom Oct 31, 2021
df60163
:sparkles: add date validation combining simple validation and parser…
NicDom Oct 31, 2021
3130aad
:sparkles: add the date prompt method
NicDom Oct 31, 2021
843d149
:memo: add documentation for new date method
NicDom Oct 31, 2021
cd25e2c
:white_check_mark: add 'date' to AVAILABLE_PROMPTS
NicDom Oct 31, 2021
5b3058d
:memo: add date to README.md
NicDom Oct 31, 2021
8df9a1b
:sparkles: 'date' return now by default 'datetime.datetime'
NicDom Oct 31, 2021
a186394
:sparkles: add times to 'simple' completion and validation
NicDom Nov 1, 2021
5dece60
:pencil2: used the wrong brackets
NicDom Nov 1, 2021
4efdf90
:bug: forgot to add 'SECOND' to 'PARSE_FORMAT_DICT'
NicDom Nov 1, 2021
4dc4245
:white_check_mark: added several tests for 'date'
NicDom Nov 1, 2021
bbaf2c1
:coffin: remove old code
NicDom Nov 1, 2021
240b500
:white_check_mark: add exception test for 'SimpleDateValidator'
NicDom Nov 1, 2021
0f9271f
:art: formatted code using black
NicDom Nov 1, 2021
ed54148
:children_crossing: add a custom date parser for ISO8601
NicDom Nov 1, 2021
5092e63
:boom: default parser is now 'custom_date_parser'
NicDom Nov 1, 2021
67a21dc
:white_check_mark: date parser in testsuite is no longer required
NicDom Nov 1, 2021
f5985e4
:bug: corrected regex in custom_date_parser
NicDom Nov 1, 2021
9af003d
:zap: add microseconds to 'custom_date_parser'
NicDom Nov 1, 2021
11d5146
:white_check_mark: add test for 'ParsingDateCompletion'
NicDom Nov 1, 2021
e3c530c
:zap: check type of 'parser'
NicDom Nov 1, 2021
ad4b29e
:bug:fix creation of 'date_formats'
NicDom Nov 1, 2021
b803be8
:white_check_mark: add test for 'ParsingDateValidator'
NicDom Nov 1, 2021
77b5ee8
:zap: default parser for 'date' is no 'custom_date_parser'
NicDom Nov 1, 2021
0bb9196
:zap: add parameter for deactivating external parser
NicDom Nov 1, 2021
4c03538
:art: run black on code
NicDom Nov 1, 2021
8a82305
:bug: 'date_format' could not be set to None
NicDom Nov 1, 2021
fe89227
:white_check_mark: add several tests
NicDom Nov 2, 2021
8abea72
:rotating_light: fixed mypy warnings
NicDom Nov 2, 2021
27a0dae
:memo: fix import in example
NicDom Nov 2, 2021
85608e5
Update README.md
NicDom Dec 22, 2021
a3f414f
Update questionary/prompts/date.py
NicDom Dec 22, 2021
6ae8be2
Update questionary/prompts/date.py
NicDom Dec 22, 2021
d327fb3
Update questionary/prompts/date.py
NicDom Dec 22, 2021
d0644ea
Update questionary/prompts/date.py
NicDom Dec 22, 2021
2f73e98
:children_crossing: Add date to __all__
NicDom Dec 24, 2021
77cc28a
:sparkles: Completion only shows completions for valid dates
NicDom Dec 24, 2021
e82c0a4
:bug:`full_output´ was used before referenced
NicDom Dec 27, 2021
8bfdc6b
:white_check_mark: now only valid dates are yield by completion
NicDom Dec 27, 2021
8200ce1
:sparkles: introduce new styles for autocomplete options and informat…
NicDom Dec 27, 2021
fba0ede
:white_check_mark: test_complete_date appeared twice
NicDom Dec 27, 2021
6df6ce0
:sparkles: define default style for 'information' and 'options'
NicDom Dec 27, 2021
6beee39
:sparkles: use classes for styles of complete options to make them cu…
NicDom Dec 27, 2021
65c7968
Merge branch 'master' into feature/date
tmbo Feb 26, 2022
b8893cd
Merge branch 'master' into feature/date
kiancross Aug 15, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@

✨ Questionary is a Python library for effortlessly building pretty command line interfaces ✨

* [Features](#features)
* [Installation](#installation)
* [Usage](#usage)
* [Documentation](#documentation)
* [Support](#support)
- [Questionary](#questionary)
- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Documentation](#documentation)
- [Support](#support)
- [Contributing](#contributing)
- [Authors and Acknowledgment](#authors-and-acknowledgment)
- [License](#license)


![Example](https://raw.githubusercontent.com/tmbo/questionary/master/docs/images/example.gif)
Expand All @@ -24,6 +28,7 @@ import questionary
questionary.text("What's your first name").ask()
questionary.password("What's your secret?").ask()
questionary.confirm("Are you amazed?").ask()
questionary.date("Please enter your date of birth: ).ask()

questionary.select(
"What do you want to do?",
Expand All @@ -49,10 +54,11 @@ Used and supported by
## Features

Questionary supports the following input prompts:

* [Text](https://questionary.readthedocs.io/en/stable/pages/types.html#text)
* [Password](https://questionary.readthedocs.io/en/stable/pages/types.html#password)
* [File Path](https://questionary.readthedocs.io/en/stable/pages/types.html#file-path)
* [Dates and Times](https://questionary.readthedocs.io/en/stable/pages/types.html#type-date)
* [Confirmation](https://questionary.readthedocs.io/en/stable/pages/types.html#confirmation)
* [Select](https://questionary.readthedocs.io/en/stable/pages/types.html#select)
* [Raw select](https://questionary.readthedocs.io/en/stable/pages/types.html#raw-select)
Expand Down Expand Up @@ -107,7 +113,7 @@ Contributions are very much welcomed and appreciated. Head over to the documenta

Questionary is written and maintained by Tom Bocklisch and Kian Cross.

It is based on the great work by [Oyetoke Toby](https://github.com/CITGuru/PyInquirer)
It is based on the great work by [Oyetoke Toby](https://github.com/CITGuru/PyInquirer)
and [Mark Fink](https://github.com/finklabs/whaaaaat).

## License
Expand Down
9 changes: 9 additions & 0 deletions docs/pages/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ with the available question types**:

* use :ref:`type_path` to ask for a **file or directory** path with autocompletion

* use :ref:`type_date` to ask for a **date** or **time** with validation and autocompletion

* use :ref:`type_confirm` to ask a **yes or no** question

* use :ref:`type_select` to ask the user to select **one item** from a beautiful list
Expand Down Expand Up @@ -46,6 +48,13 @@ File Path

.. automethod:: questionary::path

.. _type_date:

Dates and Times
###############

.. automethod:: questionary::date

.. _type_confirm:

Confirmation
Expand Down
Loading