yeti-switch-api


Nameyeti-switch-api JSON
Version 1.2.0 PyPI version JSON
download
home_pagehttps://github.com/senid231/yeti-admin-python
SummaryYeti-web Admin API SDK
upload_time2025-07-11 12:28:07
maintainerNone
docs_urlNone
authorDenys Talakevych
requires_python>=3.7
licenseMIT
keywords yeti-switch yeti-web
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Yeti-web Admin API SDK
![tests workflow](https://github.com/yeti-switch/yeti-switch-api-python/actions/workflows/tests.yml/badge.svg)

The documentation for the Yeti-web Admin API can be found [here](https://yeti-switch.org/docs/en/admin-api/index.html).

## Installation

Install from PyPi using [pip](https://pip.pypa.io/en/latest/), a package manager for Python.
```shell
pip3 install yeti-switch-api
```

Or download source code and run:
```shell
python3 setup.py install
```

## Usage

```python

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](https://pipenv.pypa.io/en/latest/) can be installed via `apt install pipenv`

`Python 3.7+`

### Install dependencies

```shell
pipenv install --dev
```

### Lint with flake8
```shell
pipenv run python -m flake8 . --count --show-source --statistics
```

### Fix code format with Black
```shell
pipenv run python -m black .
```

## Release

### Change `__version_info__` in `yeti_switch_api/__init__.py`

### Build package
```shell
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
```shell
pipenv run python -m twine check dist/*
```

### Upload package to [pypi](https://pypi.org/)

```shell
pipenv run python -m twine upload dist/*
```

**Notes:** see [this guide](https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#create-an-account) how to set up pypi account

### Upload package to test pypi
```shell
pipenv run python -m twine upload -r testpypi dist/*
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/senid231/yeti-admin-python",
    "name": "yeti-switch-api",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "yeti-switch, yeti-web",
    "author": "Denys Talakevych",
    "author_email": "<senid231@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/01/99/170c3449e32f5ec0ae986b30f93dffc334ced1845eef10e37de5507507c2/yeti_switch_api-1.2.0.tar.gz",
    "platform": null,
    "description": "# Yeti-web Admin API SDK\n![tests workflow](https://github.com/yeti-switch/yeti-switch-api-python/actions/workflows/tests.yml/badge.svg)\n\nThe documentation for the Yeti-web Admin API can be found [here](https://yeti-switch.org/docs/en/admin-api/index.html).\n\n## Installation\n\nInstall from PyPi using [pip](https://pip.pypa.io/en/latest/), a package manager for Python.\n```shell\npip3 install yeti-switch-api\n```\n\nOr download source code and run:\n```shell\npython3 setup.py install\n```\n\n## Usage\n\n```python\n\nimport yeti_switch_api\n\nyeti_switch_api.orm.OrmClient({\n    'API_ROOT': 'https://myhost.com/api/rest/admin',\n    'AUTH_CREDS': {\n        'login': 'mylogin',\n        'password': 'mypassword',\n    },\n    'VALIDATE_SSL': True,\n    'TIMEOUT': 10,\n})\n\n# refresh auth token in any time\nyeti_switch_api.orm.OrmClient.auth.refresh_token()\n\n# use the api\nfound_contractors = yeti_switch_api.orm.Contractor.get_list()\n```\n\nSee `examples/` for detailed usage examples.\n\n## Development\n\n### Requirements\n\n[pipenv](https://pipenv.pypa.io/en/latest/) can be installed via `apt install pipenv`\n\n`Python 3.7+`\n\n### Install dependencies\n\n```shell\npipenv install --dev\n```\n\n### Lint with flake8\n```shell\npipenv run python -m flake8 . --count --show-source --statistics\n```\n\n### Fix code format with Black\n```shell\npipenv run python -m black .\n```\n\n## Release\n\n### Change `__version_info__` in `yeti_switch_api/__init__.py`\n\n### Build package\n```shell\npipenv run python setup.py sdist\npipenv run python setup.py bdist_wheel\n```\nAs result you will have files:\n```\ndist/yeti_switch_api-<VERSION>.tar.gz\ndist/yeti_switch_api-<VERSION>-py3-none-any.whl\n```\n\n### Check package\n```shell\npipenv run python -m twine check dist/*\n```\n\n### Upload package to [pypi](https://pypi.org/)\n\n```shell\npipenv run python -m twine upload dist/*\n```\n\n**Notes:** see [this guide](https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#create-an-account) how to set up pypi account\n\n### Upload package to test pypi\n```shell\npipenv run python -m twine upload -r testpypi dist/*\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Yeti-web Admin API SDK",
    "version": "1.2.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/senid231/yeti-admin-python/issues",
        "Homepage": "https://github.com/senid231/yeti-admin-python"
    },
    "split_keywords": [
        "yeti-switch",
        " yeti-web"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ba2a3b06d8563f859198d690778b63802ca410ad29b1480ea6cc4b73295d9885",
                "md5": "e81ccbea159ed071e081984ca03e14cd",
                "sha256": "2e634a32efa63e06704380deb0a4580074936207ceadb9e7e7cb5b7428333256"
            },
            "downloads": -1,
            "filename": "yeti_switch_api-1.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e81ccbea159ed071e081984ca03e14cd",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 17401,
            "upload_time": "2025-07-11T12:28:05",
            "upload_time_iso_8601": "2025-07-11T12:28:05.641097Z",
            "url": "https://files.pythonhosted.org/packages/ba/2a/3b06d8563f859198d690778b63802ca410ad29b1480ea6cc4b73295d9885/yeti_switch_api-1.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "0199170c3449e32f5ec0ae986b30f93dffc334ced1845eef10e37de5507507c2",
                "md5": "68bf8bdb8364c3b0321b2cabb93b11da",
                "sha256": "1a084e98a4b8dc08d25b0388327df82df34de68529385e1f06eced065433471c"
            },
            "downloads": -1,
            "filename": "yeti_switch_api-1.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "68bf8bdb8364c3b0321b2cabb93b11da",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 10261,
            "upload_time": "2025-07-11T12:28:07",
            "upload_time_iso_8601": "2025-07-11T12:28:07.192182Z",
            "url": "https://files.pythonhosted.org/packages/01/99/170c3449e32f5ec0ae986b30f93dffc334ced1845eef10e37de5507507c2/yeti_switch_api-1.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-11 12:28:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "senid231",
    "github_project": "yeti-admin-python",
    "github_not_found": true,
    "lcname": "yeti-switch-api"
}
        
Elapsed time: 1.16829s