Metadata-Version: 2.4
Name: omegavacancy-sdk
Version: 0.2.0
Summary: Python SDK for OmegaHire vacancy integration API
Project-URL: Homepage, https://omegahire.tech
Author: OmegaHire
Requires-Python: >=3.10
Requires-Dist: httpx<1.0,>=0.28
Description-Content-Type: text/markdown

# omegavacancy-sdk

Python SDK для интеграционного API OmegaHire (`/api/v1/vacancies`).

Подробная инструкция публикации в TestPyPI/PyPI: [PUBLISHING_RU.md](./PUBLISHING_RU.md).

## Install

```bash
pip install -e .
```

## Usage

### Быстрый API (без base_url) — рекомендуется

```python
from omegavacancy_sdk import create_vacancy, delete_vacancy, get_vacancies

api_key = "ovk_xxxxx_secret"

vacancies = get_vacancies(api_key)
print(vacancies["count"])

created = create_vacancy(
    api_key,
    {
        "title": "Python Developer",
        "vacancy_text": "Need FastAPI + PostgreSQL",
        "skills": ["Python", "FastAPI"],
    },
)
print(created["vacancy_ids"])

deleted = delete_vacancy(api_key, "AB-12345")
print(deleted["success"], deleted["vacancy_id"])
```

В этом режиме SDK использует встроенный адрес API: `https://omegahire.tech`.

### Расширенный API (`OmegaVacancyClient`)

```python
from omegavacancy_sdk import OmegaVacancyClient

api_key = "ovk_xxxxx_secret"

with OmegaVacancyClient(base_url="https://your-host", api_key=api_key) as client:
    created = client.create_vacancy({
        "title": "Python Developer",
        "vacancy_text": "Need FastAPI + PostgreSQL",
        "skills": ["Python", "FastAPI"],
    })
    print(created.vacancy_ids)

    for vacancy_id in created.vacancy_ids:
        deleted = client.delete_vacancy(vacancy_id)
        print(deleted.success, deleted.vacancy_id)
```

## Errors

- `OmegaVacancyAuthError` — 401/403
- `OmegaVacancyValidationError` — 422
- `OmegaVacancyServerError` — 5xx/transport
- `OmegaVacancyError` — прочие ошибки

## Какие методы доступны сейчас

### Быстрый модуль

- `get_vacancies(api_key: str) -> dict`
- `create_vacancy(api_key: str, vacancy_json: dict) -> dict`
- `delete_vacancy(api_key: str, vacancy_id: str) -> dict`

### `OmegaVacancyClient`

- `create_vacancy(vacancy: dict) -> CreateVacancyResult`
- `create_vacancies(vacancies: list[dict]) -> CreateVacancyResult`
- `delete_vacancy(vacancy_id: str) -> DeleteVacancyResult`
- `close() -> None`

Контекстный менеджер:

- `__enter__()` / `__exit__(...)`
