semvec/pypi-packages huggingface dataset:
seliseblocks-lmt 0.0.3
Logging, Monitoring, and Tracing library for Selise Blocks applications using Azure Service Bus.
Requires Python: >=3.9
Keywords: Azure Service Bus, LMT, Logging, Monitoring, OpenTelemetry, Selise, Selise Blocks, Tracing

# Selise Blocks LMT

Selise Blocks LMT (Logging, Monitoring, and Tracing) library for Selise Blocks applications.
It sends logs and traces to Azure Service Bus for centralized processing.

---

## Installation

Using pip:

```bash
pip install seliseblocks-lmt
```

Using uv:

```bash
uv add seliseblocks-lmt
```

Add to `pyproject.toml`:

```toml
[project]
dependencies = [
    "seliseblocks-lmt>=0.0.1",
]
```

---


## Complete Example

```python
import logging
from fastapi import FastAPI, Request
from opentelemetry.instrumentation.fastapi import FastAPIInstrumentor
from blocks_lmt.log_config import configure_logger
from blocks_lmt.tracing import configure_tracing
from blocks_lmt.activity import Activity

app = FastAPI(title="Example Service with LMT")
FastAPIInstrumentor.instrument_app(app)

configure_logger(
    x_blocks_key="default-tenant",
    blocks_service_id="example-service",
    connection_string="Endpoint=sb://your-namespace.servicebus.windows.net/;..."
)

configure_tracing(
    x_blocks_key="default-tenant",
    blocks_service_id="example-service",
    connection_string="Endpoint=sb://your-namespace.servicebus.windows.net/;..."
)

logger = logging.getLogger(__name__)

@app.get("/")
async def root():
    logger.info("Root endpoint called")
    with Activity.start("handle_root_request") as activity:
        activity.set_property("endpoint", "/")
        return {"message": "Hello World"}

@app.get("/health")
async def health(request: Request):
    logger.info("Health endpoint called")
    Activity.set_current_properties({
        "http.query": str(dict(request.query_params)),
        "http.headers": str(dict(request.headers))
    })
    return {"status": "healthy"}
```

---

## Activity API Reference

### Context Manager

```python
with Activity.start("operation_name") as activity:
    activity.set_property("key", "value")
    activity.set_properties({"key1": "val1", "key2": "val2"})
```

### Status Handling

```python
from opentelemetry.trace import StatusCode

Activity.set_current_status(StatusCode.ERROR, "Error message")
```

---

## Best Practices

1. Always instrument FastAPI:

```python
FastAPIInstrumentor.instrument_app(app)
```

2. Use context managers for activities to ensure proper cleanup:

```python
with Activity.start("operation"):
    ...
```

3. Log inside active spans to maintain trace correlation:

```python
logger.info("This log is trace-correlated")
```

4. Add meaningful properties to activities:

```python
activity.set_property("user_id", user_id)
```

---

## Dependencies

```toml
azure-servicebus = ">=7.14.2"
opentelemetry-api = ">=1.33.1"
opentelemetry-sdk = ">=1.33.1"
opentelemetry-instrumentation-fastapi = ">=0.54b1"
```
wwpdb.utils.config 0.53.0
wwPDB Python Configuration Parsing
Requires Python: >=2.7

# OneDep Configuration Utility Library

[![Build Status](https://dev.azure.com/wwPDB/wwPDB%20Python%20Projects/_apis/build/status/wwPDB.py-wwpdb_utils_config?branchName=master)](https://dev.azure.com/wwPDB/wwPDB%20Python%20Projects/_build/latest?definitionId=2&branchName=master)

## Introduction

This repository povides the tools and access to OneDep configuration environments.

### Installation

Download the library source software from the project repository:

```bash

git clone --recurse-submodules https://github.com/wwpdb/py-wwpdb_utils_config.git

```

Optionally, run test suite using the Tox test runner

```bash
python setup.py test

or simply run

tox

Installation is via the program [pip](https://pypi.python.org/pypi/pip).

```bash
pip install wwpdb.utils.config

or from the local repository:

pip install .
```
odds-helpers 0.0.2
A series of useful functions in betting.
Requires Python: >=3.1

### odds-helpers

## Functions

| Function | Parameters | Aliases | Description |
|----------|------------|---------|-------------|
| `moneyline_to_prob` | `ml`, `places=2` | `to_p`, `to_prob`, `ml_to_p`, `ml_to_prob` | Converts a moneyline to implied probability |
| `prob_to_moneyline` | `prob` | `to_ml`, `p_to_ml`, `prob_to_ml` | Converts a probability to moneyline format |
| `remove_vig` | `prob1`, `prob2` | `no_vig` | Removes the vig from two probabilities, returning fair odds |
| `total_juice` | `ml1`, `ml2` | `juice` | Calculates the total juice/vig from two moneylines |
| `payout` | `price`, `wager` | `profit` | Calculates the payout for a given price and wager amount |
| `base_to_risk` | `ml`, `base_amt` | — | Converts a base amount to risk amount based on moneyline |
| `ml_to_fractional` | `ml` | — | Converts moneyline to fractional odds |
| `get_ev` | `ml`, `est_prob`, `unit=1`, `verbose=True` | — | Calculates expected value given moneyline and estimated probability |
| `get_kelly` | `p`, `ml`, `verbose=True` | — | Calculates Kelly criterion bet fraction |