Skip to main content

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

is kinda nice, but it'll find imports, comments, and whatnot.

Meet pygrep, it allows you to find all references to your code,

pygrep some/dir other/

That will show you some output like

In, there's a reference to in the method function in class Class.


At this point, pygrep resolves

from foo import bar


from foo import bar as baz


Given this python file

from import stuff as a
class A:
    def m(self):
        b = a.mod.method()

all the following commands

pygrep mymod

will return

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

pygrep-0.3.tar.gz (3.9 kB view hashes)

Uploaded source

Built Distribution

pygrep-0.3-py3-none-any.whl (3.6 kB view hashes)

Uploaded py3

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