# Exploring package contents

**URL:** <https://discourse.julialang.org/t/exploring-package-contents/48937>\
**Category:** New to Julia\
**Created:** [October 24, 2020, 2:38pm UTC](https://discourse.julialang.org/t/exploring-package-contents/48937 "2020-10-24T14:38:33Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gert-Jan\_van\_der\_Kam](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gert-jan_van_der_kam/32/18333_2.png) [@Gert-Jan\_van\_der\_Kam](https://discourse.julialang.org/u/Gert-Jan_van_der_Kam)\
**Post date:** [October 24, 2020, 2:38pm UTC](https://discourse.julialang.org/t/exploring-package-contents/48937/1 "2020-10-24T14:38:33Z")

</div>

Hi I’m getting into Julia and I don’t yet understamd how I can find out what I can type.

For instance I want to read CSV, so I add the CSV package, but then how do I know how to use it? In C# I would either open a NuGet package in the Object Browser to see what classes etc are in there, or I could use intellisense to type the namespace and dot through the namespaces and classes in there. That way I can pretty quickly figure out how to use something.

How am I supposed to do this in Julia? Right now I rely on either the help, a tutorial or I browse the source, but isn’t there a way for Julia to just show all the things that are contained in the package/ module? I feel I’m missing something obvious here.

For instance te CSV package does not have any help defined and intellisense brings up a lot of things but the actual stuff I can use seems mixed up with all sorts of unrelated things.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/8/0/800d9a01f4fefced8e044cbd6d2dace9d37a7c98.png)

---

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [October 24, 2020, 2:41pm UTC](https://discourse.julialang.org/t/exploring-package-contents/48937/2 "2020-10-24T14:41:42Z")

</div>

Reading the documentation of CSV will probably be helpful, if there is documentation. Reading the documentation does not take many minutes and is usually worth the effort.

---

<div class="post-metadata">

**Author:** ![Gert-Jan\_van\_der\_Kam](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gert-jan_van_der_kam/32/18333_2.png) [@Gert-Jan\_van\_der\_Kam](https://discourse.julialang.org/u/Gert-Jan_van_der_Kam)\
**Post date:** [October 24, 2020, 2:50pm UTC](https://discourse.julialang.org/t/exploring-package-contents/48937/4 "2020-10-24T14:50:38Z")

</div>

Obviously, and the CSV package has good docs, but still this makes me rely on the effort (and time) of someone else to describe the functionality. Isn;t there a command like contents(CSV) that lists the methods etc that are defined in a package/ module?

---

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [October 24, 2020, 3:02pm UTC](https://discourse.julialang.org/t/exploring-package-contents/48937/5 "2020-10-24T15:02:41Z")

</div>

I do wish it were more common that `?CSV` would return a brief API summary. For example:

```julia
help?> Images
search: Images nimages ImageDistances ImageAxes ImageTransformations ImageContrastAdjustment ImageQualityIndexes ImageMeta ImageCore ImageMetadata ImageFiltering ImageMorphology integral_image

  Constructors, conversions, and traits:

  - Construction: use constructors of specialized packages, e.g., `AxisArray`, `ImageMeta`, etc.
  - "Conversion": `colorview`, `channelview`, `rawview`, `normedview`, `permuteddimsview`
  - Traits: `pixelspacing`, `sdims`, `timeaxis`, `timedim`, `spacedirections`

  Contrast/coloration:

  - `clamp01`, `clamp01nan`, `scaleminmax`, `colorsigned`, `scalesigned`

  Algorithms:

  - Reductions: `maxfinite`, `maxabsfinite`, `minfinite`, `meanfinite`, `integral_image`, `boxdiff`, `gaussian_pyramid`
  - Resizing: `restrict`, `imresize` (not yet exported)
  - Filtering: `imfilter`, `imfilter!`, `mapwindow`, `imROF`, `padarray`
  - Filtering kernels: `Kernel.` or `KernelFactors.`, followed by `ando[345]`, `guassian2d`, `imaverage`, `imdog`, `imlaplacian`, `prewitt`, `sobel`
  - Exposure : `imhist`, `histeq`, `adjust_gamma`, `histmatch`, `imadjustintensity`, `imstretch`, `imcomplement`, `clahe`, `cliphist`
  - Gradients: `backdiffx`, `backdiffy`, `forwarddiffx`, `forwarddiffy`, `imgradients`
  - Edge detection: `imedge`, `imgradients`, `thin_edges`, `magnitude`, `phase`, `magnitudephase`, `orientation`, `canny`
  - Corner detection: `imcorner`,`imcorner_subpixel`, `harris`, `shi_tomasi`, `kitchen_rosenfeld`, `meancovs`, `gammacovs`, `fastcorners`
  - Blob detection: `blob_LoG`, `findlocalmaxima`, `findlocalminima`
  - Morphological operations: `dilate`, `erode`, `closing`, `opening`, `tophat`, `bothat`, `morphogradient`, `morpholaplace`, `feature_transform`, `distance_transform`, `convexhull`
  - Connected components: `label_components`, `component_boxes`, `component_lengths`, `component_indices`, `component_subscripts`, `component_centroids`
  - Interpolation: `bilinear_interpolation`

  Test images and phantoms (see also TestImages.jl):

  - `shepp_logan`

```

But there isn’t a good way of keeping these in sync, so it requires that one do this manually.

You can use `using Example; names(Example)` to determine the exported names, but for packages like CSV that expect module-scoping you need `names(CVS; all=true)`.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [October 24, 2020, 3:11pm UTC](https://discourse.julialang.org/t/exploring-package-contents/48937/6 "2020-10-24T15:11:20Z")

</div>

> [@tim.holy](#):
>
> But there isn’t a good way of keeping these in sync, so it requires that one do this manually.

At least one can avoid repetition by including this in the docs, eg as done in

[https://tkf.github.io/ThreadsX.jl/dev/](https://tkf.github.io/ThreadsX.jl/dev/)

---

<div class="post-metadata">

**Author:** ![Gert-Jan\_van\_der\_Kam](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gert-jan_van_der_kam/32/18333_2.png) [@Gert-Jan\_van\_der\_Kam](https://discourse.julialang.org/u/Gert-Jan_van_der_Kam)\
**Post date:** [October 24, 2020, 3:12pm UTC](https://discourse.julialang.org/t/exploring-package-contents/48937/7 "2020-10-24T15:12:32Z")

</div>

Ok

`show(names(CSV, all=true))`

helped already indeed. At some point you can see where the methods start. But still it should possible for Julia with the introspection features to neatly display the contents of somehtig right, this just hasn;t been written yet?

---

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [October 24, 2020, 3:15pm UTC](https://discourse.julialang.org/t/exploring-package-contents/48937/8 "2020-10-24T15:15:32Z")

</div>

It’s not hard to write, but distinguishing methods intended to be called by users from internal methods is not straightforward. For example,

```julia
julia> using MethodAnalysis

julia> mths = Method[]

julia> visit(Images) do item
           isa(item, Method) && (push!(mths, item); return false)
           return true
       end

```

yields 4664 methods in `mths`. Most of these are not interesting from the standpoint of users.

---

<div class="post-metadata">

**Author:** ![Gert-Jan\_van\_der\_Kam](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gert-jan_van_der_kam/32/18333_2.png) [@Gert-Jan\_van\_der\_Kam](https://discourse.julialang.org/u/Gert-Jan_van_der_Kam)\
**Post date:** [October 24, 2020, 3:18pm UTC](https://discourse.julialang.org/t/exploring-package-contents/48937/9 "2020-10-24T15:18:41Z")

</div>

Can I see which names are explicitely exported?

---

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [October 24, 2020, 3:23pm UTC](https://discourse.julialang.org/t/exploring-package-contents/48937/10 "2020-10-24T15:23:04Z")

</div>

Just leave out the `all=true` from `names`.

But CSV deliberately doesn’t export its API. This is pretty common when the name used is very generic. We use `ForwardDiff.gradient` without exporting `gradient` (because lots of packages implement methods called `gradient`), `Revise.track(stdlib)` because `track` is far too generic on its own, etc.

---

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [October 24, 2020, 3:35pm UTC](https://discourse.julialang.org/t/exploring-package-contents/48937/11 "2020-10-24T15:35:08Z")

</div>

Ah, I myself keep forgetting about the most useful one:

```julia
julia> apropos(CSV)
DelimitedFiles
DelimitedFiles.DelimitedFiles
SharedArrays.SharedArray
Tables.LazyTable
Tables.partitioner
Base.show
CSV
CSV.detect
CSV.RowWriter
CSV.File
CSV.write
CSV.PooledString
CSV.Rows
CSV.read
CSV.Chunks
FileIO.DataFormat

```

This at least shows you all the things that have “CSV” in their documentation.
