Skip to main content
This module defines several general-purpose functions:

- The functions `get_bool`, `get_int`, `get_float`, and `get_str` facilitate the
reading interactive input from the command line, with type checks and optional
value checks on the user input. (The Python Standard Library provides a rather
minimal capability for reading command-line input).

- The function `make_check` generates a function as its output; the generated
function tests a value against an arbitrary condition, and can be passed to any
of the above command-line input functions.

- The function `str2int` converts a string to an integer, with somewhat more
flexible rules for input formatting than those imposed by Python's `int`
function.

Release history Release notifications | RSS feed

This release

1.0 This release

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page