semvec/pypi-packages huggingface dataset:
fastapi-sse-wrapper 0.1.0
A small, production-minded SSE wrapper for FastAPI-based AI agents and chatbots.
License: MIT
Requires Python: >=3.10

# fastapi-sse-wrapper

A small, professional SSE (Server-Sent Events) wrapper for FastAPI, designed to help developers build streaming AI agent and chatbot backends.

---

## ✨ Features

* **Named channels** with multiple client connections
* **Broadcast** and **targeted messages**
* **Message history & replay** for reconnection support
* **Keepalive pings** and recommended HTTP headers
* **Authentication hooks** (pluggable)
* **Minimal dependencies** (FastAPI + Uvicorn)
* **Typed public API** and examples

---

## 📦 Installation

```bash
pip install fastapi-sse-wrapper
```

---

## 🚀 Quick Start

### Create SSE Manager and Endpoint

```python
from fastapi import FastAPI
from fastapi_sse.core import SSEManager
from fastapi_sse.events import SSEEvent

app = FastAPI()
manager = SSEManager(app=app)

# Register SSE endpoint for channel "chat"
app.add_api_route("/sse/chat/{client_id}", manager.endpoint("chat"), methods=["GET"])
```

### Send Events

```python
@app.post("/send/{channel}")
async def send_message(channel: str, payload: dict):
    ch = manager.channel(channel)
    ev = SSEEvent(data=payload, event="message")
    await ch.send(ev)
    return {"status": "ok", "id": ev.id}
```

### Connect Client

Browser client using **EventSource**:

```js
const es = new EventSource("http://127.0.0.1:8000/sse/chat/myclient");
es.onmessage = e => console.log("msg", e.data);
es.addEventListener("message", e => console.log("event:message", e.data));
```

---

## 🧠 Example: Streaming AI Agent Tokens

```python
@app.post("/agent/send/{conversation_id}")
async def agent_send(conversation_id: str, payload: dict):
    ch = manager.channel("agent")
    start = SSEEvent(data={"cid": conversation_id, "status": "started"}, event="agent.start")
    await ch.send(start)

    for token in ["Hello", ",", " this", " is", " streamed"]:
        await asyncio.sleep(0.5)
        ev = SSEEvent(data={"cid": conversation_id, "token": token}, event="agent.token")
        await ch.send(ev)

    done = SSEEvent(data={"cid": conversation_id, "status": "done"}, event="agent.done")
    await ch.send(done)
    return {"started": True}
```

---

## 🔒 Authentication

Use an auth hook:

```python
from fastapi_sse.middleware import token_auth_hook_factory

def token_lookup(token: str):
    return "user1" if token == "secret" else None

manager = SSEManager(app, auth_hook=token_auth_hook_factory(token_lookup))
```

---

## 📂 Project Structure

```
fastapi-sse-wrapper/
├─ fastapi_sse/
│  ├─ core.py         # Manager + connections
│  ├─ events.py       # SSEEvent model
│  ├─ middleware.py   # Auth hook helpers
│  ├─ backends.py     # In-memory history backend
│  └─ utils.py
├─ examples/
│  ├─ simple_app.py
│  └─ agent_integration.py
├─ tests/
└─ README.md
```

---

## ⚡ Roadmap

* Redis backend for multi-worker support
* Advanced reconnection + replay strategies
* Rate limiting and access control
* TypeScript/JS client SDK

---

## 📜 License

MIT License.
python-web3-wallet 0.0.17
Streamlit component that allows users to connect a wallet and send transactions with dynamic recipients and amounts
License: MIT
Requires Python: <4.0,>=3.10

# Python Web3 Wallet

Streamlit component that allows you to connect a wallet and trigger send transactions.

## Installation instructions

```sh
pip install web3-wallet-connect
```
 
## Usage instructions

```python
import streamlit as st

from python_web3_wallet import wallet_component

c = wallet_component(recipient="0x...", amount_in_ether="0.01")  # Displays RainbowKit wallet
# Optionally data (as a Hex-formatted string) can be passed to populate the data field when sending a transaction.
# c = wallet_component(recipient="0x...", amount_in_ether="0.01", data="0x78da2b492d2e0100045d01c1")
```
msread 0.10.1
Mass spectrometry data reading library
License: MIT

# MSRead

The MSRead module enables a simple reading of popular Mass Spectrometry data
formats including: mzData, mzXML, mzML, MGF, ASCII XY and Thermo Raw files.

```python
    
    import msread
    
    # open file
    with msread.read("myfile.mzML") as reader:
        
        # show summary
        reader.summary(show=True)
        
        # read headers only
        for header in reader.headers(min_rt=5*60, max_rt=10*60, ms_level=1):
            print(header)
        
        # read scans
        for scan in reader.scans(min_rt=5*60, max_rt=10*60, ms_level=1):
            print(scan.header)
            print(scan.centroids)
```

## Requirements:

- Python 3.7
- Numpy
- [comtypes] (To read Thermo Raw files. Windows only.)
- [MSFileReader] (To read Thermo Raw files. Windows only.)


## Install from source:

$ python setup.py install

or

$ pip install .


## Reading Thermo Raw files:

To enable Thermo Raw files reading you need to download and install the
MSFileReader by creating an account at:

https://thermo.flexnetoperations.com/control/thmo/login

then logging in and choosing "Utility Software". Current version is developed
using MSFileReader v3.1 SP2.


## Disclaimer:

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE.

For Research Use Only. Not for use in diagnostic procedures.
logs-py-solutions 0.3.4
Prebuild solution library for the logs-py package
License: MIT
Requires Python: >=3.8

# LOGS-Py Solutions

**LOGS-Py Solutions** is a library built on top of the `logs-py` package to provide ready-to-use examples and solutions for common challenges faced by data scientists working with LOGS, a scientific data management system (SDMS). This library is designed to simplify and accelerate the development of workflows and integrations with LOGS by offering pre-built tools and templates.

## About LOGS and LOGS-Py

LOGS is a scientific data management system that enables automated data collection, visualization, and organization. It allows users to enrich experimental data with metadata and adapt organizational structures to fit internal workflows.

The `logs-py` package provides a Pythonic interface to interact with the LOGS web API, enabling users to extract, push, and manipulate data programmatically. It abstracts away the complexities of API communication, allowing lab and data scientists to focus on their data without needing prior knowledge of web technologies.

## About LOGS-Py Solutions

This library extends the functionality of `logs-py` by offering:
- **Pre-built solutions** for common data management and workflow automation tasks.
- **Example files** to help users get started quickly.
- **Utilities** to address recurring challenges in scientific data management.

The goal is to empower users to:
1. Quickly implement solutions for common problems without starting from scratch.
2. Customize workflows and integrations with minimal effort.

## Installation

To use LOGS-Py Solutions, please install it via pip:

```bash
pip install logs-py-solutions
```

## Getting started

Please check our <a href="https://docs.logs-python.com">online documentation</a> for examples.

## Contributing
Contributions are welcome! If you have ideas for new solutions or improvements please let us know.