# "Importing" all "exported" functionality

**URL:** <https://discourse.julialang.org/t/importing-all-exported-functionality/92303>\
**Category:** General Usage\
**Tags:** question, module\
**Created:** [December 30, 2022, 5:31am UTC](https://discourse.julialang.org/t/importing-all-exported-functionality/92303 "2022-12-30T05:31:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tictaccat](https://avatars.discourse-cdn.com/v4/letter/t/9f8e36/32.png) [@tictaccat](https://discourse.julialang.org/u/tictaccat)\
**Post date:** [December 30, 2022, 5:31am UTC](https://discourse.julialang.org/t/importing-all-exported-functionality/92303/1 "2022-12-30T05:31:55Z")

</div>

I would like to import a package without:

- having the package’s symbols enter the global namespace
- using any unexporrted functionality of the package

In other words, I would like to import package `A` and then use its functions as `A.func()` etc., but this should only work if `func` is exported by `A`. Currently, I can get all the exported symbols into the global namespace via `using`, I can get absolutely everything from `A` if I use `import` (which seems like too much, e.g. if `A` does `using B` internally I even get all of `B`’s exported functions here), or I can get a specific set of things from `A` using `import A: func, etc.` which means I have to manually specify what I want and can’t just use `A`’s exported symbols. Is there any way of doing what I want?

---

<div class="post-metadata">

**Author:** ![uniment](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/uniment/32/24532_2.png) [@uniment](https://discourse.julialang.org/u/uniment)\
**Post date:** [December 30, 2022, 6:29am UTC](https://discourse.julialang.org/t/importing-all-exported-functionality/92303/2 "2022-12-30T06:29:23Z")

</div>

Have you tried `include`?

---

<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:** [December 30, 2022, 10:23am UTC](https://discourse.julialang.org/t/importing-all-exported-functionality/92303/3 "2022-12-30T10:23:48Z")

</div>

You can wrap `using` inside a new module and it seems you can even use the same name. Example:

```julia
julia> module Inflate
           using Inflate
       end
Main.Inflate

julia> Inflate.InflateGzipStream
Inflate.InflateGzipStream

julia> Inflate.InflateData
ERROR: UndefVarError: InflateData not defined
Stacktrace:
 [1] getproperty(x::Module, f::Symbol)
   @ Base ./Base.jl:26
 [2] top-level scope
   @ REPL[3]:1

```

to be compared to

```julia
julia> import Inflate

julia> Inflate.InflateGzipStream
Inflate.InflateGzipStream

julia> Inflate.InflateData
Inflate.InflateData

```
