patch_name
def patch_name(
o
):If o is decorated with patch or patch_to, return its class-prefix name
If o is decorated with patch or patch_to, return its class-prefix name
def nbglob(
path:NoneType=None, # path to start searching
skip_folder_re:str='^[_.]', # Skip folders matching regex,
file_glob:str='*.ipynb', # Only include files matching glob
skip_file_re:str='^[_.]', # Skip files matching regex
key:str='nbs_path', as_path:bool=False, recursive:bool=True, # search subfolders
maxdepth:int=None, # max depth to descend (1=just immediate contents; None=unlimited)
symlinks:bool=True, # follow symlinks?
file_re:str=None, # Only include files matching regex
folder_re:str=None, # Only enter folders matching regex
skip_file_glob:str=None, # Skip files matching glob
func:callable=walk_join, # function to apply to each matched file
ret_folders:bool=False, # return folders, not just files
sort:bool=True, # sort files by name within each folder
types:str | list=None, # list or comma-separated str of ext types from: py, js, java, c, cpp, rb, r, ex, sh, web, doc, cfg
exts:str | list=None, # list or comma-separated str of exts to include
): # Paths to matched filesFind all files in a directory matching an extension given a config key.
def nbglob_cli(
path:str=None, # Path to notebooks
symlinks:bool=False, # Follow symlinks?
file_glob:str='*.ipynb', # Only include files matching glob
file_re:str=None, # Only include files matching regex
folder_re:str=None, # Only enter folders matching regex
skip_file_glob:str=None, # Skip files matching glob
skip_file_re:str='^[_.]', # Skip files matching regex
skip_folder_re:str='^[_.]', # Skip folders matching regex
):Find all files in a directory matching an extension given a config key.
def nbdev_export(
path:str=None, # Path or filename
procs:str='', # Space-separated `module:name` processors to use (or set `export_procs` in pyproject.toml)
symlinks:bool=False, # Follow symlinks?
file_glob:str='*.ipynb', # Only include files matching glob
file_re:str=None, # Only include files matching regex
folder_re:str=None, # Only enter folders matching regex
skip_file_glob:str=None, # Skip files matching glob
skip_file_re:str='^[_.]', # Skip files matching regex
skip_folder_re:str='^[_.]', # Skip folders matching regex
):Export notebooks in path to Python modules
Create a documentation index from a sphinx inventory file at url, with optional prefix pre
RemovedInSphinx10Warning: The tuple interface for _InventoryItem objects is deprecated. Please access the `project_name`, `project_version`, `uri`, and `displayname` attributes directly.
_get = lambda o: {k:v[2] for k,v in idx[f'py:{o}'].items() if k[0]!='_'}
{'builtins.bool': 'https://docs.python.org/3/library/functions.html#bool',
'builtins.bytearray': 'https://docs.python.org/3/library/stdtypes.html#bytearray',
'builtins.bytes': 'https://docs.python.org/3/library/stdtypes.html#bytes',
'builtins.complex': 'https://docs.python.org/3/library/functions.html#complex',
'builtins.dict': 'https://docs.python.org/3/library/stdtypes.html#dict',
'builtins.float': 'https://docs.python.org/3/library/functions.html#float',
'builtins.frozenset': 'https://docs.python.org/3/library/stdtypes.html#frozenset',
'builtins.int': 'https://docs.python.org/3/library/functions.html#int',
'builtins.list': 'https://docs.python.org/3/library/stdtypes.html#list',
'builtins.memoryview': 'https://docs.python.org/3/library/stdtypes.html#memoryview'}
Mapping from symbol names to docs and source URLs
Indexing returns a link to the symbol’s docs, along with the name of the source file the source URL if available.
('https://nbdev.fast.ai/api/doclinks.html#nbdevlookup',
'nbdev/doclinks.py',
'https://github.com/AnswerDotAI/nbdev/blob/main/nbdev/doclinks.py')
Symbol names are taken from libraries registered using the ‘nbdev’ entry point. By default, all libraries with this entry point are searched, but full symbol names (including module prefix) are required.
Pass strip_libs to list libraries which should be available without requiring a module prefix.
This is a link to [`numpy.array`](https://numpy.org/doc/stable/reference/generated/numpy.array.html#numpy.array) and to `array()` and to [`get_config()`](https://nbdev.fast.ai/api/config.html#get_config) but not a link to `foobar`.
And not a link to <code>dict2nb</code>.
This is not a link to `get_config`
```
This isn't a link to `get_config` either
```
'[`builtins.str.split`](https://docs.python.org/3/library/stdtypes.html#str.split)'
'[`str.split`](https://docs.python.org/3/library/stdtypes.html#str.split) and [`str`](https://docs.python.org/3/library/stdtypes.html#str)'
When there is a conflict, the linkification will apply in the order of the stripped libraries and then by alphabetical order. For example, enumerate is both a builtin and a function in the threading module. However, since builtins comes first alphabetically, it will take priority
'[`enumerate`](https://docs.python.org/3/library/functions.html#enumerate), [`builtins.enumerate`](https://docs.python.org/3/library/functions.html#enumerate) and [`threading.enumerate`](https://docs.python.org/3/library/threading.html#threading.enumerate)'
We can also take the find() function as another instance, it exists as a standard library and in numpy. Therefore, depending on the order of stripped libraries we pass, find() will link to either numpy or standard library.
'[`find()`](https://numpy.org/doc/stable/reference/generated/numpy.char.find.html#numpy.char.find)'
'[`find()`](https://docs.python.org/3/library/gettext.html#gettext.find)'
You can also use NbdevLookup with import aliases like the following: