Veloce API - Python Клиент
English | Русский
Официальная Python библиотека для работы с API панели управления Veloce VPN.
✨ Возможности
- 🚀 Полное покрытие API - Все эндпоинты панели Veloce
- 🔄 Async/Await - Полная асинхронная поддержка
- 🛡️ Типобезопасность - Pydantic модели и type hints
- 🔁 Автоповтор - Экспоненциальная задержка при ошибках
- 🎯 Простота - Интуитивный API
- 📦 Free & Paid тарифы - Автоматическое управление
- 🔑 API ключи - Безопасная аутентификация
- 📊 Всё включено - Пользователи, ноды, система, инбаунды
📦 Установка
pip install veloce-api
🚀 Быстрый Старт
from veloce import VeloceClient
# Инициализация клиента
client = VeloceClient(
base_url="https://your-panel.com/api",
api_key="your_api_key"
)
# Создать бесплатного пользователя
url = await client.users.create_free("username123")
print(f"Ссылка подписки: {url}")
# Продлить подписку
await client.users.extend_subscription("username123", days=30)
# Получить данные пользователя
user = await client.users.get("username123")
print(f"Статус: {user['status']}, Истекает: {user['expire']}")
📚 API Модули
Пользователи (client.users)
Полное управление пользователями с поддержкой free/paid тарифов:
# Создание пользователей
await client.users.create_free("user123")
await client.users.create_paid("user456", days=30)
# Управление подписками
await client.users.extend_subscription("user123", days=30)
await client.users.get_subscription_url("user123")
# Операции с пользователями
await client.users.list(offset=0, limit=10, status="active")
await client.users.ban("user123")
await client.users.reset_traffic("user123")
Система (client.system)
Системная статистика и операции:
# Получить статистику
stats = await client.system.get_stats()
print(f"Всего пользователей: {stats['total_user']}")
print(f"Активных: {stats['users_active']}")
# Управление ядром
await client.system.restart_core()
config = await client.system.get_core_config()
# Управление IP Лимитами
await client.system.update_ip_limit(
global_ip_limit=2,
ip_limit_ban_delay=10,
max_concurrent_inbounds=1
)
Ноды (client.nodes)
Управление нодами:
# Список нод
nodes = await client.nodes.list()
# Операции с нодами
await client.nodes.create(node_data)
await client.nodes.update(node_id, node_data)
await client.nodes.reconnect(node_id)
Админы (client.admin)
Операции администратора:
# Аутентификация
token = await client.admin.login("username", "password")
# Управление
await client.admin.create("newadmin", "password", is_sudo=True) # Требует Sudo
await client.admin.delete("oldadmin") # Требует Sudo
И Больше!
- Инбаунды (
client.inbounds) - Конфигурация инбаундов - Core (
client.core) - Статистика и управление ядром - API Ключи (
client.api_keys) - Управление API ключами
🔧 Продвинутое Использование
Обработка Ошибок
from veloce.exceptions import VeloceNotFoundError, VeloceAuthError
try:
user = await client.users.get("несуществующий")
except VeloceNotFoundError:
print("Пользователь не найден")
except VeloceAuthError:
print("Неверный API ключ")
Типобезопасность с Pydantic
from veloce.models import UserResponse
user = await client.users.get("user123")
# user типизирован как Dict, или используй Pydantic модель:
user_model = UserResponse(**user)
print(user_model.username)
Настройка Повторов
from veloce.retry import retry_on_error
@retry_on_error(max_retries=5, base_delay=2.0)
async def надежная_операция():
return await client.users.get("user123")
📖 Документация
💻 Разработка
# Клонировать репозиторий
git clone https://github.com/ASAPok/veloce-api.git
cd veloce-api
# Установить в режиме разработки
pip install -e ".[dev]"
# Запустить тесты
pytest
# Проверка типов
mypy veloce
# Форматирование кода
black veloce
🤝 Участие в Разработке
Мы приветствуем вклад в проект! Пожалуйста, не стесняйтесь отправлять Pull Request.
- Форкните репозиторий
- Создайте ветку для фичи (
git checkout -b feature/amazing-feature) - Закоммитьте изменения (
git commit -m 'Добавить amazing-feature') - Запушьте в ветку (
git push origin feature/amazing-feature) - Откройте Pull Request
📝 Лицензия
Проект распространяется под лицензией MIT - см. файл LICENSE.
🔗 Ссылки
- PyPI: https://pypi.org/project/veloce-api/
- Исходный код: https://github.com/ASAPok/veloce-api
- Баг-трекер: https://github.com/ASAPok/veloce-api/issues
- Veloce Panel: https://github.com/ASAPok/veloce
🌟 Поддержка
Если проект вам полезен, поставьте ⭐️!
По вопросам и поддержке, пожалуйста, создайте issue.
Metadata
Release files for veloce-api 1.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| veloce_api-1.3.1.tar.gz | 18.0 kB | Without provenance | Details for veloce_api-1.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| veloce_api-1.3.1-py3-none-any.whl | Python 3 | none | any | Details for veloce_api-1.3.1-py3-none-any.whl |
Total release size: 35.1 kB
Release files / veloce_api-1.3.1.tar.gz
| Download URL | veloce_api-1.3.1.tar.gz |
|---|---|
| Size | 18.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2eaf4bd563e525e26d6f49aab4fd166e604e486f9e486aff669257a9ded45e28
|
|
BLAKE2b-256 checksum How to use checksums |
066c0d6d02c6a88c96d439a6cc01b1ce20d0cedc91923815cc21a74a81bc5709
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / veloce_api-1.3.1-py3-none-any.whl
| Download URL | veloce_api-1.3.1-py3-none-any.whl |
|---|---|
| Size | 17.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
416d1c8879fab9d4ae71cc39d39874c5e67fb80c093f523c74ef5900db731f8a
|
|
BLAKE2b-256 checksum How to use checksums |
77c0e9616d8fef568870788966f78f29823be2192e7c82aa5920078504b45615
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for veloce-api 1.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.