Skip to main content

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


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)

Uploaded Source

Built Distribution

pylookfor-0.0.1-py3-none-any.whl (4.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page