Python SDK for ONES (Aviz Networks)
Project description
ones_sdk
A modern, easy-to-use Python SDK for interacting with the ONES API. Designed for clarity, extensibility, and robust error handling.
Features
- Simple and intuitive API client
- Custom exception handling
- Organized resources for users, health, inventory, and more
- Comprehensive test suite
- Example usage scripts
- Includes Day1 and Day2 APIs for both Control Plane and Device interactions
Installation
pip install ones_sdk
Quick Start
from ones.client import OnesClient
client = OnesClient(api_key="YOUR_API_KEY")
# Get user info
user = client.user.get(user_id="12345")
print(user)
# Check API health
health = client.health.status()
print(health)
# List inventory items
items = client.inventory.list()
for item in items:
print(item)
Project Structure
ones_sdk/
│
├── ones/ # main package
│ ├── client.py # main entry point
│ ├── transport.py # HTTP layer
│ ├── exceptions.py # custom errors
│ ├── constants.py # endpoints, paths
│ ├── resources/ # API groups
│ │ ├── user.py
│ │ ├── health.py
│ │ └── inventory.py
│ ├── utils/ # helpers
│ │ └── parser.py
│ └── models/ # (optional, later)
│ └── user.py
│
├── tests/ # test suite
├── examples/ # usage examples
├── requirements.txt
├── setup.py / pyproject.toml
└── README.md
API Reference
OnesClient
Initialization
client = OnesClient(api_key="YOUR_API_KEY")
User API
client.user.get(user_id)
client.user.create(data)
client.user.update(user_id, data)
client.user.delete(user_id)
Health API
client.health.status()
Inventory API
client.inventory.list()
client.inventory.get(item_id)
client.inventory.create(data)
client.inventory.update(item_id, data)
client.inventory.delete(item_id)
Examples
See examples/basic_usage.py for more.
Testing
pytest tests/
Contributing
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Links
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ones_pyapi-0.1.1.tar.gz.
File metadata
- Download URL: ones_pyapi-0.1.1.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c772faa6344fc3883687cc3b817bccc1d7978c332b4a00cd2fd7d5f845a6d8e
|
|
| MD5 |
b09beaa8b97b83b5e75f1d11a1a269db
|
|
| BLAKE2b-256 |
f85a640181990e8fa9bcf606601ddb9aa146ec12abc6daaa21549144af577c3d
|
File details
Details for the file ones_pyapi-0.1.1-py3-none-any.whl.
File metadata
- Download URL: ones_pyapi-0.1.1-py3-none-any.whl
- Upload date:
- Size: 15.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
594cf504a03b8d13f734d4a66d5e4c9024d213e3ac9fe2c5eb49cf59081f3058
|
|
| MD5 |
1070082c9b04a8b1234bd7191fe2c149
|
|
| BLAKE2b-256 |
38489927e14b8aaee7fe5b4d4abeb51354ca4a156e4db58c8105cd238a81e4a4
|