Package Aliases?

It’s not uncommon that I use two packages that export functions with the same name so I’m wondering if we can define an alias for a package as you can do in other languages (e.g. import numpy as np).

For example, today I am working with some code that makes use of exactly two packages, EmpiricalCDFs and Queryverse, both of which export a save function. It would be nice to be able to add an alias so that I can just do qv.save() or ecdf.save().

Is this possible? If not, how do others work around this (other than typing out the full package name)?

You can use

import Queryverse
const qv = Queryverse
3 Likes

The save function exported by queryverse is actually FileIO.save :slight_smile: Doesn’t help you here, but for all the packages that integrate with FileIO there shouldn’t be a conflict.

1 Like

https://github.com/fredrikekre/ImportMacros.jl (disclaimer: my package.)

6 Likes

Nice!