cherryservers-sdk-python


Namecherryservers-sdk-python JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://github.com/cherryservers/cherryservers-sdk-python
SummaryThe official SDK for interacting with the Cherry Servers API
upload_time2025-07-25 06:43:29
maintainerNone
docs_urlNone
authorCherry Servers
requires_python<4.0.0,>=3.10
licenseGPL-3.0-or-later
keywords cherry-servers api client
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Cherry Servers Python SDK

[![codecov](https://codecov.io/gh/cherryservers/cherryservers-sdk-python/graph/badge.svg?token=tQY8jXwiZS)](https://codecov.io/gh/cherryservers/cherryservers-sdk-python)
[![unit-test](https://github.com/cherryservers/cherryservers-sdk-python/actions/workflows/unit-test.yml/badge.svg)](https://github.com/cherryservers/cherryservers-sdk-python/actions/workflows/unit-test.yml)
[![lint](https://github.com/cherryservers/cherryservers-sdk-python/actions/workflows/lint.yml/badge.svg)](https://github.com/cherryservers/cherryservers-sdk-python/actions/workflows/lint.yml)
[![Documentation Status](https://readthedocs.org/projects/cherryservers-sdk-python/badge/?version=latest)](https://cherryservers-sdk-python.readthedocs.io/en/latest/?badge=latest)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/cherryservers-sdk-python?pypiBaseUrl=https%3A%2F%2Ftest.pypi.org)

Cherry Servers Python library for resource management.

The documentation for this library is available at https://cherryservers-sdk-python.readthedocs.io.
The documentation for the Cherry Servers API can be found at https://api.cherryservers.com/doc/.

## Usage

The preferred way to install this package is with pip:

```sh
pip install cherryservers-sdk-python
```

A simple example of how to provision a server and print its information:

```python
import cherryservers_sdk_python

facade = cherryservers_sdk_python.facade.CherryApiFacade(token="my-token")

# Create a server.
creation_req = cherryservers_sdk_python.servers.CreationRequest(
    region="LT-Siauliai", plan="B1-1-1gb-20s-shared"
)
server = facade.servers.create(creation_req, project_id=220189)

print(server.get_model())
```
For more examples, check out the [documentation](https://cherryservers-sdk-python.readthedocs.io).

## Development

### Requirements

* Python version >= 3.10
* [poetry](https://python-poetry.org/) version >= 2.0.0

### Setup

1. Clone the repository with:
```sh
git clone git@github.com:caliban0/cherryservers-sdk-python.git
cd cherryservers-sdk-python
```
2. Install package dependencies:
```sh
poetry install --with dev
```
If ran from inside a virtual environment, poetry should detect and use it.
Otherwise, it will create a new one, which you can activate with:
```sh
eval $(poetry env activate)
```
It's also highly recommended to set up [`pre-commit`](https://pre-commit.com/):
```sh
pre-commit install
```

### Testing

Run unit tests:
```sh
pytest tests/unit
```

Running integration tests requires the following environment variables to be set:
1. CHERRY_TEST_API_KEY - your Cherry Servers API key.
2. CHERRY_TEST_TEAM_ID - the team for which the resources will be provisioned.
3. CHERRY_TEST_BAREMETAL_SERVER_ID -  pre-existing baremetal server, for storage testing.

WARNING: running integration tests consumes real resources and will incur costs!

Run integration tests:
```sh
pytest tests/integration
```

## Release

1. Update version in `pyproject.toml`.
2. Update version in `cherryservers_sdk_python/_version.py`.
3. Run `git cliff -o CHANGELOG.md  --tag {version}` to generate the changelog.
4. Create a GitHub release.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/cherryservers/cherryservers-sdk-python",
    "name": "cherryservers-sdk-python",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0.0,>=3.10",
    "maintainer_email": null,
    "keywords": "cherry-servers, api, client",
    "author": "Cherry Servers",
    "author_email": "support@cherryservers.com",
    "download_url": "https://files.pythonhosted.org/packages/c6/a9/6cfa65fa0cbbd2a7ed233262aed92628e31fc9977477aac36b9a72487058/cherryservers_sdk_python-1.1.0.tar.gz",
    "platform": null,
    "description": "# Cherry Servers Python SDK\n\n[![codecov](https://codecov.io/gh/cherryservers/cherryservers-sdk-python/graph/badge.svg?token=tQY8jXwiZS)](https://codecov.io/gh/cherryservers/cherryservers-sdk-python)\n[![unit-test](https://github.com/cherryservers/cherryservers-sdk-python/actions/workflows/unit-test.yml/badge.svg)](https://github.com/cherryservers/cherryservers-sdk-python/actions/workflows/unit-test.yml)\n[![lint](https://github.com/cherryservers/cherryservers-sdk-python/actions/workflows/lint.yml/badge.svg)](https://github.com/cherryservers/cherryservers-sdk-python/actions/workflows/lint.yml)\n[![Documentation Status](https://readthedocs.org/projects/cherryservers-sdk-python/badge/?version=latest)](https://cherryservers-sdk-python.readthedocs.io/en/latest/?badge=latest)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/cherryservers-sdk-python?pypiBaseUrl=https%3A%2F%2Ftest.pypi.org)\n\nCherry Servers Python library for resource management.\n\nThe documentation for this library is available at https://cherryservers-sdk-python.readthedocs.io.\nThe documentation for the Cherry Servers API can be found at https://api.cherryservers.com/doc/.\n\n## Usage\n\nThe preferred way to install this package is with pip:\n\n```sh\npip install cherryservers-sdk-python\n```\n\nA simple example of how to provision a server and print its information:\n\n```python\nimport cherryservers_sdk_python\n\nfacade = cherryservers_sdk_python.facade.CherryApiFacade(token=\"my-token\")\n\n# Create a server.\ncreation_req = cherryservers_sdk_python.servers.CreationRequest(\n    region=\"LT-Siauliai\", plan=\"B1-1-1gb-20s-shared\"\n)\nserver = facade.servers.create(creation_req, project_id=220189)\n\nprint(server.get_model())\n```\nFor more examples, check out the [documentation](https://cherryservers-sdk-python.readthedocs.io).\n\n## Development\n\n### Requirements\n\n* Python version >= 3.10\n* [poetry](https://python-poetry.org/) version >= 2.0.0\n\n### Setup\n\n1. Clone the repository with:\n```sh\ngit clone git@github.com:caliban0/cherryservers-sdk-python.git\ncd cherryservers-sdk-python\n```\n2. Install package dependencies:\n```sh\npoetry install --with dev\n```\nIf ran from inside a virtual environment, poetry should detect and use it.\nOtherwise, it will create a new one, which you can activate with:\n```sh\neval $(poetry env activate)\n```\nIt's also highly recommended to set up [`pre-commit`](https://pre-commit.com/):\n```sh\npre-commit install\n```\n\n### Testing\n\nRun unit tests:\n```sh\npytest tests/unit\n```\n\nRunning integration tests requires the following environment variables to be set:\n1. CHERRY_TEST_API_KEY - your Cherry Servers API key.\n2. CHERRY_TEST_TEAM_ID - the team for which the resources will be provisioned.\n3. CHERRY_TEST_BAREMETAL_SERVER_ID -  pre-existing baremetal server, for storage testing.\n\nWARNING: running integration tests consumes real resources and will incur costs!\n\nRun integration tests:\n```sh\npytest tests/integration\n```\n\n## Release\n\n1. Update version in `pyproject.toml`.\n2. Update version in `cherryservers_sdk_python/_version.py`.\n3. Run `git cliff -o CHANGELOG.md  --tag {version}` to generate the changelog.\n4. Create a GitHub release.\n",
    "bugtrack_url": null,
    "license": "GPL-3.0-or-later",
    "summary": "The official SDK for interacting with the Cherry Servers API",
    "version": "1.1.0",
    "project_urls": {
        "Changelog": "https://github.com/cherryservers/cherryservers-sdk-python/blob/main/CHANGELOG.md",
        "Documentation": "https://cherryservers-sdk-python.readthedocs.io/en/latest/",
        "Homepage": "https://github.com/cherryservers/cherryservers-sdk-python",
        "Repository": "https://github.com/cherryservers/cherryservers-sdk-python"
    },
    "split_keywords": [
        "cherry-servers",
        " api",
        " client"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "100be00b8d32f89b19e03a5e074a011b0f84ad2ee50aa2ae7be7fe55c25bbe64",
                "md5": "67472abeb747ea911dee2bea2d62f22d",
                "sha256": "38f5080b033ec912a828ecaba2794e8186b13d696b324ed1248fed3a5f4e0807"
            },
            "downloads": -1,
            "filename": "cherryservers_sdk_python-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "67472abeb747ea911dee2bea2d62f22d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0.0,>=3.10",
            "size": 42586,
            "upload_time": "2025-07-25T06:43:28",
            "upload_time_iso_8601": "2025-07-25T06:43:28.018551Z",
            "url": "https://files.pythonhosted.org/packages/10/0b/e00b8d32f89b19e03a5e074a011b0f84ad2ee50aa2ae7be7fe55c25bbe64/cherryservers_sdk_python-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c6a96cfa65fa0cbbd2a7ed233262aed92628e31fc9977477aac36b9a72487058",
                "md5": "228ed272989aab3d355a2d06e619a751",
                "sha256": "93c2f6eb3f9c8a1d7b41a731399504f07792f601763aaac8797989da926652a3"
            },
            "downloads": -1,
            "filename": "cherryservers_sdk_python-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "228ed272989aab3d355a2d06e619a751",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0.0,>=3.10",
            "size": 32456,
            "upload_time": "2025-07-25T06:43:29",
            "upload_time_iso_8601": "2025-07-25T06:43:29.337896Z",
            "url": "https://files.pythonhosted.org/packages/c6/a9/6cfa65fa0cbbd2a7ed233262aed92628e31fc9977477aac36b9a72487058/cherryservers_sdk_python-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-25 06:43:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cherryservers",
    "github_project": "cherryservers-sdk-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "cherryservers-sdk-python"
}
        
Elapsed time: 1.84980s