semvec/pypi-packages huggingface dataset:
infra-connectors 0.1.0
Async helpers that wrap Argo CD, Git providers, and Vault APIs.
Requires Python: >=3.10

# infra-connectors

`infra-connectors` bundles asynchronous helpers that wrap the HTTP APIs exposed by Argo CD, Git providers that implement the GitHub API, and HashiCorp Vault. The utilities were extracted from the Backstage provisioning service so other projects can reuse the same integration layer.

## Features

- Async clients that validate responses and raise typed exceptions.
- High-level helpers for synchronising Argo CD applications, manipulating Git repository contents, and managing Vault secrets.
- Shared logging configuration built on Loguru for consistent observability across services.
- Minimal dependency footprint so the utilities stay framework agnostic.

## Installation

```bash
pip install infra-connectors
```

## Usage

```python
from infra_connectors import ArgoCD, Git, Vault

argo = ArgoCD(
    base_url="https://argo.example.com",
    api_key="token",
    application_set_timeout=30,
)

git = Git(
    base_url="https://api.github.com/repos/org/repo",
    token="token",
)

vault = Vault(
    base_url="https://vault.example.com",
    token="token",
)
```

Each service exposes an underlying API client when you need lower-level control:

```python
import asyncio
from infra_connectors.argocd import ArgoCDAPI

async def main() -> None:
    api = ArgoCDAPI(base_url="https://argo.example.com", api_key="token")
    app = await api.get_application("example")
    print(app["metadata"]["name"])

asyncio.run(main())
```

The package raises rich exceptions that inherit from `infra_connectors.errors.ExternalServiceError`, making it simple to map failures to HTTP responses or retry logic.

See the module docstrings for additional usage examples.
neuralnetwork-base 0.1.0
A flexible neural network base model for regression tasks
Requires Python: >=3.8
Keywords: neural-network, machine-learning, regression, deep-learning

# Neural Network Base Model

A flexible, from-scratch implementation of neural networks for regression tasks.

## Features

- Customizable network architecture
- Linear and non-linear regression capabilities
- Built-in data preprocessing and scaling
- Model persistence with pickle
- Comprehensive examples included

## Best Practices

- Data Scaling: Always use scaler_fit_transform on training data and scaler_transform on test data
- Architecture: Start with simple architectures and increase complexity as needed
- Learning Rate: Typical values are between 0.001 and 0.1
- Epochs: Monitor loss to determine appropriate training duration
- Validation: Always validate on held-out test data

## Limitation
- Currently supports only linear activations (no non-linearities)
- Basic optimization (no momentum, Adam, etc.)
- No built-in regularization
- CPU-only implementation


## Installation

```bash
pip install neuralnetwork-base
pyzfn 1.0.6
micromagnetic post processing library
Requires Python: >=3.11

# pyzfn

**Pyzfn** is a Python library for post-processing micromagnetic simulation data generated by [amumax](https://github.com/MathieuMoalic/amumax), a fork of [mumax3](http://mumax.github.io/). It is designed for use with Zarr-backed datasets and supports spatially resolved frequency-domain analysis, visualization, and export of magnetization dynamics.

## Features

* 🧊 **Zarr-native API** for reading/writing simulation results
* ⚡ **FFT-based mode analysis** across 5D datasets (`(t, z, y, x, c)`)
* 📈 **Interactive spectrum visualization** with peak-picking
* 🌈 **Mode visualization** in amplitude and phase
* 🖼️ **Snapshot tools** for spatial magnetization structure
* 💾 **OVF (OOMMF Vector Field) export** for simulation interoperability
* 📚 Predefined theoretical **dispersion models** (Kittel, Kalinikos-Slavin, DMI-included...)

---

## Installation

```bash
pip install pyzfn
```

## Usage

### Loading a Zarr Dataset

```python
from pyzfn import Pyzfn

zfn = Pyzfn("my_simulation.zarr")
zfn.p  # Show tree structure
```

### Calculate Modes

```python
zfn.calc_modes(dset_in_str="m", dset_out_str="modes")
```

Performs time-FFT over magnetization and stores spatially resolved modes in `modes/...`.

### Visualize Frequency Spectrum + Modes

```python
zfn.ispec(dset_str="modes")
```

* Left: Spectral line plot
* Right: Mode amplitude, phase, and composite maps
* Click to explore frequency slices interactively

### Visualize a Snapshot

```python
zfn.snapshot(dset_str="m", t=-1, z=0)
```

Visualizes the magnetization vector field at a given time and layer.

---

## Dispersion Models

You can compute theoretical resonance frequencies for comparison:

```python
from pyzfn.equations import kittel_1948

f_res = kittel_1948(B=0.23, Ms=1.15e6, Ku=0.938e6)
print(f_res, "Hz")
```

Other supported models:

* `kalinikos_1986`, `kalinikos_1986_no_approx`
* `bottcher_2021`
* `kim_2016` (DMI included)
* `cortes_ortuno_2013`

---

## OVF Support

### Save to OVF

```python
from pyzfn.ovf import save_ovf

save_ovf("mode.ovf", array, dx=1e-9, dy=1e-9, dz=1e-9)
```

### Load from OVF

```python
from pyzfn.ovf import load_ovf

arr = load_ovf("mode.ovf")
```

---

## Development

### Run Tests

```bash
pytest
```

### Run Type Checks

```bash
mypy pyzfn
```

### Format & Lint

We use [`pre-commit`](https://pre-commit.com/) hooks:

```bash
pre-commit install
```
neuralnetwork-base-ahmadva23 0.1.2
A flexible neural network base model for regression tasks
Requires Python: >=3.8
Keywords: neural-network, machine-learning, regression, deep-learning

# Neural Network Base Model

A flexible, from-scratch implementation of neural networks for regression tasks.

## Features

- Customizable network architecture
- Linear and non-linear regression capabilities
- Built-in data preprocessing and scaling
- Model persistence with pickle
- Comprehensive examples included

## Best Practices

- Data Scaling: Always use scaler_fit_transform on training data and scaler_transform on test data
- Architecture: Start with simple architectures and increase complexity as needed
- Learning Rate: Typical values are between 0.001 and 0.1
- Epochs: Monitor loss to determine appropriate training duration
- Validation: Always validate on held-out test data

## Limitation
- Currently supports only linear activations (no non-linearities)
- Basic optimization (no momentum, Adam, etc.)
- No built-in regularization
- CPU-only implementation


## Installation

```bash
pip install neuralnetwork-base
stochastic-matching 0.4.0
Stochastic Matching provides tools to analyze the behavior of stochastic matching problems.
Requires Python: >=3.10

[![SM Logo](https://github.com/balouf/stochastic_matching/raw/master/docs/sm_logo.png)](https://balouf.github.io/stochastic_matching/)

# Stochastic Matching

[![PyPI Status](https://img.shields.io/pypi/v/stochastic_matching.svg)](https://pypi.python.org/pypi/stochastic_matching)
[![Build Status](https://github.com/balouf/stochastic_matching/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/balouf/stochastic_matching/actions?query=workflow%3Abuild)
[![Documentation Status](https://github.com/balouf/stochastic_matching/actions/workflows/docs.yml/badge.svg?branch=master)](https://github.com/balouf/stochastic_matching/actions?query=workflow%3Adocs)
[![License: MIT](https://img.shields.io/badge/license-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Code Coverage](https://codecov.io/gh/balouf/stochastic_matching/branch/master/graphs/badge.svg)](https://codecov.io/gh/balouf/stochastic_matching/tree/master/stochastic_matching)

Stochastic Matching provides tools to analyze the behavior of stochastic matching problems.


* Free software: MIT License
* Documentation: https://balouf.github.io/stochastic_matching/.

## Features

* Compatibility graph creation (from scratch, from one of the provided generator, or by some combination).
* Theoretical analysis:
    * Injectivity/surjectivity of the graph, kernel description.
    * Polytope description of positive solutions.
* Fast simulator.
    * Provided with a large set of greedy / non-greedy policies.
    * Adding new policies is feasible out-of-the-box.
* Lot of display features, including a [Vis JS Network][VIS] export.


## Installation

To install Stochastic Matching, run this command in your terminal:

```console
$ pip install stochastic_matching
```

This is the preferred method to install Stochastic Matching, as it will always install the most recent stable release.

## Acknowledging package

If you publish results based on [Stochastic Matching][SM], **please acknowledge** the usage of the package by quoting the following paper.

* Céline Comte, Fabien Mathieu, Sushil Mahavir Varma, Ana Bušić. [Online Stochastic Matching: A Polytope Perspective](https://hal.archives-ouvertes.fr/hal-03502084). 2024.

## Credits

This package was created with [Cookiecutter][CC] and the [Package Helper][PH3] project template.

[CC]: <https://github.com/audreyr/cookiecutter>
[PH3]: <https://balouf.github.io/package-helper-3/>
[VIS]: <https://visjs.github.io/vis-network/docs/network/>
[SM]: <https://balouf.github.io/stochastic_matching/>
iot-remote-lab 0.0.3
Iot Remote Lab
Requires Python: >=3.7

# IoT Remote Lab

A Flask-based web application for managing IoT devices through PlatformIO.

## Project Structure

```
IoT-Remote-Lab/
├── server/
│   └── src/
│       ├── app.py                 # Main Flask application
│       ├── config.py              # Configuration management
│       ├── exceptions.py          # Custom exceptions
│       ├── controllers/
│       │   ├── __init__.py
│       │   └── platformio_helper/
│       │       ├── __init__.py    # Module exports
│       │       ├── __main__.py    # CLI interface
│       │       ├── devices.py     # Device management classes
│       │       └── pio_helper.py  # PlatformIO interface
│       └── utils/
│           ├── __init__.py
│           └── logging_config.py  # Logging configuration
├── requirements.txt               # Python dependencies
└── README.md                     # This file
```

## Installation

1. Clone the repository
2. Create a virtual environment:
   ```bash
   python -m venv .venv
   .venv\Scripts\activate  # On Windows
   ```
3. Install dependencies:
   ```bash
   pip install -r requirements.txt
   ```

## Usage

### Running the Server

```bash
cd server/src
python app.py
```

### API Endpoints

- `GET /api/devices` - Get list of connected devices
- `GET /api/health` - Health check endpoint

### CLI Interface

```bash
cd server/src/controllers
python -m platformio_helper
```

## Configuration

Environment variables:
- `DEBUG`: Enable debug mode (default: true)
- `HOST`: Server host (default: 127.0.0.1)
- `PORT`: Server port (default: 5000)
- `LOG_LEVEL`: Logging level (default: INFO)
- `PLATFORMIO_TIMEOUT`: PlatformIO command timeout (default: 30)

## Architecture

The application follows a modular architecture with:

1. **Separation of Concerns**: Device management, configuration, and web interface are separate modules
2. **Error Handling**: Custom exceptions with proper error responses
3. **Logging**: Structured logging throughout the application
4. **Configuration Management**: Environment-based configuration
5. **Type Hints**: Full type annotations for better code quality

## Scalability Considerations

1. **Modular Design**: Easy to add new device types and controllers
2. **Configuration Management**: Environment-based configuration for different deployments
3. **Error Handling**: Proper exception hierarchy for different error types
4. **Logging**: Structured logging for monitoring and debugging
5. **API Design**: RESTful API design for easy integration
6. **Extensibility**: Easy to add new endpoints and functionality

## Future Enhancements

1. Database integration for device persistence
2. Real-time device monitoring with WebSockets
3. Device control and programming capabilities
4. Authentication and authorization
5. Docker containerization
6. Unit and integration tests
pageextractor 0.1.10
Use SAM2 to extract and warp a page from a photo.
Requires Python: >=3.10

# Page Extractor

Extracts a page from a photo, and warps it to a rectangular image using skimage.

## Features

- Remove margin clutter from photos of pages, usually improved document processing.
- GroundingDINO detection model integration.
- SAM 2.1
- Customizable text prompt, e.g. to "receipt." or "invoice."

## Getting Started

### Prerequisites

- Python 3.10 or higher

### Installation

#### Installing PyTorch Dependencies

Before installing `pageextractor`, install PyTorch:

```bash

pip install torch==2.4.1 torchvision==0.19.1 --extra-index-url https://download.pytorch.org/whl/cu124

```

#### Installation options

```bash

pip install -U git+https://github.com/UG-Team-Data-Science/pageextractor.git

```

Or:

```bash

git clone https://github.com/UG-Team-Data-Science/pageextractor && cd pageextractor
pip install -e .

```

### Usage

```python
from PIL import Image
from matplotlib import pyplot as plt

from pageextractor import PageExtractor

img = Image.open('example.png')
model = PageExtractor(sam_type='sam2.1_hiera_tiny', device='cuda')
mask, polygon, cropped = model.extract_page(img)

_, (ax0, ax1, ax2) = plt.subplots(1, 3, figsize=(30, 15))
ax0.imshow(img)

ax1.imshow(img)
ax1.plot(*polygon[[0,1,2,3,0]].T, 'r:')
ax1.imshow(1-mask, cmap='Blues', alpha=0.8 - 0.8*mask)

ax2.imshow(cropped)
```

### Examples

Photo of a book page, unfortunately centerfold and page block are included

![Photo of a book page, unfortunately centerfold and page block are included](https://github.com/UG-Team-Data-Science/pageextractor/blob/main/assets/example-03-processed.png?raw=true)

Photo of a letter

![Photo of a letter](https://github.com/UG-Team-Data-Science/pageextractor/blob/main/assets/example-04-processed.png?raw=true)

## Acknowledgments

This project is based on/used the following repositories:

- [GroundingDINO](https://github.com/IDEA-Research/GroundingDINO)
- [Segment-Anything](https://github.com/facebookresearch/segment-anything-2)
- [lang-segment-anything](https://github.com/luca-medeiros/lang-segment-anything/)
tme-eu 0.3.2
Api for TME.eu
Requires Python: >=3.10

# TME.eu API Client

```py
from tmeapi import TmeApi, Ok, ErrorValidation, ErrorSignature
import os

api = TmeApi(os.environ["TME_KEY"].strip(), os.environ["TME_APP_SECRET"].strip())

print(api.autocomplete("555"))
print(api.get_prices(["EL-MAKR04120PA-TC"]))
print(api.get_prices_and_stock(["EL-MAKR04120PA-TC"]))

resp = api.get_categories(tree=True, category_id=112140)
match resp:
    case Ok(Data=categories):
        products = api.get_symbols(categories.CategoryTree.Id).unwrap()
        product_details = api.get_products([products.SymbolList[0]]).unwrap()
        print(product_details.ProductList[0])

    case ErrorSignature() | ErrorValidation():
        print(f"Failed with {resp}")
```

NOTE: currently a limited api/typing surface, if you encounter any errors please submit an issue

[project.urls]
Homepage = "https://github.com/i404788/tme-api"
Repository = "https://github.com/i404788/tme-api"
jewei-mcp-server-template 0.10.6.1123
mcp server template
Requires Python: >=3.10

# MCP Server 项目模板

这是一个MCP Server 项目模板，提供了以下功能：

- 示例提供了工具hello_word_tool


## MCP 使用配置

本项目支持通过多种客户端配置 MCP 服务器，以便与各种 IDE 或工具集成。以下是一些常见客户端的配置示例：

### Claude Code
1. 配置文件
```json
{
  "mcpServers": {
    "context7": {
      "type": "stdio",
      "command": "uvx",
      "args": ["mcp-server-template"]
    }
  }
}

```
2. cli
```bash
claude mcp add mcp-server-template --scope project uvx mcp-server-template
```

### Windsurf / Cursor / Claude

对于基于 Windsurf 框架的客户端（如 Cursor 和 Claude），您可以在 `~/.codeium/windsurf/mcp_config.json` 文件中配置 MCP 服务器。以下是一个示例配置：

```json
{
  "mcpServers": {
    "mcp-server-template": {
      "disabled": false,
      "command": "uvx",
      "args": [
        "mcp-server-template"
      ]
    }
  }
}
```


### Cline

对于 Cline 客户端，您可以在其配置文件中添加类似的 MCP 服务器配置。具体的配置方式请参考 Cline 的官方文档。通常，您需要指定服务器的名称、命令、参数和环境变量。

```json
// Cline 配置文件示例 (具体格式请参考 Cline 文档)
{
  "mcpServers": {
    "mcp-server-template": {
      "command": "uvx",
      "args": [
        "mcp-server-template"
      ]
    }
  }
}
```

## 源码安装

1. 克隆仓库
2. 安装依赖：`pip install -r requirements.txt`
3. 配置环境变量（参见下文）

### 配置

在项目根目录创建`.env`文件，包含以下环境变量：

```
# 服务名
SERVER_NAME=My-MCP-Server
CONTEXT_PATH=
PORT=9087
TYPE=streamable-http
```

### 运行

### 运行命令
```bash
python server.py
```

### 使用uvx安装并运行（推荐）

```bash
uvx mcp-server-template
```


### 说明
1. “xxx.xx.xx.xxx”需要换成本机ip
2. 环境变量按实际需求配置
tuya-strip 0.1.3
CLI for controlling a Tuya 3-way power strip over LAN
Requires Python: >=3.13

# Tuya Outlet CLI

A simple Python CLI to control a Tuya-compatible 3-way smart power strip **over your local network** without using the Tuya cloud (except once during setup). Basically just a simple wrapper around the awesome [tinytuya](https://github.com/jasonacox/tinytuya) project.

## Features
- Turn each plug **on/off** individually
- Show status including plug states and energy data (voltage, current, power)
- Simple setup command for device configuration
- Robust configuration management with timeout and retry options

## Installation

### Option 1: Install from PyPI (System-wide)

```bash
pipx install tuya-strip
```

### Option 2: Install from Source (System-wide)

```bash
git clone https://github.com/wanjawischmeier/tuya-strip.git
cd tuya-strip
pipx install .
```

### Option 3: Install from Source (Local development)

1. Install [Poetry](https://python-poetry.org/docs/#installation)

2. Clone this repo:
```bash
git clone https://github.com/wanjawischmeier/tuya-strip.git
cd tuya-strip
```

3. Install dependencies:
```bash
poetry install
```
> [!NOTE]
> To enable `sudo tuya-strip` commands, create a system symlink:
> ```bash
> sudo ln -sf ~/.local/bin/tuya-strip /usr/local/bin/tuya-strip
> ```

## Setup

Configure your device credentials:
```bash
tuya-strip setup
```

For system-wide configuration (requires sudo):
```bash
sudo tuya-strip setup --system-wide
```

The setup command will prompt you to enter your device details (you can get these by running the [tinytuya setup wizard](https://github.com/jasonacox/tinytuya?tab=readme-ov-file#setup-wizard---getting-local-keys)):
- Device ID
  - Can be found in the respective `devices` entry in the generated `snapshot.json` -> `id` field
  - Or initially in the [cloud console](platform.tuya.com), under `<Your-Project> -> Devices -> All Devices -> Device ID`
- Device IP
  - Can be found in the same entry -> `ip` field
  - Or in the `devices.json` under the same field
- Local Key
  - Can be found in the same entry -> `key` field
  - Or in the `devices.json` under the same field
- Protocol Version (default: 3.3)
  - Can be found in the `devices.json`, at the very bottom of the respective device -> `version` field

Configuration is saved to your home directory (`~/.tuya-strip`) by default. Use `--system-wide` to store configuration in `/etc/tuya-strip/config` for all users.

> [!NOTE]  
> If you installed for local development, prefix all commands with `poetry run` (e.g., `poetry run tuya-strip setup`)

## Usage

```bash
tuya-strip status                    # Show current state and energy data
tuya-strip on 1                      # Turn on plug 1
tuya-strip off 3                     # Turn off plug 3
tuya-strip --timeout 5 status        # Use custom timeout
tuya-strip --retries 5 on 2          # Use custom retry count
```

## Example Output
```yaml
Loading config from: C:\Users\username\.tuya-strip
Switches: {'1': True, '2': False, '3': True}
Energy: {'voltage_V': 229, 'current_mA': 120, 'power_W': 24}
```
extremeflash 0.6.0
Automated flashing tool for Extreme Networks / Enterasys access points.
Requires Python: <4,>=3.9.2

# Extreme Flash

This tool allows flashing Enterasys / Extreme Networks access points fully automatically, using OpenWRT's initramfs image.

## Installation

Install the tool:

```commandline
pipx install extremeflash
```

or

```commandline
pip install extremeflash
```

## Usage

### Prerequisites

1. connect a USB serial device to the local machine and to the serial port of the Enterasys AP
2. identify the IP configured on the local machine that will be used to connect to the Enterasys AP
3. download an OpenWRT initramfs-kernel image, e.g. [for the WS-AP3710i](https://openwrt.org/toh/enterasys/ws-ap3710i#installation)
4. download an OpenWRT-based squashfs-sysupgrade, e.g. [for the WS-AP3710i](https://openwrt.org/toh/enterasys/ws-ap3710i#installation)

**Note**: While it is generally recommended to use the same version for initramfs-kernel and squashfs-sysupgrade, the process
can work with different versions. This is especially important if a downstream OpenWRT firmware (e.g. Gluon) with a different
version should be installed on the router.

### Run the tool

1. Make sure that the serial cable is connected to the access point, but it is not powered on yet

1. Run the tool
    * let it autodetect the serial port:

       ```commandline
       extremeflash --local-ip 192.168.1.70/24 \
       --model AP3710 \
       -i ~/Downloads/openwrt-23.05.0-mpc85xx-p1020-enterasys_ws-ap3710i-initramfs-kernel.bin \
       -j ~/Downloads/openwrt-22.03.3-mpc85xx-p1020-enterasys_ws-ap3710i-squashfs-sysupgrade.bin
       ```

    * or manually specify the serial port:

       ```commandline
       extremeflash  --port /dev/ttyUSB0 --local-ip 192.168.1.70/24 \
       --model AP3710 \
       -i ~/Downloads/openwrt-23.05.0-mpc85xx-p1020-enterasys_ws-ap3710i-initramfs-kernel.bin \
       -j ~/Downloads/openwrt-22.03.3-mpc85xx-p1020-enterasys_ws-ap3710i-squashfs-sysupgrade.bin
       ```

    * For more information run:

       ```commandline
       extremeflash --help
       ```

1. Power the access point and connect the LAN cable to power the AP.\
   **Note**: for APs with two or more LAN ports, make sure the local machine is connected to port 2, not port 1.

1. The tool will flash the access point automatically. When it finishes, the access point
   can be reached via `192.168.1.1` (OpenWRT's default IP).

## Contributing

### Install dependencies

If the dependencies are not already installed, run `poetry install` followed by a `poetry shell` to get an environment with all necessary dependencies.

### Running modified code

After modifying the code, run the tool by executing `python -m extremeflash` inside the repository's folder. For example:

```commandline
python3 -m extremeflash --help
```