How to import libname instead of libname.module

Hi,

My title is not that great.
I have a very simple lib to develop (libname), with only one module. (core) with one function (func1)

I would like to use my library like that:

import libname
libname.func1()

In standard python I would add in __init__.py something like

from libname.core import (
    func1,
)

But what would be the proper way to do it with nbdev?

I am sorry my question is maybe not that clear.

1 Like

It’s clear, and I was wondering myself recently.

iirc you have to do the __init__.py yourself in nbdev, it can’t be automated for this purpose

In that case can I suggest an enhancement request “default module” to nbdev team?

It could be to

  • add an option in settings.ini (e.g. default_module)
  • when set, will list all artefacts from this module in __init__.py

I guess this is a low priority. Would love to develop it with some guidance and push a merge request to nbdev team.