# Need help making my first Julia package

**URL:** <https://discourse.julialang.org/t/need-help-making-my-first-julia-package/16138>\
**Category:** General Usage\
**Tags:** package, first-steps\
**Created:** [October 10, 2018, 9:59pm UTC](https://discourse.julialang.org/t/need-help-making-my-first-julia-package/16138 "2018-10-10T21:59:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielc/32/220_2.png) [@danielc](https://discourse.julialang.org/u/danielc)\
**Post date:** [October 10, 2018, 9:59pm UTC](https://discourse.julialang.org/t/need-help-making-my-first-julia-package/16138/1 "2018-10-10T21:59:45Z")

</div>

Hello,

I am writing a Julia package that I want to make publicly available on GitHub. I am been following the instructions on this website:

[https://docs.julialang.org/en/v1/stdlib/Pkg/](https://docs.julialang.org/en/v1/stdlib/Pkg/)

I am mostly done. I used `pkg> add ...` to indicate the package dependencies, as indicated on the web page, and that generated appropriate `Manifest.toml` and `Project.toml` files. I created the functions that I want to put in the package, and I’ve added unit tests. But I’m struggling with the next few steps:

1. How do I probe the PATH to the package install directory? My package comes with a data file that I need to read to make the package work.

2. If I just put the package directory on GitHub, how would people install it? I’d like to add a `README.md` file with basic installation instructions.

3. Following up on the previous question, how do I register the package so that people can type `Pkg.add("Planets")` and have that work?

4. I don’t have a `REQUIRE` file. Is that no longer needed for Julia 0.7 and later? Has it been fully replaced by `Manifest.toml` and `Project.toml`?

5. Julia packages on GitHub usually end in `.jl`. Is that a requirement or just a popular convention? What happens if I don’t do that? I ask because I think I might want to leave the door open to using the same repository for a Python package.

Thanks for the help.

---

<div class="post-metadata">

**Author:** ![dfdx](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dfdx/32/120_2.png) [@dfdx](https://discourse.julialang.org/u/dfdx)\
**Post date:** [October 10, 2018, 10:32pm UTC](https://discourse.julialang.org/t/need-help-making-my-first-julia-package/16138/2 "2018-10-10T22:32:51Z")

</div>

1. In any file `@ __DIR__ ` returns a directory containing that file, you can calculate path to your data relative to this dir.

2. With Pkg3 users can install packages directly from repository using `]add http://github.com/your_username/Repo.jl`.

1. Since the repo can also be used as a Julia package, I’d still split Julia and Python code (you may want to reference one from another e.g. to download data files).

---

<div class="post-metadata">

**Author:** ![danielc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielc/32/220_2.png) [@danielc](https://discourse.julialang.org/u/danielc)\
**Post date:** [October 10, 2018, 10:54pm UTC](https://discourse.julialang.org/t/need-help-making-my-first-julia-package/16138/3 "2018-10-10T22:54:48Z")

</div>

Thanks!

---

<div class="post-metadata">

**Author:** ![brilhana](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/brilhana/32/2112_2.png) [@brilhana](https://discourse.julialang.org/u/brilhana)\
**Post date:** [October 10, 2018, 11:07pm UTC](https://discourse.julialang.org/t/need-help-making-my-first-julia-package/16138/4 "2018-10-10T23:07:34Z")

</div>

1. From my understanding `REQUIRE` is not required anymore if your package only supports v0.7 and up but if you want to register your package with `METADATA.jl` you will need it.

---

<div class="post-metadata">

**Author:** ![danielc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielc/32/220_2.png) [@danielc](https://discourse.julialang.org/u/danielc)\
**Post date:** [October 10, 2018, 11:12pm UTC](https://discourse.julialang.org/t/need-help-making-my-first-julia-package/16138/5 "2018-10-10T23:12:37Z")

</div>

Thanks. What is `METADATA.jl`? Do I need that?

---

<div class="post-metadata">

**Author:** ![brilhana](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/brilhana/32/2112_2.png) [@brilhana](https://discourse.julialang.org/u/brilhana)\
**Post date:** [October 10, 2018, 11:25pm UTC](https://discourse.julialang.org/t/need-help-making-my-first-julia-package/16138/6 "2018-10-10T23:25:15Z")

</div>

You don’t need it unless you want to publish your package, i.e. users would install it by `] add PackageName` instead of `] add http://github.com/your_username/PackageName.jl.`

Details: [Finalizing Your Julia Package: Documentation, Testing, Coverage, and Publishing - Stochastic Lifestyle](http://www.stochasticlifestyle.com/finalizing-julia-package-documentation-testing-coverage-publishing/)
