Find python identifiers
Project description
Ever tried to refactor some python code and trying to find out where you're code is used?
find . -name \*.py | xargs grep foo.bar
is kinda nice, but it'll find imports, comments, and whatnot.
Meet pygrep, it allows you to find all references to your code,
pygrep foo.bar some/dir other/stuff.py
That will show you some output like
file.py(Class.function):lineno foo.bar.full.identifier
In file.py, there's a reference to foo.bar.full.identifier in the method
function in class Class.
Supported
At this point, pygrep resolves
from foo import bar
and
from foo import bar as baz
Example
Given this python file foo.py
from mymod.bar import stuff as a
class A:
def m(self):
b = a.mod.method()
all the following commands
pygrep mymod foo.py
pygrep mymod.bar foo.py
pygrep mymod.bar.mod foo.py
pygrep mymod.bar.mod.method foo.py
will return
foo.py(A.m):4 mymod.bar.mod.method
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
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 pygrep-0.3.2.tar.gz.
File metadata
- Download URL: pygrep-0.3.2.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d276d4b83e5c8e8e066203e1d3d8880e64296c67b5a4e10e61a5d5f3a9e5ec5f
|
|
| MD5 |
6414438e7afbda57bd1c160e70f4b884
|
|
| BLAKE2b-256 |
3ac5357826824aa8417dcb65bb970a13f85d9409b8ab7e92d284b396750439dd
|
Provenance
The following attestation bundles were made for pygrep-0.3.2.tar.gz:
Publisher:
release.yml on Pike/pygrep
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pygrep-0.3.2.tar.gz -
Subject digest:
d276d4b83e5c8e8e066203e1d3d8880e64296c67b5a4e10e61a5d5f3a9e5ec5f - Sigstore transparency entry: 406460449
- Sigstore integration time:
-
Permalink:
Pike/pygrep@f01471c02848feb93c164e5a303595681019fc7b -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/Pike
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f01471c02848feb93c164e5a303595681019fc7b -
Trigger Event:
release
-
Statement type:
File details
Details for the file pygrep-0.3.2-py3-none-any.whl.
File metadata
- Download URL: pygrep-0.3.2-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e59f7d1b05bec590c66f58175ad408782a2b320aaa7147bbd89598b86c163504
|
|
| MD5 |
69a0c166d803c39ca6b9f2e464090a7f
|
|
| BLAKE2b-256 |
f09b0ac63103ae75c33200846132546739df7715d8cc9c96f2117035051fc79e
|
Provenance
The following attestation bundles were made for pygrep-0.3.2-py3-none-any.whl:
Publisher:
release.yml on Pike/pygrep
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pygrep-0.3.2-py3-none-any.whl -
Subject digest:
e59f7d1b05bec590c66f58175ad408782a2b320aaa7147bbd89598b86c163504 - Sigstore transparency entry: 406460487
- Sigstore integration time:
-
Permalink:
Pike/pygrep@f01471c02848feb93c164e5a303595681019fc7b -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/Pike
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f01471c02848feb93c164e5a303595681019fc7b -
Trigger Event:
release
-
Statement type: