{"id":19935063,"url":"https://github.com/optimizely/eleanor-python-sdk","last_synced_at":"2025-05-03T12:30:58.878Z","repository":{"id":179252866,"uuid":"663195283","full_name":"optimizely/eleanor-python-sdk","owner":"optimizely","description":"Python SDK for the Optimizely API","archived":true,"fork":false,"pushed_at":"2023-08-18T16:04:03.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T12:17:11.039Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/optimizely.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-06T19:05:55.000Z","updated_at":"2023-09-27T15:06:41.000Z","dependencies_parsed_at":"2024-11-19T20:46:52.399Z","dependency_job_id":null,"html_url":"https://github.com/optimizely/eleanor-python-sdk","commit_stats":null,"previous_names":["fern-optimizely/optimizely-python","optimizely/eleanor-python-sdk"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/optimizely%2Feleanor-python-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/optimizely%2Feleanor-python-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/optimizely%2Feleanor-python-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/optimizely%2Feleanor-python-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/optimizely","download_url":"https://codeload.github.com/optimizely/eleanor-python-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252190660,"owners_count":21708920,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T23:18:39.997Z","updated_at":"2025-05-03T12:30:58.492Z","avatar_url":"https://github.com/optimizely.png","language":"Python","readme":"WARNING: This is not the supported Eleanor SDK. Please use https://github.com/optimizely/python-optiai\r\n\r\n# Optimizely Python Library\r\n\r\n[![pypi](https://img.shields.io/pypi/v/fern-optimizely.svg)](https://pypi.python.org/pypi/fern-optimizely)\r\n[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-SDK%20generated%20by%20Fern-brightgreen)](https://github.com/fern-api/fern)\r\n\r\n## Installation\r\n\r\nAdd this dependency to your project's build file:\r\n\r\n```bash\r\npip install fern-optimizely\r\n# or\r\npoetry add fern-optimizely\r\n```\r\n\r\n## Usage\r\n\r\n```python\r\nfrom optimizely.client import Optimizely\r\n\r\noptimizely_client = Optimizely(\r\n  token=\"API_TOKEN\"\r\n)\r\n\r\nresponse = optimizely_client.models.get()\r\n\r\nprint(response)\r\n```\r\n\r\n## Async Client\r\n\r\n```python\r\nfrom optimizely.client import Optimizely\r\nfrom optimizely import GetVoicesRequestMode\r\n\r\nimport asyncio\r\n\r\noptimizely_client = Optimizely(\r\n  token=\"API_TOKEN\"\r\n)\r\n\r\nasync def get_response() -\u003e None:\r\n    response = optimizely_client.models.get()\r\n    print(response)\r\n\r\nasyncio.run(get_response())\r\n```\r\n\r\n## Timeouts\r\nBy default, the client is configured to have a timeout of 60 seconds. You can customize this value at client instantiation. \r\n\r\n```python\r\nfrom optimizely.client import Optimizely\r\n\r\noptimizely_client = Optimizely(\r\n  token=\"API_TOKEN\",\r\n  timeout-15\r\n)\r\n```\r\n\r\n## Handling Exceptions\r\nAll exceptions thrown by the SDK will sublcass [optimizely.ApiError](./src/optimizely/core/api_error.py). \r\n\r\n```python\r\nfrom optimizely.core import ApiError\r\nfrom optimizely import BadRequestError\r\n\r\ntry:\r\n  optimizely_client.models.get()\r\nexcept BadRequestError as e: \r\n  # handle bad request error\r\nexcept APIError as e:  \r\n  # handle any api related error\r\n```\r\n\r\nError codes are as followed:\r\n\r\n| Status Code | Error Type                 |\r\n| ----------- | -------------------------- |\r\n| 400         | `BadRequestError`          |\r\n| 401         | `UnauthorizedError`        |\r\n| 403         | `ForbiddenError`           |\r\n| 404         | `NotFoundError`            |\r\n| 422         | `UnprocessableEntityError` |\r\n\r\n## Beta status\r\n\r\nThis SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning the package version to a specific version in your pyproject.toml file. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.\r\n\r\n## Contributing\r\n\r\nWhile we value open-source contributions to this SDK, this library is generated programmatically. Additions made directly to this library would have to be moved over to our generation code, otherwise they would be overwritten upon the next generated release. Feel free to open a PR as a proof of concept, but know that we will not be able to merge it as-is. We suggest opening an issue first to discuss with us!\r\n\r\nOn the other hand, contributions to the README are always very welcome!\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foptimizely%2Feleanor-python-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foptimizely%2Feleanor-python-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foptimizely%2Feleanor-python-sdk/lists"}