Skip to main content

Format Input

Format Input is a small Python library for parsing console or text-stream input according to a compact format specification. Instead of repeatedly calling input(), splitting strings, and converting values by hand, describe the shape of each input line once and receive typed Python values.

It is useful for:

  • Competitive programming problems with predictable, line-based input.
  • Command-line tools that read structured text.
  • Small scripts that need to convert input into integers, floats, and strings.
  • Situations where input may contain a mixture of scalar values, lists, and values followed by free-form text.

For example, instead of manually splitting and converting a line:

parts = input().split()
count = int(parts[0])
ratio = float(parts[1])
name = parts[2]

You can describe the input once and receive typed values directly:

count, ratio, name = format_input("int float str")

See USAGE.MD for all supported types and format specifications.

Requirements

  • Python 3.10 or newer
  • No third-party dependencies

Installation

Clone the repository:

git clone https://github.com/GabbaTK/Format-Input.git
cd Format-Input

The package is stored in src/. To run the test suite from the repository root:

PYTHONPATH=src python -m unittest discover -s tests -v

License

This project is available under the MIT License.

AI disclosure

No AI was used in the making of the code.

Metadata

Release files for format-input 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for format-input 0.1.0
File Size Uploaded Provenance Actions
format_input-0.1.0.tar.gz 8.6 kB With provenance Details for format_input-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for format-input 0.1.0
File Interpreter ABI Platform Actions
format_input-0.1.0-py3-none-any.whl Python 3 none any Details for format_input-0.1.0-py3-none-any.whl

Total release size: 13.9 kB

Release files / format_input-0.1.0.tar.gz

Download URL format_input-0.1.0.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
87fc5e7ed02ed73483bffd187d4cd2d36f31bfb3db9862f57879dc5fc20f21f6
BLAKE2b-256 checksum
How to use checksums
515d7dd5601dca1a8c247371aa4a7748eb40324f233ec36090e470ae50268ae7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 30, 2026.

Transparency log

Release files / format_input-0.1.0-py3-none-any.whl

Download URL format_input-0.1.0-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ad3117ebd8a761fb687feed42185ff35dfb2f8e437fbea379585bac873e0735
BLAKE2b-256 checksum
How to use checksums
a1c461edf77ce4719c6dfb33858b69f72c2e7c1d5d345dc306b207f10e933d20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 30, 2026.

Transparency log

Security for format-input 0.1.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for format_input-0.1.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 Nov 30, 2026.

Transparency log

A 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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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