# Sharing Pluto NBs with Custom Modules

**URL:** <https://discourse.julialang.org/t/sharing-pluto-nbs-with-custom-modules/72962>\
**Category:** Pluto\
**Created:** [December 12, 2021, 2:21am UTC](https://discourse.julialang.org/t/sharing-pluto-nbs-with-custom-modules/72962 "2021-12-12T02:21:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![TI36XPro](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ti36xpro/32/33658_2.png) [@TI36XPro](https://discourse.julialang.org/u/TI36XPro)\
**Post date:** [December 12, 2021, 2:21am UTC](https://discourse.julialang.org/t/sharing-pluto-nbs-with-custom-modules/72962/1 "2021-12-12T02:21:37Z")

</div>

I am working with a group and have developed some of my own modules to facilitate the research we are doing. I used `pkg generate` to create the template for each module. Currently, I am able to access the contents on my local machine via `using MyCustomModule` because I manually added them to my environment using `Pkg.develop(path="MyJuliaPackages/MyCustomModule.jl")`

Is there a way to somehow add them to the Julia registry (or some other registry?) but make them private so that only someone that has been given access (not sure how that would work) can add them?

That way, Pluto could use its automatic package management (i.e. no `pkg.activate(".")` at the start of the Pluto NB) and I wouldn’t have to worry about whether they could run the files I sent them or not.

I hope that makes sense. Please let me know if I need to clarify anything.

---

<div class="post-metadata">

**Author:** ![sashmit](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sashmit/32/18791_2.png) [@sashmit](https://discourse.julialang.org/u/sashmit)\
**Post date:** [December 12, 2021, 2:54am UTC](https://discourse.julialang.org/t/sharing-pluto-nbs-with-custom-modules/72962/2 "2021-12-12T02:54:59Z")

</div>

Prehaps [https://github.com/GunnarFarneback/LocalRegistry.jl](https://github.com/GunnarFarneback/LocalRegistry.jl) helps?

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [December 12, 2021, 6:33am UTC](https://discourse.julialang.org/t/sharing-pluto-nbs-with-custom-modules/72962/3 "2021-12-12T06:33:52Z")

</div>

Yes, `LocalRegistry.jl` works very well, and once you’ve created a private registry there is even less friction to register there compared to `General`.  
Basically, the workflow is the following:

- Create private git repos for your Julia registry and for each package. Use github, gitlab, or any other git hosting.
- Initialize the registry with `LocalRegistry.create_registry()`
- Everyone with access to the git repo can now add this registry to their Julia, and use those packages.
- To register a new package or a new version, run `using LocalRegistry; register(registry="YourRegistryName")` in the environment of your to-be-registered package.

That’s it!

---

<div class="post-metadata">

**Author:** ![disberd](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@disberd](https://discourse.julialang.org/u/disberd)\
**Post date:** [December 12, 2021, 8:09am UTC](https://discourse.julialang.org/t/sharing-pluto-nbs-with-custom-modules/72962/4 "2021-12-12T08:09:10Z")

</div>

All of the above, plus if you only have one private registry you only need to do `register()` with your package activated to register it, which make it even more convenient!

---

<div class="post-metadata">

**Author:** ![liuyxpp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/liuyxpp/32/9870_2.png) [@liuyxpp](https://discourse.julialang.org/u/liuyxpp)\
**Post date:** [December 12, 2021, 11:09am UTC](https://discourse.julialang.org/t/sharing-pluto-nbs-with-custom-modules/72962/5 "2021-12-12T11:09:59Z")

</div>

Can LocalRegistry and GeneralRegeistry work together? i.e. Can I

```julia
test_env>add MyLocalPackage
test_env>add Plots

```

Sorry for the very naive question, but I cannot find the answer anywhere.

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [December 12, 2021, 3:06pm UTC](https://discourse.julialang.org/t/sharing-pluto-nbs-with-custom-modules/72962/6 "2021-12-12T15:06:54Z")

</div>

Sure, Julia uses all added registries to resolve packages. I think it asks the user if two packages share the same name, but never encountered this case.

---

<div class="post-metadata">

**Author:** ![liuyxpp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/liuyxpp/32/9870_2.png) [@liuyxpp](https://discourse.julialang.org/u/liuyxpp)\
**Post date:** [December 13, 2021, 1:28am UTC](https://discourse.julialang.org/t/sharing-pluto-nbs-with-custom-modules/72962/7 "2021-12-13T01:28:05Z")

</div>

That’s great! Now I am confident to give the LocalRegistry a try. I have a lot of private repos under development.
