Skip to main content

Allow a function to discover the module or script name of its caller, or its caller's caller.

Project description

https://travis-ci.org/drcloud/stackclimber.svg?branch=master https://img.shields.io/pypi/v/stackclimber.svg https://img.shields.io/pypi/dd/stackclimber.svg

stackclimber allows your function to find the module or script name of its caller, or of its caller’s caller.

from stackclimber import stackclimber


assert stackclimber() == __name__
assert stackclimber() == stackclimber(0)

With no arguments, it finds the current function’s module name. With 1, it finds that of its caller; with 2, that of its caller’s caller, and so forth.

This functionality can be used to implement “automatic” imports that use some information about the module into which they are being imported by overriding a module’s __getattr__.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for stackclimber, version 0.99
Filename, size File type Python version Upload date Hashes
Filename, size stackclimber-0.99.tar.gz (1.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page