Metadata-Version: 2.4
Name: lognexis-py
Version: 1.0.2
Summary: Official Python SDK for LogNexis API Monitoring & Observability
Home-page: https://lognexis.online
Author: Gopal562004
Author-email: support@lognexis.online
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Framework :: FastAPI
Classifier: Framework :: Flask
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: requests
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# LogNexis Python SDK

The official Python tracking SDK for **LogNexis** — the lightweight, real-time API monitoring, analytics, and observability platform.

**Website:** [https://lognexis.online](https://lognexis.online)  
**Documentation:** [https://lognexis.online/docs](https://lognexis.online/docs)

## What it does
Automatically capture API request logs, HTTP errors, latency metrics, and real-world performance without blocking your application threads. Includes drop-in middlewares for FastAPI and Flask!

## Installation

```bash
pip install lognexis-py
```

## Quick Start (FastAPI)

```python
from fastapi import FastAPI
from lognexis import LogNexisFastAPI

app = FastAPI()

# Add the LogNexis middleware
app.add_middleware(LogNexisFastAPI, api_key="YOUR_LOGNEXIS_API_KEY")

@app.get("/")
def read_root():
    return {"Hello": "World"}
```

## Quick Start (Flask)

```python
from flask import Flask
from lognexis import LogNexisFlask

app = Flask(__name__)

# Add the LogNexis tracking hook
LogNexisFlask(app, api_key="YOUR_LOGNEXIS_API_KEY")

@app.route("/")
def hello():
    return "Hello World!"
```

## Manual Usage

If you aren't using FastAPI/Flask or want to log background jobs:

```python
from lognexis.client import LogNexisClient

client = LogNexisClient("YOUR_LOGNEXIS_API_KEY")

client.capture({
    "endpoint": "/custom-cron-job",
    "method": "POST",
    "statusCode": 200,
    "latency": 45.2
})
```

## How it works
This SDK uses python's built-in `threading` and the lightweight `requests` library. It operates in a completely "fire-and-forget" background thread, meaning your application will NEVER crash and your API response times will NEVER be slowed down by this SDK.
