input_method

Crates.ioinput_method
lib.rsinput_method
version0.1.0
created_at2025-06-03 20:41:17.957635+00
updated_at2025-06-03 20:41:17.957635+00
descriptionA tiny Rust crate that provides a Python-like input() function for CLI apps.
homepage
repositoryhttps://github.com/had2020/input_method
max_upload_size
id1699456
size4,108
Hadrian Lazic (had2020)

documentation

README

input_method

MSRV crates.io Downloads

A tiny, opinionated Rust crate that brings a Python-style input method to your CLI apps. Ideal for quick scripts, REPLs, and simple text-based interactions.

📦 Purpose

This crate exists to provide one simple function: read user input from stdin, with an optional prompt. That’s it. Just like Python’s input().

Perfect for:

  • Quick scripts and prototypes ⚡
  • Fast little CLI tools 🛠️
  • School exercises and coding challenges 🧠

🚀 Usage

Add it to your Cargo.toml:

cargo add input_method

Basic usage

use input_method::input;

fn main() {
    println!("What is your name!");
    let name = input();
    println!("Hello, {}", name);
}

Features

  • Simple and ergonomic
  • No dependencies (just std :C)
  • Works out-of-the-box on Unix based platforms
  • Minimal footprint (zero config)

See Github for Up To Date Docs

Leave a star to be a star! ⭐

PRs welcome, keep it simple.

Commit count: 10

cargo fmt