Skip to main content

Python SDK for OmegaHire vacancy integration API

Project description

omegavacancy-sdk

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

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

Install

pip install -e .

Usage

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

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)

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__(...)

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

omegavacancy_sdk-0.2.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

omegavacancy_sdk-0.2.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file omegavacancy_sdk-0.2.0.tar.gz.

File metadata

  • Download URL: omegavacancy_sdk-0.2.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for omegavacancy_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2504cf19a1404edb082952a6708bba014e31684ade79d367d6bcd01cdff4edaf
MD5 295190002c4e3cf202fcd58a450a42ea
BLAKE2b-256 6872648c3bbcb112d4ca6838423a9d15fafdb1cd48fd00ead6641dffe779da01

See more details on using hashes here.

File details

Details for the file omegavacancy_sdk-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for omegavacancy_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3ae550ed6b9fa9c2fe25754cb947f4ec7b0a928318bc70785ba87c5c0a7ec406
MD5 14bd34dcc7d59f98fa6f732a03692ba4
BLAKE2b-256 5844edd147f02ba4f6d6a4ae0ddb5a1275703cc32fa781147931cbb8e950d6d8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page