Metadata-Version: 2.4
Name: paylink-tracer
Version: 0.1.5
Summary: Lightweight internal SDK for tracing Paylink payment operations - automatically logs and sends tool execution data to Paylink API
Project-URL: Homepage, https://github.com/paylink/paylink-tracer
Project-URL: Repository, https://github.com/paylink/paylink-tracer
Project-URL: Documentation, https://github.com/paylink/paylink-tracer#readme
Project-URL: Bug Tracker, https://github.com/paylink/paylink-tracer/issues
Author-email: PayLink <paylinkmcp@gmail.com>
Maintainer-email: PayLink <paylinkmcp@gmail.com>
License: MIT License
        
        Copyright (c) 2025 Paylink
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
License-File: LICENSE
Keywords: apm,distributed-tracing,mcp,monitoring,mpesa,observability,paylink,payments,telemetry,tracing
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Monitoring
Requires-Python: >=3.9
Requires-Dist: hatch>=1.14.2
Requires-Dist: twine>=6.2.0
Provides-Extra: dev
Requires-Dist: black>=23.0.0; extra == 'dev'
Requires-Dist: hatch>=1.14.1; extra == 'dev'
Requires-Dist: mypy>=1.0.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Requires-Dist: twine>=6.2.0; extra == 'dev'
Provides-Extra: dotenv
Requires-Dist: python-dotenv>=1.0.1; extra == 'dotenv'
Description-Content-Type: text/markdown

# Paylink Tracer SDK

Lightweight internal SDK for tracing Paylink payment operations.  

## 🚀 Quick Start

### 1. Install

```bash
uv add paylink-tracer
```

### 2. Configure

Set the required environment variables (or use a `.env` file):

```bash
PAYLINK_API_KEY=plk_live_xxxxx
PAYLINK_PROJECT=Demo Project
PAYMENT_PROVIDER=["mpesa"]
PAYLINK_TRACING=enabled
```

### 3. Use the Decorator

```python
from paylink_tracer import paylink_tracer

@paylink_tracer
async def call_tool(name: str, arguments: dict):
    # Your payment logic here
    return {"status": "success", "message": "Payment processed"}

# Example call
await call_tool("stk_push", {"amount": "1000", "phone": "254700000000"})
```

## 🧠 Notes

- Automatically sends traces to `http://127.0.0.1:8000/api/v1/trace` (local dev)
- Use `set_base_url("https://api.paylink.co.ke")` for production
- Works with async functions
- Automatically captures errors, arguments, and timing
- Disable tracing with `PAYLINK_TRACING=disabled`

## 👨‍💻 Internal Use Only

This SDK is intended for internal Paylink use.  
For issues or updates, contact the Paylink engineering team.

## 📄 License

MIT License - see LICENSE file for details.
