# List of packages in a registry Julia 1.7+

**URL:** https://discourse.julialang.org/t/list-of-packages-in-a-registry-julia-1-7/77082
**Category:** General Usage
**Tags:** pkg, registry
**Created:** [February 25, 2022, 4:16pm UTC](https://discourse.julialang.org/t/list-of-packages-in-a-registry-julia-1-7/77082 "2022-02-25T16:16:45Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![thazhemadam](https://avatars.discourse-cdn.com/v4/letter/t/ad7895/32.png) [@thazhemadam](https://discourse.julialang.org/u/thazhemadam)
#### Post date: [February 25, 2022, 4:16pm UTC](https://discourse.julialang.org/t/list-of-packages-in-a-registry-julia-1-7/77082/1 "2022-02-25T16:16:45Z")

</div>

Previously, I could just run `TOML.parsefile("General/Registry.toml")["packages"]` to get the list of all the packages registered in the `General` registry.

However, with Julia 1.7, the `General` directory has been replaced with `General.tar.gz` and `General.toml`.  
How can I efficiently get the list of packages in the registry with a setup like this? Is there a function that `Pkg` implements (I’m assuming there is) that can help me out here?

---

<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: [February 25, 2022, 4:20pm UTC](https://discourse.julialang.org/t/list-of-packages-in-a-registry-julia-1-7/77082/2 "2022-02-25T16:20:42Z")

</div>

Can’t you still do that, after downloading [Registry.toml](https://github.com/JuliaRegistries/General/blob/master/Registry.toml)?

---

<div class="post-metadata">

### Author: ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)
#### Post date: [February 25, 2022, 4:20pm UTC](https://discourse.julialang.org/t/list-of-packages-in-a-registry-julia-1-7/77082/3 "2022-02-25T16:20:55Z")

</div>

```julia
Pkg.Types.Context().registries

```

has all the available registries loaded in-memory. Note: this is an internal functionality, so may break in the future

---

<div class="post-metadata">

### Author: ![thazhemadam](https://avatars.discourse-cdn.com/v4/letter/t/ad7895/32.png) [@thazhemadam](https://discourse.julialang.org/u/thazhemadam)
#### Post date: [February 25, 2022, 6:44pm UTC](https://discourse.julialang.org/t/list-of-packages-in-a-registry-julia-1-7/77082/4 "2022-02-25T18:44:18Z")

</div>

You could, but my question is in the context of registries that already exist locally.  
When you do `] registry add General`, with Julia 1.7+ and get the `General.toml` and `General.tar.gz` — my question is, how can I extract the list of packages from _that_ (without having to source a `Registry.toml` elsewhere)? For instance, how does `Pkg` do it?

---

<div class="post-metadata">

### Author: ![thazhemadam](https://avatars.discourse-cdn.com/v4/letter/t/ad7895/32.png) [@thazhemadam](https://discourse.julialang.org/u/thazhemadam)
#### Post date: [February 25, 2022, 6:46pm UTC](https://discourse.julialang.org/t/list-of-packages-in-a-registry-julia-1-7/77082/5 "2022-02-25T18:46:32Z")

</div>

This lists the registries I have loaded in memory, but not the packages registered in a particular registry, which is what I’m interested in extracting. 🙂

---

<div class="post-metadata">

### Author: ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)
#### Post date: [February 25, 2022, 6:54pm UTC](https://discourse.julialang.org/t/list-of-packages-in-a-registry-julia-1-7/77082/6 "2022-02-25T18:54:57Z")

</div>

The registry contains the packages, by definition of registry 🙂

Assuming the registry you’re interested in is the first one, `Pkg.Types.Context().registries[1].pkgs` is the list of packages in that registry

---

<div class="post-metadata">

### Author: ![thazhemadam](https://avatars.discourse-cdn.com/v4/letter/t/ad7895/32.png) [@thazhemadam](https://discourse.julialang.org/u/thazhemadam)
#### Post date: [February 25, 2022, 6:58pm UTC](https://discourse.julialang.org/t/list-of-packages-in-a-registry-julia-1-7/77082/7 "2022-02-25T18:58:00Z")

</div>

Ah, yes. I was just unsure if there was some other “formal” API that `Pkg` uses.  
Anyways, this is what I was looking for, thanks! 😄

---

<div class="post-metadata">

### Author: ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)
#### Post date: [February 25, 2022, 10:22pm UTC](https://discourse.julialang.org/t/list-of-packages-in-a-registry-julia-1-7/77082/8 "2022-02-25T22:22:25Z")

</div>

You can get the same information with `Pkg.Registry.reachable_registries()[1].pkgs`, which is also relying on Pkg internals.
