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

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

Total release size: 1.8 MB

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

Download URL lightrun-1.96.1-cp312-cp312-win_amd64.whl
Size 126.7 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
57be3686f068b663765e646b28c78aa04a694da775ec07432e365df26faeea64
BLAKE2b-256 checksum
How to use checksums
b75c39c7a6f46084be268977b72115b8cc818de998d9aa35f3c58b6b3d441a98
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.1-cp312-cp312-musllinux_1_1_x86_64.whl

Download URL lightrun-1.96.1-cp312-cp312-musllinux_1_1_x86_64.whl
Size 149.9 kB
Tags CPython 3.12 Linux musl 1.1+ x86-64
SHA-256 checksum
How to use checksums
d2334a856f22b2d482a74a05062104a643354bca478252e08401d1c3337d79f9
BLAKE2b-256 checksum
How to use checksums
38ac96fbcc8b3c9d7e6fea8d082eb4931f672eee7e2eff5c2e021183bdbf2e24
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.1-cp312-cp312-manylinux2010_x86_64.whl

Download URL lightrun-1.96.1-cp312-cp312-manylinux2010_x86_64.whl
Size 146.1 kB
Tags CPython 3.12 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
fb923a3d11d004a118c421c9a1938d28067702362974aa39d372a517cebe0247
BLAKE2b-256 checksum
How to use checksums
1ff719310e515ce00155a09dee051515cb534046dc3bd39e6c52220e500a73d7
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.1-cp312-cp312-macosx_11_0_arm64.whl

Download URL lightrun-1.96.1-cp312-cp312-macosx_11_0_arm64.whl
Size 116.4 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ff5f14cfdd3573b55d88a7ed553d99d6905c713e2eb83b5a766eba4c9d99f7df
BLAKE2b-256 checksum
How to use checksums
ef5129ca2d2c364f043eb3bb53351453df31b50fa1ae15425c1b41efb4c21674
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.1-cp311-cp311-win_amd64.whl

Download URL lightrun-1.96.1-cp311-cp311-win_amd64.whl
Size 135.5 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
b15c2e1772deee785be3caa4a6b8f7b40e57030920358d728e37392a3855b811
BLAKE2b-256 checksum
How to use checksums
75aeed492c494a5a745e5762b7a6b9f7aa33dd50befc5cc7a6e931755b255d8b
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.1-cp311-cp311-musllinux_1_1_x86_64.whl

Download URL lightrun-1.96.1-cp311-cp311-musllinux_1_1_x86_64.whl
Size 176.7 kB
Tags CPython 3.11 Linux musl 1.1+ x86-64
SHA-256 checksum
How to use checksums
78825c34e75f29921175d76f8f836ddbed6ed32fd8530e75007085aae053f555
BLAKE2b-256 checksum
How to use checksums
949a4301a5287022d2d8a1b003edcd8c758074cbd6c78afd8af51113787a616c
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.1-cp311-cp311-manylinux2010_x86_64.whl

Download URL lightrun-1.96.1-cp311-cp311-manylinux2010_x86_64.whl
Size 168.8 kB
Tags CPython 3.11 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
0f871494293bf49d72f6f4e733214287ca3a8d4bd1213c08c641c3d0f6bee8f9
BLAKE2b-256 checksum
How to use checksums
4dff1678047c4fce9f51e29ebfae44c5e3a1a36ef8ed4619214492db3cb3d37a
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.1-cp311-cp311-macosx_11_0_arm64.whl

Download URL lightrun-1.96.1-cp311-cp311-macosx_11_0_arm64.whl
Size 135.4 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
624e43c91d178408e69854858a5e3c16d60df4af8b10e5611ce05d518fb711a8
BLAKE2b-256 checksum
How to use checksums
41636fc9bb3fd0c1c5d9a3f3e02061920bf430078f03c8188f59f32fb4be2f3a
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.1-cp310-cp310-win_amd64.whl

Download URL lightrun-1.96.1-cp310-cp310-win_amd64.whl
Size 131.7 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
5e81a6f2abe9f0d2fe75374f882bdfbd8a47c21b5ff1fd9c9d01c57db04e8b6d
BLAKE2b-256 checksum
How to use checksums
e4f278241b2e5261e5cfbf61b229619762838cda80869de9a8435d38bb2bde21
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.1-cp310-cp310-musllinux_1_1_x86_64.whl

Download URL lightrun-1.96.1-cp310-cp310-musllinux_1_1_x86_64.whl
Size 171.5 kB
Tags CPython 3.10 Linux musl 1.1+ x86-64
SHA-256 checksum
How to use checksums
35ece8bac1257426b788f72a7dd79e268ae8c20742be65d914541067e4ecdc8e
BLAKE2b-256 checksum
How to use checksums
b782d3a15329e9755b514b086d6cbbbf5784464bae0377269ffe0e7f9bb9091c
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.1-cp310-cp310-manylinux2010_x86_64.whl

Download URL lightrun-1.96.1-cp310-cp310-manylinux2010_x86_64.whl
Size 164.4 kB
Tags CPython 3.10 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
418ba16bef178c0bab871af49b2f1cd0744f290a1249bccfbbd7d2693fed060b
BLAKE2b-256 checksum
How to use checksums
73f79930796d4aaa3bb1539e1f357ab1f4683682bb95fe8303c9dd483ba5f7fc
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.1-cp310-cp310-macosx_11_0_arm64.whl

Download URL lightrun-1.96.1-cp310-cp310-macosx_11_0_arm64.whl
Size 130.8 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
974b0f73a08b7a3e32784624da06c79fb1cd976a84d6561047bf4b79ad5b7513
BLAKE2b-256 checksum
How to use checksums
47bd4fae5f51b031cc50f220ea52b0301779562e51febfb88075adc5b85ba7aa
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.1

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