trybox is a local-first utility for Python developers to write, save, and safely execute code snippets in isolated subprocesses. It offers a clean interface to tag and timestamp experiments, making it easy to organize, revisit, and rerun them at any time. Built entirely on the Python standard library, trybox runs fully offline, without telemetry or cloud dependencies, and is ideal for quick prototyping, testing ideas, or maintaining a persistent scratchpad.
- π Save Python snippets with descriptions and timestamps
- π§± Run snippets in isolated subprocess environments
- π Browse and rerun previous experiments easily
- π Fully offline β no telemetry or cloud sync
- π Built with the Python standard library only
While traditional IDEs like PyCharm or quick ad hoc scripts like test.py
are common for experimenting with Python, they both come with limitations.
trybox is designed for developers who want a fast, organized, and terminal-based way to write, save, and run short Python experiments β without managing files manually or switching out of the terminal.
Even if you already use PyCharm or another IDE, trybox still fills an important gap:
- π§ Isolation β You can prototype without touching your project structure
- β‘ Speed β No need to open a GUI or manage files β launch from the terminal instantly
- π Clean Workspace β Keeps scratch code out of your repo
- π§ Snippet History β Snippets are saved, timestamped, and searchable β unlike PyCharm scratch files
- π₯ Headless Support β Perfect for remote servers, SSH, or containers where GUI tools arenβt available
- π₯ Safety β Snippets run in isolated subprocesses, with support for timeouts and future sandboxing
TryBox complements IDEs β itβs not a replacement. Use your IDE for structured dev work, and use trybox when you just want to experiment.
Yes, you can just write scratch.py
or test.py
and run it. But TryBox exists to solve the common pain points of doing that repeatedly:
Problem | What Developers Typically Do | How TryBox Solves It |
---|---|---|
π₯ Workspace clutter | Create lots of throwaway files: test1.py , scratch.py |
Automatically tags and organizes saved snippets |
π§ Forgetting useful code | Lose valuable experiments or overwrite them | Keeps everything archived, timestamped, and reusable |
ποΈ Poor snippet management | Manually manage files or use vague names | Built-in history, tagging, and snippet preview |
π§ͺ Lack of isolation | Runs all code in the same environment | Executes snippets in a subprocess for safety |
π Reuse is tedious | Copy/paste or retype code when needed again | Rerun old snippets from the list in one command |
β‘ Slower workflow | Create, save, run β all manually | Write, save, and run directly from the terminal/editor |
TryBox is like a personal Python scratchpad β but with memory, structure, and zero setup.
trybox is ideal for:
- β‘ Rapid prototyping or testing one-off ideas
- π§ͺ Running isolated code safely without polluting your workspace
- π§ Keeping a searchable archive of past experiments
- π₯ Working in minimal or remote environments without a GUI
- π§° Building a habit of local, organized experimentation
It's a personal Python scratchpad β clean, efficient, and always ready in your terminal.
-
Open a terminal and activate your virtual environment, if using one:
source venv/bin/activate
-
Run the main interface:
python -m trybox.main
-
Choose option
[1]
to create a new snippet
You'll be prompted to enter a description and write your code in your editor. -
Example input:
Enter tag/description: greet user
In your editor, write the following code and save:
name = input("What is your name? ") print(f"Hello, {name}! Welcome to TryBox.")
-
After saving, your snippet will be stored.
If auto-run is enabled, youβll immediately see something like:What is your name? Alice Hello, Alice! Welcome to TryBox.
-
Or, choose option
[2]
from the main menu to run it manually later.
π This project is licensed under the Apache License, Version 2.0.