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

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

Total release size: 2.3 MB

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

Download URL lightrun-1.97.2-cp313-cp313-win_amd64.whl
Size 126.8 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
4ea6f4bb2d4fe76cc02c6f2c8d4d3216e71fb0f89e9587a70ad6d6a319997be7
BLAKE2b-256 checksum
How to use checksums
748248a31c9bb4573163776cc7b9603b420b138d1b5fdcae20924b671d0c268a
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.2-cp313-cp313-musllinux_1_1_x86_64.whl

Download URL lightrun-1.97.2-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
8faadfeac775d321773a557a7e1e0abe0cde3b585fe6b9e77170a26b1bd6131b
BLAKE2b-256 checksum
How to use checksums
82fc816c85068e9fcd051b6dee3a902514e6df934ac74e9609a1099b36bcc6fc
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.2-cp313-cp313-manylinux2010_x86_64.whl

Download URL lightrun-1.97.2-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
66f4b04fc3cb76f3996c7d70309ff24aaf983424c058733cf08764df21e1b100
BLAKE2b-256 checksum
How to use checksums
584e72e51cd7b2eda3f4c0e2f18ab1c370ddab8f78092a5395f420ae535b8a4f
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.2-cp313-cp313-macosx_11_0_arm64.whl

Download URL lightrun-1.97.2-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
9da23fc4fa3c267ac4ba6cd9ae9d19e47b9ca366dcbcc14dc8004c3b57541a35
BLAKE2b-256 checksum
How to use checksums
e9a13b4a946bad1cd871c5be8967d2f89c14ee64109e61f88de8f63d4c9ea372
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.2-cp312-cp312-win_amd64.whl

Download URL lightrun-1.97.2-cp312-cp312-win_amd64.whl
Size 126.8 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
5f65e5f4e35d23711fad5ba71d2844d053e99b3865a2d19389467b4e0630653a
BLAKE2b-256 checksum
How to use checksums
d02061f17913b72971155adbb015dac6d2fea20ec66f7e5b9d60ff236dfeb51e
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.2-cp312-cp312-musllinux_1_1_x86_64.whl

Download URL lightrun-1.97.2-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
b53f4adf00301777ea2756f4b661e826ed217d30a0bb61bd38595b4f7959c9a1
BLAKE2b-256 checksum
How to use checksums
773fd6f8b1e7d7ed84306c98c6405c2fbf6674cc312b2b3245bc8088cdffaf8f
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.2-cp312-cp312-manylinux2010_x86_64.whl

Download URL lightrun-1.97.2-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
1df6c418a2c42c652ea2745bde8af3e96095f67f12c7d9efa103d3a677789914
BLAKE2b-256 checksum
How to use checksums
fb9f322ca2889da178be78ae21a09983f5c285ac79dfbe74db75fefb0ca56b67
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.2-cp312-cp312-macosx_11_0_arm64.whl

Download URL lightrun-1.97.2-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
dfed5e72091023b3b485c4444c4d6320c1abe6a3b0ec7cf0d5fc9fc38a65b15d
BLAKE2b-256 checksum
How to use checksums
ad40ee6ecb958f4d72c284b8539f98c13af74df5202feeee6be69937d1250b44
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.2-cp311-cp311-win_amd64.whl

Download URL lightrun-1.97.2-cp311-cp311-win_amd64.whl
Size 135.6 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
7e888cebf22875172f64e6acd24611e87e974d1a2fc89625d8695f5aa0e7b0a7
BLAKE2b-256 checksum
How to use checksums
d13b0c2c16a9ab0dbccc60b364e84dedad2ed75e963f77eae411b0e6f39ed880
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.2-cp311-cp311-musllinux_1_1_x86_64.whl

Download URL lightrun-1.97.2-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
5f12c02b6b3c076822533948de3203002e1fb652c790cda3853e00615be616c8
BLAKE2b-256 checksum
How to use checksums
52ea226bfce5620242b963aab6c4b842c738f0ff28eb1c89ed7e2f5944cf8a7b
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.2-cp311-cp311-manylinux2010_x86_64.whl

Download URL lightrun-1.97.2-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
9ed30cac7fa2e9de14236f8b67ccf20f77acac2ca207533536c3e5529dde800b
BLAKE2b-256 checksum
How to use checksums
3ef3afdbb7cb27c8f0831b5e360bc3ec0a5078031a3f68007bbc83143a721aa5
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.2-cp311-cp311-macosx_11_0_arm64.whl

Download URL lightrun-1.97.2-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
e9bb48669c72257c77a84343098e083ba7d0eec8eb365da5b3b4699e8a7913d7
BLAKE2b-256 checksum
How to use checksums
bca909d19529dc0f591add8e06ef7f113df24554601fc21244ad068351c43b99
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.2-cp310-cp310-win_amd64.whl

Download URL lightrun-1.97.2-cp310-cp310-win_amd64.whl
Size 131.8 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
62ba30b31feb40efa9083fe7f01cfa60ffaf50d1ae19c32d6ca568e86ac35fa7
BLAKE2b-256 checksum
How to use checksums
11eaf9a9da2658c721bef85021d914f6324f01a4cf0bcf3c5aec5ad1b2aad55e
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.2-cp310-cp310-musllinux_1_1_x86_64.whl

Download URL lightrun-1.97.2-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
dc4ddde23c34169d670c3149513b186f883b72378dbdebf8eecd8507bd0908d2
BLAKE2b-256 checksum
How to use checksums
212044a955ed18769991675243330d45fedab57343555fde1e58234fda85f271
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.2-cp310-cp310-manylinux2010_x86_64.whl

Download URL lightrun-1.97.2-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
48045a3192228e53a44308c01057d27aef87e9b4a19058a3f9a2fa4dc84efc94
BLAKE2b-256 checksum
How to use checksums
27c5e211393701608b6fb77571de175ff5ad9f8cad2f6328ae666e376627b284
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.2-cp310-cp310-macosx_11_0_arm64.whl

Download URL lightrun-1.97.2-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
17bf598418d34220277664e0ac63d3e61d74114a29498870e514834c2753a6b5
BLAKE2b-256 checksum
How to use checksums
54a04ac8e33bce9562bd43b1865a99980ac8564cee09530ca4a67ddcb8514255
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.2

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