Cooked Input Project
cooked_input is a Python package for getting, cleaning, converting, and validating input. If you think of input (raw_input in legacy Python) as raw input, then this is cooked input.
cooked_input provides a simple and safe way to get validated command line input that ranges from the simplest of Python programs to sophisticated database driven applications. Beginner’s can use the provided convenience classes to get simple inputs from the user. Following the quick start guide you can be up and running in minutes.
More advanced users can easily create custom classes for sophisticated cleaning and validation. Cooked_input can also be used to create menus and data tables. The latter tutorials (part one and part two) and examples show several examples ranging from simple to sophisticated calls.
Cooked_input also provides a pathway to use the same cleaning and validation logic used in the command line for validating web or GUI based inputs.
Documentation
The documentation is available at: http://cooked-input.readthedocs.io/en/latest/
Python Support
cooked_input requires Python 3.10 or later, and has been tested through Python 3.14. Python 2 is no longer supported (the last release supporting it is v0.5.4).
Release Notes
v0.7.0 is a large release by volume of change, even though it adds no new functionality. It is almost entirely work on the inside of the package. Every function, method and class was annotated with types, and a py.typed marker now ships so downstream projects actually see them; the test suite went from 86 tests at 79.6% coverage to 661 at 100%; and the two largest modules were split along the seam they already had. Reading essentially all of the code that way turned up thirty-two real defects that had been sitting behind an untyped signature or an untested line, and those fixes are the bulk of the release.
There are breaking changes. Most code will not notice, but they are worth a look before upgrading:
DecimalConvertor now honours precision and rounding, which it had been ignoring, so get_money(precision=2) returns different numbers than it used to.
Table.scroll_up_one_row and Table.scroll_down_one_row had their bodies the wrong way round and now move the view in the direction they are named for.
get_menu returns 'exit' where it used to hand back a TableItem, and Table.get_table_choice returns None when the exit row is chosen.
A blank line at a required=True prompt is reported through error_callback and counts against retries, instead of being skipped in silence – which had been an infinite loop.
in_all, in_any and not_in are no longer importable from cooked_input. They were always internal plumbing and appeared in no documentation. validate() is unaffected.
The module-level validation helpers, and SimpleValidator, now return a real bool rather than passing a validator’s truthy return value through, and return True rather than None when there is nothing to validate.
GetInput and every get_* function take their options as named keyword-only parameters instead of a **options dictionary. An unrecognised option raises a TypeError rather than logging a warning and carrying on with the default, so get_int(promt="Age?") is now reported instead of quietly asking the wrong question. Code that builds an options dictionary still works by unpacking it: get_int(**options).
Table, create_table, get_menu, Table.get_table_choice and get_table_input changed the same way. An unrecognised option raises a TypeError rather than being silently ignored – which is how two bugs in the shipped examples had gone unnoticed.
Cleaner, Convertor and Validator are now real abstract base classes. A subclass that never implemented __call__ raises TypeError when instantiated, where before it silently returned None from every call.
A single string given to AnyOfValidator or NoneOfValidator is now one choice rather than being iterated one character at a time.
See CHANGELOG.rst for the full list, including the defects the type checker found and what each of them affected.
Installation
pip install cooked_input
Project Page
Project information and source code is available at: https://github.com/lwanger/cooked_input
Tutorial
The best way to get started is to read the quick start at: http://cooked-input.readthedocs.io/en/latest/quick_start.html
After that, more advanced usage can be learned from the tutorial at: http://cooked-input.readthedocs.io/en/latest/tutorial.html
Metadata
Release files for cooked-input 0.7.0
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 | |
|---|---|---|---|---|
| cooked_input-0.7.0.tar.gz | 152.2 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cooked_input-0.7.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 302.0 kB
Release files / cooked_input-0.7.0.tar.gz
| Download URL | cooked_input-0.7.0.tar.gz |
|---|---|
| Size | 152.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
20132bf962aa466d7e1492fb9dd7eb3594b221be657e14275585d03db5efa26d
|
|
BLAKE2b-256 checksum How to use checksums |
c652799fb6169db013f15e200f6a22ca36fdb12a0011c7651e5212019cbe9ff7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 13, 2026.
Transparency logRelease files / cooked_input-0.7.0-py3-none-any.whl
| Download URL | cooked_input-0.7.0-py3-none-any.whl |
|---|---|
| Size | 149.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2358339e2a9f2ec06cd4cf0a0c1bad30405646aa2bbb760fc60c61a86592abaa
|
|
BLAKE2b-256 checksum How to use checksums |
73183e6391286c463f34b4696e4588ef1f4303844d1b74507aaaa23aca974491
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 13, 2026.
Transparency logSecurity for cooked-input 0.7.0
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for cooked_input-0.7.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 13, 2026.
Transparency logA 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.