Skip to main content

Idae

Poetry Code style: black Ruff Imports: isort Checked with mypy codecov

CI PyPI - Python Version PyPI PyPI - License

A PEP 723 implementation

Usage

Run like normal Python except that the first argument must be a path to the script.

idae example.py

The dependency specification within the Python script must be like the following (example from PEP 723):

#!/usr/bin/env idae
# /// script
# requires-python = ">=3.11"
# dependencies = [
#   "requests<3",
#   "rich",
# ]
# ///

import requests
from rich.pretty import pprint

resp = requests.get("https://peps.python.org/api/peps.json")
data = resp.json()
pprint([(k, v["title"]) for k, v in data.items()][:10])

If you need to pass arguments that look like options for idae to the script you want to run, use the standard UNIX convention of --. For example, let's say you have a script

# script.py
import sys
print(" ".join(sys.argv[1:]))

and you want that script to output I am --help. To run it with Idae, use

idae script.py -- I am --help

Caveats

How it works

  1. Detect script file
  2. Detect appropriate Python executable
  3. Use venv to create a temporary virtual environment in the user cache directory using the executable detected
  4. Find PEP 723 pip requirements
  5. Install them into the virtual environment
  6. Run the script within the virtual environment

Run idae clean to remove all cached environments to free up space. Environments are cached per set of requirements.

Installation

You can get this project via pip

$ pip install idae

But we highly recommend you install this project using pipx

$ pipx install idae

Why the name

The scientific name for Pythons is "Pythonidae". I just removed the "Python" and we get "idae".

License

This project is licensed under the GNU GPL v3+.

In short, this means you can do anything with it (distribute, modify, sell) but if you were to publish your changes, you must make the source code and build instructions readily available.

If you are a company using this project and want an exception, email me at thatxliner@gmail.com and we can discuss.

Release files for idae 1.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 idae 1.1.0
File Size Uploaded
idae-1.1.0.tar.gz 20.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for idae 1.1.0
File Interpreter ABI Platform
idae-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 40.9 kB

Release files / idae-1.1.0.tar.gz

Download URL idae-1.1.0.tar.gz
Size 20.3 kB
Tags Source
SHA-256 checksum
How to use checksums
58ac9ae718aae5e1af95a3835e6be65730d72330bc7ff5899e28d750cf0803aa
BLAKE2b-256 checksum
How to use checksums
cfcc397d61ab94ad7fd081bde108dc212e706f8606c189781507725b17c77a8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / idae-1.1.0-py3-none-any.whl

Download URL idae-1.1.0-py3-none-any.whl
Size 20.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d4325b876dcae48277ccb978399d7716766ba1ad866a95b4b8b17a2df15a2838
BLAKE2b-256 checksum
How to use checksums
362bdcff748dd498a073d7d8212e34d15c37c6d5d92b60e35bbcd66b77fce844
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

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