A lightweight module searching methods in the current python environment by keywords
Project description
pylookfor
A lightweight module searching methods in the current python environment by keywords.
Method - pylookfor.lookfor
pylookfor.lookfor(key: str, num_print=0, modules=[])
Searching methods in the current python environment by keywords.
Print modules, methods and the first line of their documents if any of them contain the keywords.
Parameters
- key: str The keywords.
- num_print: int, optional The number of the methods that printed. Default: 0 means no limit.
- modules: list, optional Search methods in these modules. Default: [] means search all the modules.
Example
Example1
Like 'lookfor' in Matlab, it can print modules, methods and the first line of their documents if any of them contain the keywords.
import pylookfor as lf
lf.lookfor('sort',num_print=5)
Output:
--------------------Modules----------------------
isort - Defines the public isort interface
isort._future - No Documentation Found.
isort.deprecated - No Documentation Found.
isort.stdlibs - No Documentation Found.
networkx.algorithms.assortativity - No Documentation Found.
networkx.algorithms.assortativity.tests - No Documentation Found.
sortedcollections - Python Sorted Collections
sortedcontainers - Sorted Containers -- Sorted List, Sorted Dict, Sorted Set
--------------------Methods----------------------
builtins.sorted - Return a new list containing all items from the iterable in ascending order.
anaconda_navigator.utils.sort_versions - Sort a list of version number strings.
cytoolz.sorted - Return a new list containing all items from the iterable in ascending order.
isort.check_file - Checks any imports within the provided file, returning `False` if any unsorted or
isort.check_stream - Checks any imports within the provided code stream, returning `False` if any unsorted or
Example2
It can search methods in specify modules.
import pylookfor as lf
lf.lookfor('sort',modules=['scipy‘,’numpy'],num_print=10)
Output:
--------------------Methods----------------------
scipy.argsort - scipy.argsort is deprecated and will be removed in SciPy 2.0.0, use numpy.argsort instead
scipy.lexsort - scipy.lexsort is deprecated and will be removed in SciPy 2.0.0, use numpy.lexsort instead
scipy.msort - scipy.msort is deprecated and will be removed in SciPy 2.0.0, use numpy.msort instead
scipy.searchsorted - scipy.searchsorted is deprecated and will be removed in SciPy 2.0.0, use numpy.searchsorted instead
scipy.sort - scipy.sort is deprecated and will be removed in SciPy 2.0.0, use numpy.sort instead
scipy.sort_complex - scipy.sort_complex is deprecated and will be removed in SciPy 2.0.0, use numpy.sort_complex instead
numpy.argsort - Returns the indices that would sort an array.
numpy.lexsort - lexsort(keys, axis=-1)
numpy.msort - Return a copy of an array sorted along the first axis.
numpy.searchsorted - Find indices where elements should be inserted to maintain order.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pylookfor-0.0.1.tar.gz
(3.7 kB
view hashes)
Built Distribution
Close
Hashes for pylookfor-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fe14986c9aa24d6072c1ada16fd1ef0e3fd2a1fb9b7ca921055da6a81f2d4ae |
|
MD5 | 4d47105afdf47a8764f17a9fd356e393 |
|
BLAKE2b-256 | cfde18b22ca8110ba7c9f13018efa90cbf5f7a1b9525bcf1e6d201e9914024f3 |