A package to find strings in python modules
Project description
sappears
This python library allows you to cound the ocurrences of a particular string python source files. This could used to estimate the effort of refactoring or changing a convention.
Why we do this?
There are times when you need to refactore some modules or replace a convention used during the implementation of a particular functionality. Measuring the impact of such changes is sometimes time consuming as it may involve going through all modules, classes and functions of your package.
How it works?
The goal of this search process is to have a table as follows:
Ocurrences as of [name of interest]:
| namespace | type | location | ocurrences |
|--------------|----------|------------------------------|------------|
| module_one | module | package/module_1/__init__.py | 2 |
| ClassOne | type | package/module_1/ClassOne.py | 1 |
| function_one | function | package/module_1/__init__.py | 1 |
You can achieve that by runing:
import mypackage # replace with the package you want to inspect.
import sappears
string = "import tensorflow as tf"
results = search_in_module(string, mypackage)
make_report(results)
where name of interest is the name of the variable, function, method, class or module you are interested in. Alternatively, you could just run it from the command line as follows:
python -m sappears [string of interest] [mypacakge]
Contribute
Please feel free to add issues and make PRs!
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sappears-0.0.1.tar.gz.
File metadata
- Download URL: sappears-0.0.1.tar.gz
- Upload date:
- Size: 1.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de770fdafb2551611ca0d4c7c80c194320e2824f9c8310a9884ed97237635ff5
|
|
| MD5 |
9f72b0bf90365a8788ac466e77edf87d
|
|
| BLAKE2b-256 |
22b3c0bd696ca608ca975feaf835823021e5000b50dbd8c5ee36ca80b42eedce
|
File details
Details for the file sappears-0.0.1-py3-none-any.whl.
File metadata
- Download URL: sappears-0.0.1-py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e11bcb9879eef5141884142f4828495c0fb6461a95626e9f2f1f93a5a68d7f0
|
|
| MD5 |
b312e874f7405d01aac254e5af215811
|
|
| BLAKE2b-256 |
9a1763b90d9587ae5e12b5b174965654fc0a44639e974a8d07b6eab51d3f9140
|