Skip to main content

Lightrun for Python

Lightrun is a developer-native observabity platform. It's a way to add logs, inspect the state of the current execution (in a familiar, debugger-like view), and extract any type of code-level metric on the fly - without redeploying, restarting or even stopping the running application.

Check out our docs to learn more.

Getting Started

To get started with Lightrun you'll need three things:

  1. A Lightrun Account - you can get one here.
  2. A Lightrun Plugin - you'll have instructions to download it once you create an account, but you can also check them out here.
  3. A Lightrun Agent - which is this very PyPI package! It's the thing that actually does the magic.

Once you've signed up for an account and downloaded the plugin, you can install the agent in your application.

Installing the Lightrun Agent - Directly

In order to install the Lightrun Python Agent please follow these steps:

  1. Install the python agent by running python -m pip install lightrun.

  2. Add the following code to the beginning of your main function:

try:
    import lightrun

    lightrun.enable(company_key="<COMPANY_SECRET>")
except ImportError as e:
    print("Error importing Lightrun: ", e)

You will have a <COMPANY-SECRET> auto-generated for you during the onboarding process, right after signing up for an account.

  1. Run the application as you normally would, i.e. python app.py.

You should see the application's agent popping up in the Lightrun Plugin's sidebar - you can now add logs, snapshots and metrics to your application.

Providing Credentials Via Program Arguments

You can optionally choose to provide the <COMPANY-SECRET> as program argument. To do so, run your application in the following way:

python -m lightrun --company_key='<COMAPNY-SECRET>' -- app.py

Notice - The method above won't work well with applications based on gunicorn or any other multiprocessing libraries, as the debugger won't attach to the spawned sub-processes. Please use the import method instead.

Installing the Lightrun Agent - Django

In order to run a Django web server with the Lightrun agent please follow these steps:

  1. In the application folder, install the python agent by running python -m pip install lightrun
  2. Add the following code to your manage.py file and run your Django application as you did normally before:
try:
    if os.environ.get("RUN_MAIN") or "--noreload" in sys.argv:
        import lightrun

        lightrun.enable(company_key="<COMAPNY-SECRET>")
except ImportError as e:
    print("Error importing Lightrun: ", e)

Installing the Lightrun Agent - Flask

In order to run a Flask web app with the Lightrun agent please follow these steps:

  1. In the application folder, install the python agent by running python -m pip install lightrun
  2. Add the following code to your application's main init.py or app.py (the import shouldn't be added to a specific routed method, but to the main file code instead):
try:
    import lightrun

    lightrun.enable(company_key="<COMAPNY-SECRET>")
except ImportError as e:
    print("Error importing Lightrun: ", e)


# Example route
@app.route("/")
def hello_world():
    return "<p>Hello world!</p>"

Installing the Lightrun Agent - Apache Airflow

In order to run Lightrun for Python with Apache Airflow you'll need to decide which step of the DAG you'd like to debug. Choose one (or more) steps and:

  1. Find a place in your system that has access to the same Python interpreter that is used by Airflow, and install the python agent by running python -m pip install lightrun.
  2. In an Airflow DAG file, add the following decorator above the operators you'd like to use Lightrun with:
@lightrun_airflow_task()
def operator_name():
    # Operator code

Debugging Airflow Multi-step DAGs with Lightrun's Free Tier

Please note that the Lightrun free tier limits usage to one agent per user. In practice, note this means that each operator can be debugged individually, but you cannot debug multiple operators simultaneously.

Metadata

Release files for lightrun 1.96.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for lightrun 1.96.3
File Actions
lightrun-1.96.3-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for lightrun-1.96.3-cp312-cp312-win_amd64.whl
lightrun-1.96.3-cp312-cp312-musllinux_1_1_x86_64.whl CPython 3.12 CPython 3.12 Linux musl 1.1+ x86-64 Details for lightrun-1.96.3-cp312-cp312-musllinux_1_1_x86_64.whl
lightrun-1.96.3-cp312-cp312-manylinux2010_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.12+ x86-64 Details for lightrun-1.96.3-cp312-cp312-manylinux2010_x86_64.whl
lightrun-1.96.3-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for lightrun-1.96.3-cp312-cp312-macosx_11_0_arm64.whl
lightrun-1.96.3-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for lightrun-1.96.3-cp311-cp311-win_amd64.whl
lightrun-1.96.3-cp311-cp311-musllinux_1_1_x86_64.whl CPython 3.11 CPython 3.11 Linux musl 1.1+ x86-64 Details for lightrun-1.96.3-cp311-cp311-musllinux_1_1_x86_64.whl
lightrun-1.96.3-cp311-cp311-manylinux2010_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.12+ x86-64 Details for lightrun-1.96.3-cp311-cp311-manylinux2010_x86_64.whl
lightrun-1.96.3-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for lightrun-1.96.3-cp311-cp311-macosx_11_0_arm64.whl
lightrun-1.96.3-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for lightrun-1.96.3-cp310-cp310-win_amd64.whl
lightrun-1.96.3-cp310-cp310-musllinux_1_1_x86_64.whl CPython 3.10 CPython 3.10 Linux musl 1.1+ x86-64 Details for lightrun-1.96.3-cp310-cp310-musllinux_1_1_x86_64.whl
lightrun-1.96.3-cp310-cp310-manylinux2010_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.12+ x86-64 Details for lightrun-1.96.3-cp310-cp310-manylinux2010_x86_64.whl
lightrun-1.96.3-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details for lightrun-1.96.3-cp310-cp310-macosx_11_0_arm64.whl

Total release size: 1.8 MB

Release files / lightrun-1.96.3-cp312-cp312-win_amd64.whl

Download URL lightrun-1.96.3-cp312-cp312-win_amd64.whl
Size 126.8 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
b8f7f52f902123411a9a9a363b84ed9567972438b5aba5e5f63ecc651d4dd0f6
BLAKE2b-256 checksum
How to use checksums
cc741c7a2f97dc73cbaf3076ed0855981d2e2225bb8e93140bffadf55d3028e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.5

Release files / lightrun-1.96.3-cp312-cp312-musllinux_1_1_x86_64.whl

Download URL lightrun-1.96.3-cp312-cp312-musllinux_1_1_x86_64.whl
Size 150.0 kB
Tags CPython 3.12 Linux musl 1.1+ x86-64
SHA-256 checksum
How to use checksums
fdd118851e8da5ea9232e7bbbe3ea58264721d93cdb4b54850f281202ec1b7b7
BLAKE2b-256 checksum
How to use checksums
71a5c93cccc335c5ad9e3921cd62a6eacbbe1c18975980d9dc70a374b89d0559
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.5

Release files / lightrun-1.96.3-cp312-cp312-manylinux2010_x86_64.whl

Download URL lightrun-1.96.3-cp312-cp312-manylinux2010_x86_64.whl
Size 146.2 kB
Tags CPython 3.12 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
e35a0cd56e18b1d08ce2bd70f52e48c2d2337257e5e17961b749b3e47f9d43e4
BLAKE2b-256 checksum
How to use checksums
c609aea3e6c5f4e83b806c6f4040420bc56d5f00fa75798d277303fb83a5b78a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.5

Release files / lightrun-1.96.3-cp312-cp312-macosx_11_0_arm64.whl

Download URL lightrun-1.96.3-cp312-cp312-macosx_11_0_arm64.whl
Size 116.5 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
167ee20d3f2b737270b39fa7795fe27ff2ccc3c97c4a05336102ec6ea62f8d84
BLAKE2b-256 checksum
How to use checksums
4a67dbe794b3d6ea09e9d2a204d3eacc664a812296c706832e572a382ade8190
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.5

Release files / lightrun-1.96.3-cp311-cp311-win_amd64.whl

Download URL lightrun-1.96.3-cp311-cp311-win_amd64.whl
Size 135.6 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
c725e3c640f593e094103273a2fad6a56ba35a51fdef32e59f1a4ad3b120ef34
BLAKE2b-256 checksum
How to use checksums
635e0590780683b3d266b71bc8f23afc7dd17e3190968ed6f0919a1ef48f61c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.5

Release files / lightrun-1.96.3-cp311-cp311-musllinux_1_1_x86_64.whl

Download URL lightrun-1.96.3-cp311-cp311-musllinux_1_1_x86_64.whl
Size 176.8 kB
Tags CPython 3.11 Linux musl 1.1+ x86-64
SHA-256 checksum
How to use checksums
bbb2ce12247118443f636d62ecdb5c0154c76d2bd6614d01fef560a7d73614f9
BLAKE2b-256 checksum
How to use checksums
d06ace943261e030a5948553abf5aeed65bf60ea88b53bb97852f61118109cc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.5

Release files / lightrun-1.96.3-cp311-cp311-manylinux2010_x86_64.whl

Download URL lightrun-1.96.3-cp311-cp311-manylinux2010_x86_64.whl
Size 168.9 kB
Tags CPython 3.11 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
8dd5e86f059d5c86aae6e5b3b922c2652d5d8eb7b7ff7209d69e780094690e28
BLAKE2b-256 checksum
How to use checksums
0802b4a9647336a32d56d87ce779ee16ae246dfe33cf40e3b1885ca8a37a437d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.5

Release files / lightrun-1.96.3-cp311-cp311-macosx_11_0_arm64.whl

Download URL lightrun-1.96.3-cp311-cp311-macosx_11_0_arm64.whl
Size 135.5 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
77e0de0ff8a78e48f9baa5e6d8a23947c0f7047ae505b2cf8fdeb9d263495509
BLAKE2b-256 checksum
How to use checksums
3359cb41c199105c9e823987dd63f8d2d79e3326d24067a9c551e55b8ba633c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.5

Release files / lightrun-1.96.3-cp310-cp310-win_amd64.whl

Download URL lightrun-1.96.3-cp310-cp310-win_amd64.whl
Size 131.8 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
e7a980ca65d181ef013f1b7692da89bee61114de468b851bcb10c303a798cd27
BLAKE2b-256 checksum
How to use checksums
e01c37bf771826cf369e46a40ddba50b104e13f07e60f5be95225d73041bee3b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.5

Release files / lightrun-1.96.3-cp310-cp310-musllinux_1_1_x86_64.whl

Download URL lightrun-1.96.3-cp310-cp310-musllinux_1_1_x86_64.whl
Size 171.6 kB
Tags CPython 3.10 Linux musl 1.1+ x86-64
SHA-256 checksum
How to use checksums
df853858a07466660cab7b2f0bcdf2a175993987381f2578aa7a3b53e39cb20b
BLAKE2b-256 checksum
How to use checksums
1a77da667274c78e0b1da036da9ed6cfab2552e4c445e1d0b8e7c996e6ff27c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.5

Release files / lightrun-1.96.3-cp310-cp310-manylinux2010_x86_64.whl

Download URL lightrun-1.96.3-cp310-cp310-manylinux2010_x86_64.whl
Size 164.6 kB
Tags CPython 3.10 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
026a3c56308c097ba68b7a2c843b57de0b02a885236d5d75ffc55894453dfb0b
BLAKE2b-256 checksum
How to use checksums
a788e5ae9ca452dfc09833e40b072d2566a29880d3ac2475294fc140e98b62f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.5

Release files / lightrun-1.96.3-cp310-cp310-macosx_11_0_arm64.whl

Download URL lightrun-1.96.3-cp310-cp310-macosx_11_0_arm64.whl
Size 130.9 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e5634b8775f6d3646e5010cdf325850c76d2ed07e0492567886bd31da592eb71
BLAKE2b-256 checksum
How to use checksums
f422cf61b4fdd6758aadce0a15cd0ed434357e02fc8564b86e7a2e57fd12effc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.5

Security for lightrun 1.96.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.96.3 This release

12 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page