Metadata-Version: 2.4
Name: ones-pyapi
Version: 0.1.1
Summary: Python SDK for ONES (Aviz Networks)
Author-email: Kavyansh Pandey <kavyansh.pandey@aviznetworks.com>
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: requests

# ones_sdk

[![PyPI version](https://badge.fury.io/py/ones_sdk.svg)](https://badge.fury.io/py/ones_sdk)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

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

```bash
pip install ones_sdk
```

---

## Quick Start

```python
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

```python
client = OnesClient(api_key="YOUR_API_KEY")
```

#### User API

```python
client.user.get(user_id)
client.user.create(data)
client.user.update(user_id, data)
client.user.delete(user_id)
```

#### Health API

```python
client.health.status()
```

#### Inventory API

```python
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`](examples/basic_usage.py) for more.

---

## Testing

```bash
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](LICENSE) file for details.

---

## Links

- [PyPI Package](https://pypi.org/project/ones_sdk/)
- [GitHub Repository](https://github.com/yourusername/ones_sdk)

