yandexcloud


Nameyandexcloud JSON
Version 0.325.0 PyPI version JSON
download
home_pagehttps://github.com/yandex-cloud/python-sdk
SummaryThe Yandex.Cloud official SDK
upload_time2024-11-18 08:07:12
maintainerNone
docs_urlNone
authorYandex LLC
requires_pythonNone
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![PyPI Version][pypi-image]][pypi-url]
[![Build Status][build-image]][build-url]
[![License][license-image]][license-url]

<!-- Badges -->

[pypi-image]: https://img.shields.io/pypi/v/yandexcloud
[pypi-url]: https://pypi.org/project/yandexcloud/
[build-image]: https://github.com/yandex-cloud/python-sdk/actions/workflows/run-tests.yml/badge.svg
[build-url]: https://github.com/yandex-cloud/python-sdk/actions/workflows/run-tests.yml
[license-image]: https://img.shields.io/github/license/yandex-cloud/python-sdk.svg
[license-url]: https://github.com/yandex-cloud/python-sdk/blob/master/LICENSE

# Yandex.Cloud SDK (Python) 

Need to automate your infrastructure or use services provided by Yandex.Cloud? We've got you covered.

Installation:

    pip install yandexcloud

## Getting started

There are several options for authorization your requests - OAuth Token,
Metadata Service (if you're executing your code inside VMs or Cloud Functions
running in Yandex.Cloud), Service Account Keys, and externally created IAM tokens.

### OAuth Token

```python
sdk = yandexcloud.SDK(token='AQAD-.....')
```

### Metadata Service

Don't forget to assign Service Account for your Instance or Function and grant required roles.

```python
sdk = yandexcloud.SDK()
```

### Service Account Keys

```python
# you can store and read it from JSON file 
sa_key = {
    "id": "...",
    "service_account_id": "...",
    "private_key": "..."
}

sdk = yandexcloud.SDK(service_account_key=sa_key)
```

### IAM tokens

```python
sdk = yandexcloud.SDK(iam_token="t1.9eu...")
```

Check `examples` directory for more examples.

### Override service endpoint

#### Supported services

| Service Name                                                           | Alias                    |
|------------------------------------------------------------------------|--------------------------|
| yandex.cloud.ai.foundation_models                                      | ai-foundation-models     |
| yandex.cloud.ai.llm                                                    | ai-llm                   |
| yandex.cloud.ai.ocr                                                    | ai-vision-ocr            |
| yandex.cloud.ai.stt                                                    | ai-stt                   |
| yandex.cloud.ai.translate                                              | ai-translate             |
| yandex.cloud.ai.tts                                                    | ai-speechkit             |
| yandex.cloud.ai.vision                                                 | ai-vision                |
| yandex.cloud.apploadbalancer                                           | alb                      |
| yandex.cloud.billing                                                   | billing                  |
| yandex.cloud.cdn                                                       | cdn                      |
| yandex.cloud.certificatemanager.v1.certificate_content_service         | certificate-manager-data |
| yandex.cloud.certificatemanager                                        | certificate-manager      |
| yandex.cloud.compute                                                   | compute                  |
| yandex.cloud.containerregistry                                         | container-registry       |
| yandex.cloud.dataproc.manager                                          | dataproc-manager         |
| yandex.cloud.dataproc                                                  | dataproc                 |
| yandex.cloud.datasphere                                                | datasphere               |
| yandex.cloud.datatransfer                                              | datatransfer             |
| yandex.cloud.dns                                                       | dns                      |
| yandex.cloud.endpoint                                                  | endpoint                 |
| yandex.cloud.iam                                                       | iam                      |
| yandex.cloud.iot.devices                                               | iot-devices              |
| yandex.cloud.k8s                                                       | managed-kubernetes       |
| yandex.cloud.kms.v1.symmetric_crypto_service                           | kms-crypto               |
| yandex.cloud.kms                                                       | kms                      |
| yandex.cloud.loadbalancer                                              | load-balancer            |
| yandex.cloud.loadtesting                                               | loadtesting              |
| yandex.cloud.lockbox.v1.payload_service                                | lockbox-payload          |
| yandex.cloud.lockbox                                                   | lockbox                  |
| yandex.cloud.logging.v1.log_ingestion_service                          | log-ingestion            |
| yandex.cloud.logging.v1.log_reading_service                            | log-reading              |
| yandex.cloud.logging                                                   | logging                  |
| yandex.cloud.marketplace                                               | marketplace              |
| yandex.cloud.mdb.clickhouse                                            | managed-clickhouse       |
| yandex.cloud.mdb.elasticsearch                                         | managed-elasticsearch    |
| yandex.cloud.mdb.greenplum                                             | managed-greenplum        |
| yandex.cloud.mdb.kafka                                                 | managed-kafka            |
| yandex.cloud.mdb.mongodb                                               | managed-mongodb          |
| yandex.cloud.mdb.mysql                                                 | managed-mysql            |
| yandex.cloud.mdb.opensearch                                            | managed-opensearch       |
| yandex.cloud.mdb.postgresql                                            | managed-postgresql       |
| yandex.cloud.mdb.redis                                                 | managed-redis            |
| yandex.cloud.mdb.sqlserver                                             | managed-sqlserver        |
| yandex.cloud.operation                                                 | operation                |
| yandex.cloud.organizationmanager                                       | organization-manager     |
| yandex.cloud.resourcemanager                                           | resource-manager         |
| yandex.cloud.serverless.apigateway.websocket                           | apigateway-connections   |
| yandex.cloud.serverless.apigateway                                     | serverless-apigateway    |
| yandex.cloud.serverless.containers                                     | serverless-containers    |
| yandex.cloud.serverless.functions                                      | serverless-functions     |
| yandex.cloud.serverless.triggers                                       | serverless-triggers      |
| yandex.cloud.storage                                                   | storage-api              |
| yandex.cloud.vpc                                                       | vpc                      |
| yandex.cloud.ydb                                                       | ydb                      |


#### Override in client
```python
from yandex.cloud.vpc.v1.network_service_pb2_grpc import NetworkServiceStub
from yandexcloud import SDK

sdk = SDK(iam_token="t1.9eu...")
new_network_client_endpoint = "example.new.vpc.very.new.yandex:50051"
insecure = False # by default is False, but if server does not support verification can be set to True
network_client = sdk.client(NetworkServiceStub, endpoint=new_network_client_endpoint, insecure=False)
```

#### Override in sdk config
To override endpoints provide dict in format {alias : new-endpoint}
```python
from yandex.cloud.vpc.v1.network_service_pb2_grpc import NetworkServiceStub
from yandexcloud import SDK
new_network_client_endpoint = "example.new.vpc.very.new.yandex:50051"
sdk = SDK(iam_token="t1.9eu...", endpoints={"vpc": new_network_client_endpoint})
insecure = False # by default is False, but if server does not support verification can be set to True
network_client = sdk.client(NetworkServiceStub, insecure=False)
```

Notice: if both overrides are used for same endpoint, override by client has priority

#### Switch SDK region
```python
from yandexcloud import SDK, set_up_yc_api_endpoint
kz_region_endpoint = "api.yandexcloud.kz"
# this will make SDK list endpoints from KZ yc installation 
sdk = SDK(iam_token="t1.9eu...", endpoint="api.yandexcloud.kz")
# or you can use global function
set_up_yc_api_endpoint(kz_region_endpoint)
```

## Contributing
### Dependencies
Use `make deps` command to install library, its production and development dependencies.

### Formatting
Use `make format` to autoformat code with black tool. 

### Tests
- `make test` to run tests for current python version
- `make lint` to run only linters for current python version
- `make tox-current` to run all checks (tests + code style checks + linters + format check) for current python version
- `make tox` to run all checks for all supported (installed in your system) python versions
- `make test-all-versions` to run all checks for all supported python versions in docker container


### Maintaining
If pull request consists of several meaningful commits, that should be preserved, 
then use "Rebase and merge" option. Otherwise use "Squash and merge". 

New release (changelog, tag and pypi upload) will be automatically created 
on each push to master via Github Actions workflow.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/yandex-cloud/python-sdk",
    "name": "yandexcloud",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "Yandex LLC",
    "author_email": "cloud@support.yandex.ru",
    "download_url": "https://files.pythonhosted.org/packages/cb/c9/93f87eddb6d5a039f82bc43bc251792f71dfd5b5a18e017f73dc76c3ab17/yandexcloud-0.325.0.tar.gz",
    "platform": null,
    "description": "[![PyPI Version][pypi-image]][pypi-url]\n[![Build Status][build-image]][build-url]\n[![License][license-image]][license-url]\n\n<!-- Badges -->\n\n[pypi-image]: https://img.shields.io/pypi/v/yandexcloud\n[pypi-url]: https://pypi.org/project/yandexcloud/\n[build-image]: https://github.com/yandex-cloud/python-sdk/actions/workflows/run-tests.yml/badge.svg\n[build-url]: https://github.com/yandex-cloud/python-sdk/actions/workflows/run-tests.yml\n[license-image]: https://img.shields.io/github/license/yandex-cloud/python-sdk.svg\n[license-url]: https://github.com/yandex-cloud/python-sdk/blob/master/LICENSE\n\n# Yandex.Cloud SDK (Python) \n\nNeed to automate your infrastructure or use services provided by Yandex.Cloud? We've got you covered.\n\nInstallation:\n\n    pip install yandexcloud\n\n## Getting started\n\nThere are several options for authorization your requests - OAuth Token,\nMetadata Service (if you're executing your code inside VMs or Cloud Functions\nrunning in Yandex.Cloud), Service Account Keys, and externally created IAM tokens.\n\n### OAuth Token\n\n```python\nsdk = yandexcloud.SDK(token='AQAD-.....')\n```\n\n### Metadata Service\n\nDon't forget to assign Service Account for your Instance or Function and grant required roles.\n\n```python\nsdk = yandexcloud.SDK()\n```\n\n### Service Account Keys\n\n```python\n# you can store and read it from JSON file \nsa_key = {\n    \"id\": \"...\",\n    \"service_account_id\": \"...\",\n    \"private_key\": \"...\"\n}\n\nsdk = yandexcloud.SDK(service_account_key=sa_key)\n```\n\n### IAM tokens\n\n```python\nsdk = yandexcloud.SDK(iam_token=\"t1.9eu...\")\n```\n\nCheck `examples` directory for more examples.\n\n### Override service endpoint\n\n#### Supported services\n\n| Service Name                                                           | Alias                    |\n|------------------------------------------------------------------------|--------------------------|\n| yandex.cloud.ai.foundation_models                                      | ai-foundation-models     |\n| yandex.cloud.ai.llm                                                    | ai-llm                   |\n| yandex.cloud.ai.ocr                                                    | ai-vision-ocr            |\n| yandex.cloud.ai.stt                                                    | ai-stt                   |\n| yandex.cloud.ai.translate                                              | ai-translate             |\n| yandex.cloud.ai.tts                                                    | ai-speechkit             |\n| yandex.cloud.ai.vision                                                 | ai-vision                |\n| yandex.cloud.apploadbalancer                                           | alb                      |\n| yandex.cloud.billing                                                   | billing                  |\n| yandex.cloud.cdn                                                       | cdn                      |\n| yandex.cloud.certificatemanager.v1.certificate_content_service         | certificate-manager-data |\n| yandex.cloud.certificatemanager                                        | certificate-manager      |\n| yandex.cloud.compute                                                   | compute                  |\n| yandex.cloud.containerregistry                                         | container-registry       |\n| yandex.cloud.dataproc.manager                                          | dataproc-manager         |\n| yandex.cloud.dataproc                                                  | dataproc                 |\n| yandex.cloud.datasphere                                                | datasphere               |\n| yandex.cloud.datatransfer                                              | datatransfer             |\n| yandex.cloud.dns                                                       | dns                      |\n| yandex.cloud.endpoint                                                  | endpoint                 |\n| yandex.cloud.iam                                                       | iam                      |\n| yandex.cloud.iot.devices                                               | iot-devices              |\n| yandex.cloud.k8s                                                       | managed-kubernetes       |\n| yandex.cloud.kms.v1.symmetric_crypto_service                           | kms-crypto               |\n| yandex.cloud.kms                                                       | kms                      |\n| yandex.cloud.loadbalancer                                              | load-balancer            |\n| yandex.cloud.loadtesting                                               | loadtesting              |\n| yandex.cloud.lockbox.v1.payload_service                                | lockbox-payload          |\n| yandex.cloud.lockbox                                                   | lockbox                  |\n| yandex.cloud.logging.v1.log_ingestion_service                          | log-ingestion            |\n| yandex.cloud.logging.v1.log_reading_service                            | log-reading              |\n| yandex.cloud.logging                                                   | logging                  |\n| yandex.cloud.marketplace                                               | marketplace              |\n| yandex.cloud.mdb.clickhouse                                            | managed-clickhouse       |\n| yandex.cloud.mdb.elasticsearch                                         | managed-elasticsearch    |\n| yandex.cloud.mdb.greenplum                                             | managed-greenplum        |\n| yandex.cloud.mdb.kafka                                                 | managed-kafka            |\n| yandex.cloud.mdb.mongodb                                               | managed-mongodb          |\n| yandex.cloud.mdb.mysql                                                 | managed-mysql            |\n| yandex.cloud.mdb.opensearch                                            | managed-opensearch       |\n| yandex.cloud.mdb.postgresql                                            | managed-postgresql       |\n| yandex.cloud.mdb.redis                                                 | managed-redis            |\n| yandex.cloud.mdb.sqlserver                                             | managed-sqlserver        |\n| yandex.cloud.operation                                                 | operation                |\n| yandex.cloud.organizationmanager                                       | organization-manager     |\n| yandex.cloud.resourcemanager                                           | resource-manager         |\n| yandex.cloud.serverless.apigateway.websocket                           | apigateway-connections   |\n| yandex.cloud.serverless.apigateway                                     | serverless-apigateway    |\n| yandex.cloud.serverless.containers                                     | serverless-containers    |\n| yandex.cloud.serverless.functions                                      | serverless-functions     |\n| yandex.cloud.serverless.triggers                                       | serverless-triggers      |\n| yandex.cloud.storage                                                   | storage-api              |\n| yandex.cloud.vpc                                                       | vpc                      |\n| yandex.cloud.ydb                                                       | ydb                      |\n\n\n#### Override in client\n```python\nfrom yandex.cloud.vpc.v1.network_service_pb2_grpc import NetworkServiceStub\nfrom yandexcloud import SDK\n\nsdk = SDK(iam_token=\"t1.9eu...\")\nnew_network_client_endpoint = \"example.new.vpc.very.new.yandex:50051\"\ninsecure = False # by default is False, but if server does not support verification can be set to True\nnetwork_client = sdk.client(NetworkServiceStub, endpoint=new_network_client_endpoint, insecure=False)\n```\n\n#### Override in sdk config\nTo override endpoints provide dict in format {alias : new-endpoint}\n```python\nfrom yandex.cloud.vpc.v1.network_service_pb2_grpc import NetworkServiceStub\nfrom yandexcloud import SDK\nnew_network_client_endpoint = \"example.new.vpc.very.new.yandex:50051\"\nsdk = SDK(iam_token=\"t1.9eu...\", endpoints={\"vpc\": new_network_client_endpoint})\ninsecure = False # by default is False, but if server does not support verification can be set to True\nnetwork_client = sdk.client(NetworkServiceStub, insecure=False)\n```\n\nNotice: if both overrides are used for same endpoint, override by client has priority\n\n#### Switch SDK region\n```python\nfrom yandexcloud import SDK, set_up_yc_api_endpoint\nkz_region_endpoint = \"api.yandexcloud.kz\"\n# this will make SDK list endpoints from KZ yc installation \nsdk = SDK(iam_token=\"t1.9eu...\", endpoint=\"api.yandexcloud.kz\")\n# or you can use global function\nset_up_yc_api_endpoint(kz_region_endpoint)\n```\n\n## Contributing\n### Dependencies\nUse `make deps` command to install library, its production and development dependencies.\n\n### Formatting\nUse `make format` to autoformat code with black tool. \n\n### Tests\n- `make test` to run tests for current python version\n- `make lint` to run only linters for current python version\n- `make tox-current` to run all checks (tests + code style checks + linters + format check) for current python version\n- `make tox` to run all checks for all supported (installed in your system) python versions\n- `make test-all-versions` to run all checks for all supported python versions in docker container\n\n\n### Maintaining\nIf pull request consists of several meaningful commits, that should be preserved, \nthen use \"Rebase and merge\" option. Otherwise use \"Squash and merge\". \n\nNew release (changelog, tag and pypi upload) will be automatically created \non each push to master via Github Actions workflow.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "The Yandex.Cloud official SDK",
    "version": "0.325.0",
    "project_urls": {
        "Homepage": "https://github.com/yandex-cloud/python-sdk"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e790dfdd0b0546088ce15aadfa9368cf8df1292f16ee1f710347e8224523d88e",
                "md5": "fe2457dec7f1b91a0ca37352d60849f6",
                "sha256": "23033077e5ac3866ee70f2ef0a77b60b46954cbcb243981e7e3de7741f48ebd9"
            },
            "downloads": -1,
            "filename": "yandexcloud-0.325.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fe2457dec7f1b91a0ca37352d60849f6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 3929808,
            "upload_time": "2024-11-18T08:07:10",
            "upload_time_iso_8601": "2024-11-18T08:07:10.265608Z",
            "url": "https://files.pythonhosted.org/packages/e7/90/dfdd0b0546088ce15aadfa9368cf8df1292f16ee1f710347e8224523d88e/yandexcloud-0.325.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cbc993f87eddb6d5a039f82bc43bc251792f71dfd5b5a18e017f73dc76c3ab17",
                "md5": "34d97618fb337c936c26f7d5a2e190d4",
                "sha256": "4fcecb405824f43b3e4446ee0eb4f2b9f739a70ae54e592535b199beb355ae85"
            },
            "downloads": -1,
            "filename": "yandexcloud-0.325.0.tar.gz",
            "has_sig": false,
            "md5_digest": "34d97618fb337c936c26f7d5a2e190d4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 2640369,
            "upload_time": "2024-11-18T08:07:12",
            "upload_time_iso_8601": "2024-11-18T08:07:12.580389Z",
            "url": "https://files.pythonhosted.org/packages/cb/c9/93f87eddb6d5a039f82bc43bc251792f71dfd5b5a18e017f73dc76c3ab17/yandexcloud-0.325.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-18 08:07:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yandex-cloud",
    "github_project": "python-sdk",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "yandexcloud"
}
        
Elapsed time: 0.75625s