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.97.0

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.97.0
File Actions
lightrun-1.97.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for lightrun-1.97.0-cp313-cp313-win_amd64.whl
lightrun-1.97.0-cp313-cp313-musllinux_1_1_x86_64.whl CPython 3.13 CPython 3.13 Linux musl 1.1+ x86-64 Details for lightrun-1.97.0-cp313-cp313-musllinux_1_1_x86_64.whl
lightrun-1.97.0-cp313-cp313-manylinux2010_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.12+ x86-64 Details for lightrun-1.97.0-cp313-cp313-manylinux2010_x86_64.whl
lightrun-1.97.0-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for lightrun-1.97.0-cp313-cp313-macosx_11_0_arm64.whl
lightrun-1.97.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for lightrun-1.97.0-cp312-cp312-win_amd64.whl
lightrun-1.97.0-cp312-cp312-musllinux_1_1_x86_64.whl CPython 3.12 CPython 3.12 Linux musl 1.1+ x86-64 Details for lightrun-1.97.0-cp312-cp312-musllinux_1_1_x86_64.whl
lightrun-1.97.0-cp312-cp312-manylinux2010_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.12+ x86-64 Details for lightrun-1.97.0-cp312-cp312-manylinux2010_x86_64.whl
lightrun-1.97.0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for lightrun-1.97.0-cp312-cp312-macosx_11_0_arm64.whl
lightrun-1.97.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for lightrun-1.97.0-cp311-cp311-win_amd64.whl
lightrun-1.97.0-cp311-cp311-musllinux_1_1_x86_64.whl CPython 3.11 CPython 3.11 Linux musl 1.1+ x86-64 Details for lightrun-1.97.0-cp311-cp311-musllinux_1_1_x86_64.whl
lightrun-1.97.0-cp311-cp311-manylinux2010_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.12+ x86-64 Details for lightrun-1.97.0-cp311-cp311-manylinux2010_x86_64.whl
lightrun-1.97.0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for lightrun-1.97.0-cp311-cp311-macosx_11_0_arm64.whl
lightrun-1.97.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for lightrun-1.97.0-cp310-cp310-win_amd64.whl
lightrun-1.97.0-cp310-cp310-musllinux_1_1_x86_64.whl CPython 3.10 CPython 3.10 Linux musl 1.1+ x86-64 Details for lightrun-1.97.0-cp310-cp310-musllinux_1_1_x86_64.whl
lightrun-1.97.0-cp310-cp310-manylinux2010_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.12+ x86-64 Details for lightrun-1.97.0-cp310-cp310-manylinux2010_x86_64.whl
lightrun-1.97.0-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details for lightrun-1.97.0-cp310-cp310-macosx_11_0_arm64.whl

Total release size: 2.3 MB

Release files / lightrun-1.97.0-cp313-cp313-win_amd64.whl

Download URL lightrun-1.97.0-cp313-cp313-win_amd64.whl
Size 126.8 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
09561f6b5818ed46ab2f04e9d2a84952bc098a6ca96ef7f0ec16b7f402fedbd7
BLAKE2b-256 checksum
How to use checksums
143e24de84aac50008456ace2bc19224234a6b97b058887fc604ac4c11266a78
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.97.0-cp313-cp313-musllinux_1_1_x86_64.whl

Download URL lightrun-1.97.0-cp313-cp313-musllinux_1_1_x86_64.whl
Size 150.1 kB
Tags CPython 3.13 Linux musl 1.1+ x86-64
SHA-256 checksum
How to use checksums
9625f1699737283c01c15cc0372b0eb6912b9fdd5b7496b65d65500919b88851
BLAKE2b-256 checksum
How to use checksums
815c8b994e44a32af048cb44d22c831bc10401a90d3287abbd5d897028127cab
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.97.0-cp313-cp313-manylinux2010_x86_64.whl

Download URL lightrun-1.97.0-cp313-cp313-manylinux2010_x86_64.whl
Size 146.2 kB
Tags CPython 3.13 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
734635c6c8237dd43cc640ff7a5201fe6b0cde808fede946028441863782e563
BLAKE2b-256 checksum
How to use checksums
861f3d2a8744c349886b05834eb649e3a0a45a035b298609fb79a1c6c3ab56e3
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.97.0-cp313-cp313-macosx_11_0_arm64.whl

Download URL lightrun-1.97.0-cp313-cp313-macosx_11_0_arm64.whl
Size 116.5 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
08f1eddfc943787e4bfccb2389b43f151b232df8b59ece7001fcbb9cac5b9a75
BLAKE2b-256 checksum
How to use checksums
7bd3254b2b6a1662eb19ca8cfb81d05f84d51f91110e400d242a946093dc7b3f
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.97.0-cp312-cp312-win_amd64.whl

Download URL lightrun-1.97.0-cp312-cp312-win_amd64.whl
Size 126.8 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
9fa7135aa920fca4f0499a62387938045b61a12ea00514d555e5b11fb1aaf6e8
BLAKE2b-256 checksum
How to use checksums
6e8fffe83752b4c4c17725dc1065ec355e31df6882a18eef2075dde8ce6146a8
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.97.0-cp312-cp312-musllinux_1_1_x86_64.whl

Download URL lightrun-1.97.0-cp312-cp312-musllinux_1_1_x86_64.whl
Size 150.1 kB
Tags CPython 3.12 Linux musl 1.1+ x86-64
SHA-256 checksum
How to use checksums
5c8db72fdc27e8cdd57f8648465a2551b0518b4e49b373c4354b57afac69d2c0
BLAKE2b-256 checksum
How to use checksums
5fc858d58a6ff776f8853b246cd122b7f06c40c25b7f64a8c77a34c45590bc94
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.97.0-cp312-cp312-manylinux2010_x86_64.whl

Download URL lightrun-1.97.0-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
15a70c7c2e8ec6bf32cffb71101820468dc28f7abbded47c7fb908d0a94ab42a
BLAKE2b-256 checksum
How to use checksums
604e4048ce341f0fd6e7692f6fcc7b032740a8f0c03b26119fc8997dadb45806
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.97.0-cp312-cp312-macosx_11_0_arm64.whl

Download URL lightrun-1.97.0-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
db3720066ba4af3fb6842d75cb0b39979b479aa04073cbe32ef8d92492c5ebe3
BLAKE2b-256 checksum
How to use checksums
c8d2352d6ba5119743bb011ce1ca6a8da625354f5127d0d1a4753796be05aa48
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.97.0-cp311-cp311-win_amd64.whl

Download URL lightrun-1.97.0-cp311-cp311-win_amd64.whl
Size 135.6 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
e256582f376d4ff81b2fd5c33d543111f13ff41a52cceabe4ee8991b317e1bca
BLAKE2b-256 checksum
How to use checksums
81a88a7b3719731d9048b7f868aca6e068e4814d2589bdcaf8d4b3364e8f92c8
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.97.0-cp311-cp311-musllinux_1_1_x86_64.whl

Download URL lightrun-1.97.0-cp311-cp311-musllinux_1_1_x86_64.whl
Size 176.9 kB
Tags CPython 3.11 Linux musl 1.1+ x86-64
SHA-256 checksum
How to use checksums
7ab065779a53fc1879cf7ddd80d772c891dc63b5ff1e2164dc0c6cfe6f5cc7d3
BLAKE2b-256 checksum
How to use checksums
556415191bbf7e6d493d81fe1613b3eb2d62bcfb62f4d4a3507f2824f4e56f8a
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.97.0-cp311-cp311-manylinux2010_x86_64.whl

Download URL lightrun-1.97.0-cp311-cp311-manylinux2010_x86_64.whl
Size 169.0 kB
Tags CPython 3.11 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
ca74156d1bc0a8d6f70d006b91ff301616d21e74430c0da716fdfc264999a875
BLAKE2b-256 checksum
How to use checksums
19d2af7165f87bf3b11dc3e8d21b9c6f8133040befbcbadc62110d51f0e83384
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.97.0-cp311-cp311-macosx_11_0_arm64.whl

Download URL lightrun-1.97.0-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
25d189628f466ba6febc908871422a4ac382012bdfef6df50c3bed7fdacce8bc
BLAKE2b-256 checksum
How to use checksums
817dbbfe43b0b5bcd95a5bfce41494c48ffbd7b8216002dff177a4bafc95e221
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.97.0-cp310-cp310-win_amd64.whl

Download URL lightrun-1.97.0-cp310-cp310-win_amd64.whl
Size 131.8 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
c8d4b8da123f1b7a2bb029441b7fc8e26b5aecc1d55f5ad71ebb53fc50c1980e
BLAKE2b-256 checksum
How to use checksums
4ee6913d62eae2d0dc7c6438628e27e2a8ffe2929a315f6137eca6880f24fbcd
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.97.0-cp310-cp310-musllinux_1_1_x86_64.whl

Download URL lightrun-1.97.0-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
4c98ffc7381d95bbcec520ecf0936ed38d6a0ea8870725e05ca712a9a77b4d73
BLAKE2b-256 checksum
How to use checksums
fbfe49ffefefabdc3c9172c185f9984e54e609a5255ebb4f82d7a0cd8825a69b
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.97.0-cp310-cp310-manylinux2010_x86_64.whl

Download URL lightrun-1.97.0-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
c25c31422ddb84f07ab316f35f2cdb62847afd0062d50b360227e0cfd3262ccd
BLAKE2b-256 checksum
How to use checksums
eefd40a1fba997c7542750a2eeab30f9e295a1558bb78844f4df7c56a52f73b3
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.97.0-cp310-cp310-macosx_11_0_arm64.whl

Download URL lightrun-1.97.0-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
2a5404655d6f1766079e65d1d2e271aeb32a53bc3c35e37a706ead62251ee19f
BLAKE2b-256 checksum
How to use checksums
448af701117a9353e51e95f82e92511de8f58df99849ca4e3430911bc29860a1
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.97.0

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.97.0 This release

16 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