semvec/pypi-packages huggingface dataset:
mcp-db-server 0.1.3
MCP Database Server with read-only access
License: MIT
Requires Python: >=3.10

# MCP Database Server

A [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server implementation in Python that provides **strictly read-only** access to databases. It allows Large Language Models (LLMs) to inspect schemas and query data safely without risking data modification.

## Features

- **🛡️ Strict Read-Only**: Enforced at the driver level (e.g., SQLite `?mode=ro`) or session level (MySQL `SET SESSION TRANSACTION READ ONLY`).
- **🏗️ Repository Pattern**: Abstracted database access allows for easy extension to other backends (PostgreSQL, MySQL) via Dependency Injection.
- **⚡ FastMCP**: Built efficiently using the official MCP Python SDK.
- **🔌 Connection Pooling**: Automatic connection pooling for MySQL using `DBUtils` to ensure performance and reliability.
- **🔧 Easy Configuration**: Managed via environment variables and Makefiles.

## Project Structure

- `mcp_db_server/`: Main Python package for the MCP server.
  - `__init__.py`: Entry point and server initialization.
  - `db/`: Repository implementations (`sqlite_repository.py`, `mysql_repository.py`).
- `seed.py`: Utility script to populate the database (write access).
- `Makefile`: Automation for common tasks.
- `pyproject.toml`: Package configuration and dependencies.

## Quick Start

### Prerequisites
- Python 3.12+ (managed via `venv`)
- `make` (optional, but recommended)
- MySQL Server (optional, if using MySQL backend)

### 1. Setup
Use the Makefile to create a virtual environment, install dependencies, and seed a test database:

```bash
make setup
```

*This runs `pip install -r requirements.txt` and `python seed.py`.*

### 2. Configuration
The project uses `python-dotenv`. Copy the example config and adjust as needed:

```bash
cp .env.example .env
```

**Key Variables:**
- `DB_ENGINE`: `sqlite` (Default) or `mysql`
- `DB_ADDRESS`: Path to db file (SQLite) or Host URL (MySQL).
- `DB_PORT`: Database port (Default: 3306 for MySQL).
- `DB_USER` / `DB_PASSWORD`: Database credentials (required for MySQL).
- `DB_SCHEMA`: Database name (required for MySQL).

### 3. Run the Server
Start the MCP server:

```bash
make run
```
*(Or directly via `venv/bin/python server.py`)*

## Usage with LLMs

Once running, the server exposes the following tools to connected MCP clients:

1.  **`list_tables()`**
    - Returns a list of all tables in the database.
2.  **`describe_table(table_name: str)`**
    - Returns the schema (columns, types, primary keys) for the specified table.
3.  **`read_query(query: str)`**
    - Executes a SQL `SELECT` query.
    - **Note**: Queries attempting to modify data will raise a `Security Error` or `OperationalError`.

## Development

### Running Tests
Execute the unit test suite:

```bash
make test
```

### Extending
To add support for a new database (e.g., Postgres):
1.  Create `db/postgres_repository.py` implementation of `DatabaseRepository`.
2.  Update `server.py` to instantiate it when `DB_ENGINE=postgres`.
rknncli 0.3.3
A command line tool for parsing and displaying RKNN model information
License: MIT
Requires Python: >=3.8
Keywords: rknn, rockchip, neural network, model parser, cli

# RKNN CLI

A command line tool for parsing and displaying RKNN model information with FlatBuffers support.

## Features

- Parse both FlatBuffers binary data and JSON metadata from RKNN files
- Extract detailed model information including format, compiler, runtime
- Display input/output tensor information with layout (NCHW) and data type
- Visualize FlatBuffers graph with Graphviz (SVG output)
- Python 3.8+ compatible

## Installation

### From PyPI (Recommended)

```bash
pip install rknncli
```

### Development Installation

```bash
git clone https://github.com/your-username/rknncli.git
cd rknncli
pip install -e .
```

## Usage

```bash
rknncli <path-to-rknn-model>
```

Example:

```bash
rknncli assets/base-encoder.rknn
```

Graph visualization:

```bash
rknncli assets/base-encoder.rknn --draw base-encoder.svg
```

Note: Graph visualization requires Graphviz installed and `dot` available in `PATH`.

## Output Format

The tool prints comprehensive model information including FlatBuffers metadata:

```
Model: rknn model
Target Platform: rk3588
Format: RKNPU v2
Source: ONNX
Compiler: 2.1.0+708089d1(compiler version: 2.1.0)
Runtime: rk3588
Number of graphs: 1

Input information
--------------------------------------------------------------------------------
  ValueInfo "base-mel": type FLOAT32, shape [1, 80, 3000], layout NCHW,

Output information
--------------------------------------------------------------------------------
  ValueInfo "cross_k_0": type FLOAT16, shape [1, 1500, 512], layout NCHW,
  ValueInfo "cross_v_0": type FLOAT16, shape [1, 1500, 512], layout NCHW,
```

## Development

### Prerequisites

- Python 3.8+
- FlatBuffers compiler (for schema updates)

### Setup

```bash
# Clone the repository
git clone https://github.com/hebangwen/rknncli.git
cd rknncli

# Install in development mode
pip install -e .

# Run tests
rknncli assets/base-encoder.rknn
```

### Updating FlatBuffers Schema

If you need to update the RKNN schema:

```bash
cd schemas
./generate_schema.sh
```

### Publishing to PyPI

To publish a new version:

```bash
# Build the package
python -m build

# Upload to PyPI
./scripts/upload_to_pypi.sh
```

## Changelog

See [CHANGELOG.md](CHANGELOG.md) for version history.

## License

MIT License - see LICENSE file for details.
bitl-debug 0.1.0
Debug utilities for Python with BitL Debug Bar integration
License: MIT
Requires Python: >=3.10
Keywords: bitl, debug, dump, dd, ray, laravel, django, flask

# bitl-debug

> Debug utilities for Python with BitL Debug Bar integration.

[![PyPI version](https://img.shields.io/pypi/v/bitl-debug.svg)](https://pypi.org/project/bitl-debug/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

## Installation

```bash
pip install bitl-debug

# With Django support
pip install bitl-debug[django]

# With Flask support  
pip install bitl-debug[flask]
```

## Quick Start

```python
from bitl_debug import dump, dd

# Dump a value (continues execution)
dump({"user": "John", "age": 30})
dump(my_variable, "My Label")

# Dump and die (stops execution)
dd(suspicious_value)
```

## Features

### dump(value, label=None)

Send a value to BitL Debug Bar. Returns the value for chaining.

```python
from bitl_debug import dump

user = {"name": "John", "email": "john@example.com"}
dump(user, "Current User")

# Chain dumps
result = dump(calculate_something())
```

### dd(value, label=None)

Dump and die - sends a value and exits the process.

```python
from bitl_debug import dd

# Debug and stop here
dd(suspicious_value, "Check this!")

# Code below never runs
```

### log_error(error, label=None)

Log errors with full stack traces.

```python
from bitl_debug import log_error

try:
    risky_operation()
except Exception as e:
    log_error(e)
    # Handle error...
```

### log_query(sql, bindings=None, duration_ms=None)

Log database queries with timing.

```python
from bitl_debug import log_query

log_query("SELECT * FROM users WHERE id = %s", [1], 12.5)
```

## Django Integration

Add the middleware to your `settings.py`:

```python
MIDDLEWARE = [
    'bitl_debug.middleware.DjangoMiddleware',
    # ... other middleware
]
```

All requests will be automatically logged to BitL Debug Bar.

## Flask Integration

```python
from flask import Flask
from bitl_debug.middleware import flask_middleware

app = Flask(__name__)
flask_middleware(app)

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

## Configuration

```python
from bitl_debug import configure

configure(
    host="127.0.0.1",  # BitL debug server host
    port=8765,         # BitL debug server port
    enabled=True,      # Enable/disable debugging
)

# Disable in production
import os
configure(enabled=os.environ.get("DEBUG", "false").lower() == "true")
```

## Requirements

- Python 3.10+
- BitL app running with Debug Server enabled

## License

MIT