# Load subfolder in src like in python

**URL:** <https://discourse.julialang.org/t/load-subfolder-in-src-like-in-python/131609>\
**Category:** New to Julia\
**Tags:** package, code-organization\
**Created:** [August 14, 2025, 4:29pm UTC](https://discourse.julialang.org/t/load-subfolder-in-src-like-in-python/131609 "2025-08-14T16:29:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cyan](https://avatars.discourse-cdn.com/v4/letter/c/278dde/32.png) [@Cyan](https://discourse.julialang.org/u/Cyan)\
**Post date:** [August 14, 2025, 4:29pm UTC](https://discourse.julialang.org/t/load-subfolder-in-src-like-in-python/131609/1 "2025-08-14T16:29:44Z")

</div>

Hi, all. I am wondering how I can load a folder as a submodule in Julia, similar to how it is done in Python.  
For example, I want to load the modules in `SubModuleA` in the form of `MyPackage.SubModuleA.file_a_1` and `MyPackage.SubModuleA.file_a_2` in the following directory.

```julia-auto
MyPackage/
├── Project.toml
├── src/
│ ├── MyPackage.jl
│ ├── SubModuleA/
│ │ └── file_a_1.jl
| | └── file_a_2.jl
│ └── SubModuleB/
│ └── file_b.jl
└── test/
    └── runtests.jl

```

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [August 14, 2025, 5:20pm UTC](https://discourse.julialang.org/t/load-subfolder-in-src-like-in-python/131609/2 "2025-08-14T17:20:53Z")

</div>

Natively, Julia is different from Python. Julia’s modules are completely independent from any particular filesystem layout of files. You explicitly name them in the source code with `module SubModuleA #= ... =# end`, and can arrange files as you like by `include`ing them.

Folks have opinions about this — and strong ones at that. There’ve been many discussions about this and some folks have implemented their own preferred semantics in packages. See Julia#4600 and the topics tagged as “related” below for more.

Edit: here’s a fairly targeted search for more related topics: [Search results for 'fromfile.jl order:latest' - Julia Programming Language](https://discourse.julialang.org/search?q=fromfile.jl%20order%3Alatest)

---

<div class="post-metadata">

**Author:** ![Cyan](https://avatars.discourse-cdn.com/v4/letter/c/278dde/32.png) [@Cyan](https://discourse.julialang.org/u/Cyan)\
**Post date:** [August 14, 2025, 5:26pm UTC](https://discourse.julialang.org/t/load-subfolder-in-src-like-in-python/131609/3 "2025-08-14T17:26:19Z")

</div>

Thanks. I partially solved this problem via create a `SubModuleA.jl` file which includes all modules in folder `SubModule_A`. It might be an easy way to achieve the goals.

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [August 14, 2025, 5:28pm UTC](https://discourse.julialang.org/t/load-subfolder-in-src-like-in-python/131609/4 "2025-08-14T17:28:24Z")

</div>

This probably deserves a FAQ in the docs. Perhaps in the “migrating from Python” section:

> **[Noteworthy Differences from other Languages · The Julia Language](https://docs.julialang.org/en/v1/manual/noteworthy-differences/#Noteworthy-differences-from-Python)**
>
> Documentation for The Julia Language.

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [August 14, 2025, 5:33pm UTC](https://discourse.julialang.org/t/load-subfolder-in-src-like-in-python/131609/5 "2025-08-14T17:33:42Z")

</div>

Someone asked a similar question yesterday:

> [@How to divide a project into files and submodules?](https://discourse.julialang.org/t/how-to-divide-a-project-into-files-and-submodules/131593):
>
> Thanks, this seems like probably a little more of an elegant solution. If working on a large project, is the best solution here to create a module with defined structs then include them in other appropriate modules?

And the answer pointed to another long thread:

> [@Best practise: organising code in Julia](https://discourse.julialang.org/t/best-practise-organising-code-in-julia/74362):
>
> Hi A newbie here, from OOP background. I am looking to put together a project which will: Download data from Internet Do some manipulations on the downloaded data Do some analysis on the downloaded data Please note the downloader, analysis would be reused across other projects as well. I have been reading up Julia docs and looking at how other Julia projects have been implemented. In Java, I would have organised these into separate packages and class files. Options: Create Modules: Juli…
