Skip to main content

Yeti-web Admin API SDK

Project description

Yeti-web Admin API SDK

tests workflow

The documentation for the Yeti-web Admin API can be found here.

Installation

Install from PyPi using pip, a package manager for Python.

pip3 install yeti-switch-api

Or download source code and run:

python3 setup.py install

Usage

import yeti_switch_api

yeti_switch_api.orm.OrmClient({
    'API_ROOT': 'https://myhost.com/api/rest/admin',
    'AUTH_CREDS': {
        'login': 'mylogin',
        'password': 'mypassword',
    },
    'VALIDATE_SSL': True,
    'TIMEOUT': 10,
})

# refresh auth token in any time
yeti_switch_api.orm.OrmClient.auth.refresh_token()

# use the api
found_contractors = yeti_switch_api.orm.Contractor.get_list()

See examples/ for detailed usage examples.

Development

Requirements

pipenv can be installed via apt install pipenv

Python 3.7+

Install dependencies

pipenv install --dev

Lint with flake8

pipenv run python -m flake8 . --count --show-source --statistics

Fix code format with Black

pipenv run python -m black .

Release

Change __version_info__ in yeti_switch_api/__init__.py

Build package

pipenv run python setup.py sdist
pipenv run python setup.py bdist_wheel

As result you will have files:

dist/yeti_switch_api-<VERSION>.tar.gz
dist/yeti_switch_api-<VERSION>-py3-none-any.whl

Check package

pipenv run python -m twine check dist/*

Upload package to pypi

pipenv run python -m twine upload dist/*

Notes: see this guide how to set up pypi account

Upload package to test pypi

pipenv run python -m twine upload -r testpypi dist/*

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

yeti_switch_api-1.2.1.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

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

yeti_switch_api-1.2.1-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file yeti_switch_api-1.2.1.tar.gz.

File metadata

  • Download URL: yeti_switch_api-1.2.1.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for yeti_switch_api-1.2.1.tar.gz
Algorithm Hash digest
SHA256 122da687d97ed513cfa916bc69be47d677d23048c299a5dad1cf4fa52c1558ff
MD5 98e8d754dc5dd987a820919710047f42
BLAKE2b-256 38e0986fb992622cbac9a200f163af7170bf24eaeab72ec07239ac2615f843b0

See more details on using hashes here.

Provenance

The following attestation bundles were made for yeti_switch_api-1.2.1.tar.gz:

Publisher: pypi_release.yml on yeti-switch/yeti-switch-api-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file yeti_switch_api-1.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for yeti_switch_api-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b76b40995be5c6e1b5a26fe6503dc41a72b3517291f44ff0eef01c544677affb
MD5 571e7ff2ef79a8a383d614b2a1bef789
BLAKE2b-256 6f073f14aa01b64bf6e04d56278b797da3fca400bb16b770ec046c14274276cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for yeti_switch_api-1.2.1-py3-none-any.whl:

Publisher: pypi_release.yml on yeti-switch/yeti-switch-api-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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