# Equivalent of Python's Inline script metadata (PEP 723) in Julia

**URL:** <https://discourse.julialang.org/t/equivalent-of-pythons-inline-script-metadata-pep-723-in-julia/127980>\
**Category:** Package Management\
**Tags:** question\
**Created:** [April 11, 2025, 2:10pm UTC](https://discourse.julialang.org/t/equivalent-of-pythons-inline-script-metadata-pep-723-in-julia/127980 "2025-04-11T14:10:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![j-bowhay](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/j-bowhay/32/216272_2.png) [@j-bowhay](https://discourse.julialang.org/u/j-bowhay)\
**Post date:** [April 11, 2025, 2:10pm UTC](https://discourse.julialang.org/t/equivalent-of-pythons-inline-script-metadata-pep-723-in-julia/127980/1 "2025-04-11T14:10:20Z")

</div>

Hi all,

I am interested to know if there is a Julia equivalent to the following in Python. Imagine you have a collection of scripts each with their own dependencies. In each script it is possible to declare metadata about the script:

```julia
# /// script
# 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])

```

I can then run `uv run example.py` which spin up a temporary environment to run the script. Is there a way to do something similar in Julia?  
Thanks!

---

<div class="post-metadata">

**Author:** ![goerz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goerz/32/3269_2.png) [@goerz](https://discourse.julialang.org/u/goerz)\
**Post date:** [April 11, 2025, 2:23pm UTC](https://discourse.julialang.org/t/equivalent-of-pythons-inline-script-metadata-pep-723-in-julia/127980/2 "2025-04-11T14:23:00Z")

</div>

Yes, you can just add `Pkg` commands at the top of your script:

```julia
using Pkg
Pkg.activate(temp=true) # maybe point this to a more permanent project location
Pkg.add("Requests") # these are not Julia packages ...
Pkg.add("Rich") # ... but you get the point.

```

See the [documentation of `Pkg.add`](https://pkgdocs.julialang.org/v1/api/#Pkg.add) for how to pin specific versions and other details.

---

<div class="post-metadata">

**Author:** ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Post date:** [April 11, 2025, 8:13pm UTC](https://discourse.julialang.org/t/equivalent-of-pythons-inline-script-metadata-pep-723-in-julia/127980/3 "2025-04-11T20:13:22Z")

</div>

The point to remember is that this in Julia is implemented using _packages_ rather than _scripts_.  
You can specify which packages version ranges work for yr project and exactly which versions (recursively) you are actually using…

---

<div class="post-metadata">

**Author:** ![mrufsvold](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mrufsvold/32/31600_2.png) [@mrufsvold](https://discourse.julialang.org/u/mrufsvold)\
**Post date:** [April 12, 2025, 12:17pm UTC](https://discourse.julialang.org/t/equivalent-of-pythons-inline-script-metadata-pep-723-in-julia/127980/4 "2025-04-12T12:17:35Z")

</div>

Pluto.jl would like to have a word with you 😉

@j-bowhay Pluto provides this kind of functionality!

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [April 13, 2025, 3:39pm UTC](https://discourse.julialang.org/t/equivalent-of-pythons-inline-script-metadata-pep-723-in-julia/127980/5 "2025-04-13T15:39:49Z")

</div>

I do think it would be a nice feature to be able to include a manifest into a Julia script so that it’s self-contained. We haven’t designed or implemented that, however. As mentioned, Pluto has this functionality.
