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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file pylookfor-0.0.1.tar.gz.

File metadata

  • Download URL: pylookfor-0.0.1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.1

File hashes

Hashes for pylookfor-0.0.1.tar.gz
Algorithm Hash digest
SHA256 64fbf2eb0d80441791fe690c8515dbabd808c3a23580a4bc34f8ebfb13f3bca0
MD5 4e6bcba7dd7c7aec38d9138fd48810df
BLAKE2b-256 60c1995b33a4091b409124a74b2ab6e1a5acf9f72d92646af6a13fe570f7b19c

See more details on using hashes here.

File details

Details for the file pylookfor-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: pylookfor-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.1

File hashes

Hashes for pylookfor-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8fe14986c9aa24d6072c1ada16fd1ef0e3fd2a1fb9b7ca921055da6a81f2d4ae
MD5 4d47105afdf47a8764f17a9fd356e393
BLAKE2b-256 cfde18b22ca8110ba7c9f13018efa90cbf5f7a1b9525bcf1e6d201e9914024f3

See more details on using hashes here.

Supported by

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