Skip to main content

Run any Python script with automatic environment setup, fast package resolution via uv, and reproducible lockfile generation

Project description

Python Package PyPI PyPI Downloadst

smartrun

Run any Python script in a clean, disposable virtual environment — automatically.

smartrun 🚀

Run Python and Jupyter files with zero setup, zero pollution. Just run it.

smartrun scans your script or notebook, detects the required third-party packages, creates (or reuses) an isolated environment, installs what’s missing — and runs your code.

✅ No more ModuleNotFoundError
✅ No more cluttered global site-packages
✅ Just clean, reproducible execution — every time

Features

  • 🧪 Supports both .py and .ipynb files
  • 🔍 Automatically detects and resolves imports
  • 🛠️ Uses venv or fast uv environments (if available)
  • 📦 Installs only what's needed, only when needed
  • 💡 Reuses environments smartly to save time

Installation

pip install smartrun

Requires Python 3.10+


Usage

smartrun your_script.py
## Notebook
```bash
smartrun your_notebook.ipynb

Example file that we want to run

#some_file.py
import numpy as np
import pandas as pd
from rich import print 

df = pd.DataFrame(np.random.randn(5, 3), columns=list("ABC"))
print("Data:")
print(df, end="\n\n")
print("Column means:")
print(df.mean())

Create an environment

python -m venv .venv

✅ Activate the environment: Windows

.venv\Scripts\activate

macOS/Linux

source .venv/bin/activate

💡 Tip: smartrun handles environment creation automatically, but you’re free to manage it yourself.

✅ Run the script:

smartrun some_file.py

If any required package is missing, smartrun will install it for you.

Why smartrun?

Because setup should never block you from running great code. Whether you're experimenting, prototyping, or sharing — smartrun ensures your script runs smoothly, without dependency drama.

Contributing

Contributions are welcome! 🧑‍💻

If you’ve got ideas, bug fixes, or improvements — feel free to open an issue or a pull request. Let’s make smartrun even smarter together.

License

BSD 3‑Clause — see LICENSE for details.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smartrun-0.2.2.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

smartrun-0.2.2-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file smartrun-0.2.2.tar.gz.

File metadata

  • Download URL: smartrun-0.2.2.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for smartrun-0.2.2.tar.gz
Algorithm Hash digest
SHA256 79a682bbffe82fdf35611dae980260a2f0852705d784d157d6c18f233aadec04
MD5 0fa0d87e82169101aa852d9bc33622a0
BLAKE2b-256 a4fe6be596d75209e521a08d75ac004a8245a37f3f3cdc0b8a40ceac900bc906

See more details on using hashes here.

File details

Details for the file smartrun-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: smartrun-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for smartrun-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 900cb99820e9351fe18b0bdbf8a22e0b6d1fc137509ecd367350046d33b7ea5e
MD5 88bf9f54523a61b8a99361817b618403
BLAKE2b-256 8f7bfd169cc731f84dada866df6b074a3caa857c4bd6ea1133ab35a200b6b37e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page