semvec/pypi-packages huggingface dataset:
netbox-interface-name-rules 1.0.0
NetBox plugin for automatic interface renaming when modules are installed
Requires Python: >=3.12.0

# NetBox Interface Name Rules Plugin

Automatic interface renaming when modules are installed into NetBox device bays.

## What it does

When a module (transceiver, line card, converter) is installed into a module bay,
NetBox creates interfaces using position-based naming from the module type template.
This often produces incorrect names — e.g., `Interface 1` instead of `et-0/0/4`.

This plugin hooks into Django's `post_save` signal on the `Module` model to
automatically apply renaming rules based on configurable templates.

## Features

- **Signal-driven** — rules fire automatically on module install, no manual step needed
- **Template variables** — `{slot}`, `{bay_position}`, `{bay_position_num}`, `{base}`, `{channel}`, etc.
- **Arithmetic expressions** — `{8 + ({parent_bay_position} - 1) * 2 + {sfp_slot}}`
- **Breakout support** — create multiple channel interfaces from a single port (e.g., QSFP+ 4x10G)
- **Scoping** — rules can be scoped to specific device types, parent module types, or be universal
- **Bulk import/export** — YAML-based rule management via the UI or API

## Supported scenarios

| Scenario | Example |
|----------|---------|
| Converter offset | GLC-T in CVR-X2-SFP → `GigabitEthernet3/10` |
| Breakout channels | QSFP-4X10G-LR → `et-0/0/4:0` through `et-0/0/4:3` |
| Platform naming | QSFP-100G-LR4 on ACX7024 → `et-0/0/{bay_position}` |
| UfiSpace breakout | QSFP-100G on S9610 → `swp{bay_position_num}s{channel}` |

## Installation

```bash
pip install netbox-interface-name-rules
```

Add to `configuration.py`:
```python
PLUGINS = ['netbox_interface_name_rules']
```

## Compatibility

- NetBox ≥ 4.2.0
- Python ≥ 3.12

## License

Apache 2.0
nadeshiko-internal-sdk 1.4.3.dev1771571466
Python SDK for Nadeshiko API (internal build - includes internal endpoints)
Requires Python: >=3.11

# Nadeshiko SDK

Python SDK for the [Nadeshiko API](https://nadeshiko.co).

## Install

```bash
pip install nadeshiko-sdk
```

## Use the public SDK

The client sends your API key as `Authorization: Bearer <apiKey>`.

```python
import os

from nadeshiko import Nadeshiko
from nadeshiko.api.search import search
from nadeshiko.models import Error, SearchRequest

client = Nadeshiko(
    base_url=os.getenv("NADESHIKO_BASE_URL", "https://api.nadeshiko.co"),
    token=os.getenv("NADESHIKO_API_KEY", "your-api-key"),
)

result = search.sync(
    client=client,
    body=SearchRequest(query="彼女"),
)

if isinstance(result, Error):
    print(result.code, result.detail)
else:
    for sentence in result.sentences:
        print(sentence.segment_info.content_jp)
```

### Error handling

Every response returns either a typed response object or an `Error`. The `Error` object follows the [RFC 7807](https://tools.ietf.org/html/rfc7807) Problem Details format, so you always get a machine-readable `code` and a human-readable `detail`.

```python
import os

from nadeshiko import Nadeshiko
from nadeshiko.api.search import search
from nadeshiko.models import Error, SearchRequest

client = Nadeshiko(
    base_url=os.getenv("NADESHIKO_BASE_URL", "https://api.nadeshiko.co"),
    token=os.getenv("NADESHIKO_API_KEY", "your-api-key"),
)

result = search.sync(
    client=client,
    body=SearchRequest(query="食べる"),
)

if isinstance(result, Error):
    match result.code:
        # 400 — Bad Request
        case "VALIDATION_FAILED":
            print("Validation failed:", result.detail)
        case "INVALID_JSON":
            print("Malformed JSON body:", result.detail)
        case "INVALID_REQUEST":
            print("Invalid request:", result.detail)

        # 401 — Unauthorized
        case "AUTH_CREDENTIALS_REQUIRED":
            print("Missing API key or session token")
        case "AUTH_CREDENTIALS_INVALID":
            print("API key is invalid")
        case "AUTH_CREDENTIALS_EXPIRED":
            print("Token has expired, re-authenticate")
        case "EMAIL_NOT_VERIFIED":
            print("Email verification required")

        # 403 — Forbidden
        case "ACCESS_DENIED":
            print("Access denied")
        case "INSUFFICIENT_PERMISSIONS":
            print("API key lacks the required scope")

        # 429 — Too Many Requests
        case "RATE_LIMIT_EXCEEDED":
            print("Rate limit hit, slow down")
        case "QUOTA_EXCEEDED":
            print("Monthly quota exhausted")

        # 500 — Internal Server Error
        case "INTERNAL_SERVER_EXCEPTION":
            print("Server error, trace ID:", result.instance)
else:
    for sentence in result.sentences:
        print(sentence.segment_info.content_jp, "—", sentence.basic_info.name_anime_en)
```

See [`examples/examples.py`](examples/examples.py) for more usage patterns.