# In Praise of PEP 723

**URL:** <https://discuss.python.org/t/in-praise-of-pep-723/84039>\
**Category:** User Feedback\
**Created:** [March 11, 2025, 12:27pm UTC](https://discuss.python.org/t/in-praise-of-pep-723/84039 "2025-03-11T12:27:38Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssweber](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/ssweber/32/9684_2.png) [@ssweber](https://discuss.python.org/u/ssweber)\
**Post date:** [March 11, 2025, 12:27pm UTC](https://discuss.python.org/t/in-praise-of-pep-723/84039/1 "2025-03-11T12:27:38Z")

</div>

tldr: PEP 723 – Inline script metadata is a huge success. [uv’s implementation of it](https://docs.astral.sh/uv/guides/scripts/), and `exclude-newer` tool extension is the cherry on-top. Everyone should give themselves a pat on the back!

@pf_moore @ofek @brettcannon @charliermarsh and many more 🙂

Yesterday we had a script that was having problems. Went to debug, and of course I hadn’t written down the dependencies and never did have an environment for it. Before 723 this would be a chore. But now, this is easy!

```python
# /// script
# requires-python = "==3.10"
# dependencies = [
# "gooey",
# "openpyxl",
# "pandas",
# "requests",
# "XlsxWriter",
# ]
# [tool.uv]
# exclude-newer = "2023-01-10T00:00:00Z"
# ///

```

`uv run myscript.py`

So easy! And I’m not the only one. I frequent hackernews, and in years past the `mood` on python dependencies was so-so. [In this recent thread](https://news.ycombinator.com/item?id=43095157), I was really happy to see these kind of comments:

> With the advent of uv, I’m finally feeling like Python packaging is solved. As mentioned in the article, being able to have inline dependencies in a single-file Python script and running it naturally is just beautiful.

> this (inline dependencies + uv’s exclude-newer) has also let me easily reconstruct some older environments in less than a minute, when I’ve been version hunting for 30-60 minutes in the past

> I find this feature amazing for one-off scripts. It’s removing a cognitive burden I was unconsciously ignoring.

That’s all I came to say. Thank you!

---

<div class="post-metadata">

**Author:** ![pf\_moore](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/pf_moore/32/35_2.png) [@pf\_moore](https://discuss.python.org/u/pf_moore)\
**Post date:** [March 11, 2025, 12:41pm UTC](https://discuss.python.org/t/in-praise-of-pep-723/84039/2 "2025-03-11T12:41:22Z")

</div>

Thanks for the kind words.

It’s worth mentioning that pipx and pip-run also implement PEP 723, but I agree that `uv` is the tool that seems to have brought it to people’s attention.

---

<div class="post-metadata">

**Author:** ![Monarch](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/monarch/32/18530_2.png) [@Monarch](https://discuss.python.org/u/Monarch)\
**Post date:** [March 11, 2025, 2:37pm UTC](https://discuss.python.org/t/in-praise-of-pep-723/84039/3 "2025-03-11T14:37:24Z")

</div>

As another very happy user of PEP 723, I want to share the sentiment. A massive thank you to everyone who made it possible. I used to try very hard to stick to standard library for standalone scripts but that worry is now a thing of the past!

---

<div class="post-metadata">

**Author:** ![h-vetinari](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/h-vetinari/32/1220_2.png) [@h-vetinari](https://discuss.python.org/u/h-vetinari)\
**Post date:** [March 11, 2025, 11:06pm UTC](https://discuss.python.org/t/in-praise-of-pep-723/84039/4 "2025-03-11T23:06:57Z")

</div>

> [@ssweber](#):
>
> ```python
> # [tool.uv]
> # exclude-newer = "2023-01-10T00:00:00Z"
> 
> ```

This is the kind of innovative and obviously useful extension that I pictured when I argued that we should stick to the successful patterns of `pyproject.toml`, rather than invent yet another one. I’m glad it’s paying off. 🙃

---

<div class="post-metadata">

**Author:** ![bryanweber](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/bryanweber/32/6914_2.png) [@bryanweber](https://discuss.python.org/u/bryanweber)\
**Post date:** [March 12, 2025, 2:06am UTC](https://discuss.python.org/t/in-praise-of-pep-723/84039/5 "2025-03-12T02:06:56Z")

</div>

I also want to pile on the praise. Thank you to everyone involved! The combination of uv that will install Python, PEP 723 to specify dependencies, and mise-en-place to install uv means I can put a Python script in a golang project and have my teammates actually use it ☺

---

<div class="post-metadata">

**Author:** ![rtpg](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/rtpg/32/14068_2.png) [@rtpg](https://discuss.python.org/u/rtpg)\
**Post date:** [March 15, 2025, 8:11am UTC](https://discuss.python.org/t/in-praise-of-pep-723/84039/6 "2025-03-15T08:11:10Z")

</div>

> [@pf\_moore](#):
>
> It’s worth mentioning that pipx and pip-run also implement PEP 723, but I agree that `uv` is the tool that seems to have brought it to people’s attention.

Kinda interesting, searching for `pipx 723` on DDG or Google only got me results for an issue with someone talking about _removing support_ for 723 until it was accepted.

I keep on forgetting what 723 is even called. Properly searching for “inline script metadata” got me to [this github issue](https://github.com/pypa/pipx/issues/1594) where people are saying “we need to document it more”.

Anyways, I guess it’s probably worth saying “inline script metadata” out loud a lot to help the computers put everything together?

* * *

Anyways, this is yet another “723 has made me very happy” post. Being able to post minimal reproductions as single files makes it a lot easier to share concerns with certain things.

---

<div class="post-metadata">

**Author:** ![hugovk](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/hugovk/32/14505_2.png) [@hugovk](https://discuss.python.org/u/hugovk)\
**Post date:** [March 15, 2025, 9:24am UTC](https://discuss.python.org/t/in-praise-of-pep-723/84039/7 "2025-03-15T09:24:27Z")

</div>

> [@pf\_moore](#):
>
> It’s worth mentioning that pipx and pip-run also implement PEP 723

And [Hatch](https://hatch.pypa.io/1.13/blog/2024/05/02/hatch-v1100/#python-script-runner) and [PDM](https://pdm-project.org/en/stable/dev/changelog/#release-v2160-2024-06-25).

Thanks also from me to everyone who worked on it, it’s incredibly useful.

---

<div class="post-metadata">

**Author:** ![potiuk](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/potiuk/32/5287_2.png) [@potiuk](https://discuss.python.org/u/potiuk)\
**Post date:** [March 16, 2025, 7:45am UTC](https://discuss.python.org/t/in-praise-of-pep-723/84039/8 "2025-03-16T07:45:44Z")

</div>

I agree, it’s **really** useful, and the most important part is the adoption among the packaging tools.

For years I have always fallen back - when writing some small reusable scripts - to bash and the main reason was “very soon, what is in the standard library wil not be enough and I will have to add some dependency, so how to make it easy to run by others?” And then I usually got into a trap that I was the only one who could understand what those bash scripts were doing.

That was one of the reason when I converted the development environment for Airlfow (we call it breeze as “it’s a breeze to develop airflow”) from bash years ago, when it became really unmaintainable - we had to first create an internal editable project and install it locally and that added quite a lot of friction that we had to solve (though pipx and uv tool made it very usable)

But with PEP-732 Not any more for those smaller scripts - you can have a bunch of independent, small scripts that **just work** , want coloured output, add rich as inline dependency. Want to parse yaml file - add pyyaml and so on. And with `uv` automated python installation, and no need to have Python and venv managed by the users who **just** run the script, it’s short of magical experience.
