{"id":17753159,"url":"https://github.com/configcat/python-sdk","last_synced_at":"2025-04-11T05:21:55.461Z","repository":{"id":31729880,"uuid":"128732260","full_name":"configcat/python-sdk","owner":"configcat","description":"ConfigCat SDK for Python. ConfigCat is a hosted feature flag service: https://configcat.com. Manage feature toggles across frontend, backend, mobile, desktop apps. Alternative to LaunchDarkly. Management app + feature flag SDKs.","archived":false,"fork":false,"pushed_at":"2024-05-22T19:47:33.000Z","size":706,"stargazers_count":14,"open_issues_count":0,"forks_count":10,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-05-22T20:50:48.075Z","etag":null,"topics":["configcat","configuration","configuration-management","feature-flag","feature-flags","feature-toggle","feature-toggles","featureflags","python","remote-config"],"latest_commit_sha":null,"homepage":"https://configcat.com/docs/sdk-reference/python","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/configcat.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-09T07:31:10.000Z","updated_at":"2024-05-27T12:00:39.127Z","dependencies_parsed_at":"2023-11-26T23:27:56.892Z","dependency_job_id":"08221af2-ca9e-492e-8654-b35d761560b3","html_url":"https://github.com/configcat/python-sdk","commit_stats":{"total_commits":276,"total_committers":15,"mean_commits":18.4,"dds":0.6123188405797102,"last_synced_commit":"5e2a2cf6e76eabd119030db4d1700dda4dd1b56e"},"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/configcat%2Fpython-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/configcat%2Fpython-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/configcat%2Fpython-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/configcat%2Fpython-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/configcat","download_url":"https://codeload.github.com/configcat/python-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248346357,"owners_count":21088445,"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":["configcat","configuration","configuration-management","feature-flag","feature-flags","feature-toggle","feature-toggles","featureflags","python","remote-config"],"created_at":"2024-10-26T13:22:55.451Z","updated_at":"2025-04-11T05:21:55.437Z","avatar_url":"https://github.com/configcat.png","language":"Python","readme":"# ConfigCat SDK for Python\r\nhttps://configcat.com  \r\nConfigCat SDK for Python provides easy integration for your application to ConfigCat.\r\n\r\nConfigCat is a feature flag and configuration management service that lets you separate releases from deployments. You can turn your features ON/OFF using \u003ca href=\"http://app.configcat.com\" target=\"_blank\"\u003eConfigCat Dashboard\u003c/a\u003e even after they are deployed. ConfigCat lets you target specific groups of users based on region, email or any other custom user attribute.\r\n\r\nConfigCat is a \u003ca href=\"https://configcat.com\" target=\"_blank\"\u003ehosted feature flag service\u003c/a\u003e. Manage feature toggles across frontend, backend, mobile, desktop apps. \u003ca href=\"https://configcat.com\" target=\"_blank\"\u003eAlternative to LaunchDarkly\u003c/a\u003e. Management app + feature flag SDKs.\r\n\r\n[![Python CI](https://github.com/configcat/python-sdk/actions/workflows/python-ci.yml/badge.svg?branch=master)](https://github.com/configcat/python-sdk/actions/workflows/python-ci.yml) \r\n[![codecov](https://codecov.io/gh/ConfigCat/python-sdk/branch/master/graph/badge.svg)](https://codecov.io/gh/ConfigCat/python-sdk)\r\n[![PyPI](https://img.shields.io/pypi/v/configcat-client.svg)](https://pypi.python.org/pypi/configcat-client)\r\n[![PyPI](https://img.shields.io/pypi/pyversions/configcat-client.svg)](https://pypi.python.org/pypi/configcat-client)\r\n[![Known Vulnerabilities](https://snyk.io/test/github/configcat/python-sdk/badge.svg?targetFile=requirements.txt)](https://snyk.io/test/github/configcat/python-sdk?targetFile=requirements.txt)\r\n[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=configcat_python-sdk\u0026metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=configcat_python-sdk)\r\n![License](https://img.shields.io/github/license/configcat/python-sdk.svg)\r\n\r\n[![SonarCloud](https://sonarcloud.io/images/project_badges/sonarcloud-orange.svg)](https://sonarcloud.io/dashboard?id=configcat_python-sdk)\r\n\r\n## Getting started\r\n\r\n### 1. Install the package with `pip`\r\n\r\n```bash\r\npip install configcat-client\r\n```\r\n\r\n### 2. Import `configcatclient` to your application\r\n\r\n```python\r\nimport configcatclient\r\n```\r\n\r\n### 3. Go to the \u003ca href=\"https://app.configcat.com/sdkkey\" target=\"_blank\"\u003eConfigCat Dashboard\u003c/a\u003e to get your *SDK Key*:\r\n![SDK-KEY](https://raw.githubusercontent.com/ConfigCat/python-sdk/master/media/readme02-3.png  \"SDK-KEY\")\r\n\r\n### 4. Create a *ConfigCat* client instance:\r\n\r\n```python\r\nconfigcat_client = configcatclient.get('#YOUR-SDK-KEY#')\r\n```\r\n\r\n\u003e We strongly recommend you to use the *ConfigCat Client* as a Singleton object in your application. The `configcatclient.get()` static factory method constructs singleton client instances for your SDK keys.\r\n\r\n### 5. Get your setting value\r\n```python\r\nisMyAwesomeFeatureEnabled = configcat_client.get_value('isMyAwesomeFeatureEnabled', False)\r\nif isMyAwesomeFeatureEnabled:\r\n    do_the_new_thing()\r\nelse:\r\n    do_the_old_thing()\r\n```\r\n\r\n### 6. Stop *ConfigCat* client on application exit\r\n\r\n```python\r\nconfigcat_client.close()\r\n```\r\n\r\n## Getting user specific setting values with Targeting\r\nUsing this feature, you will be able to get different setting values for different users in your application by passing a `User Object` to the `get_value()` function.\r\n\r\nRead more about [Targeting here](https://configcat.com/docs/advanced/targeting/).\r\n```python\r\nfrom configcatclient.user import User \r\n\r\nuser = User('#USER-IDENTIFIER#')\r\n\r\nisMyAwesomeFeatureEnabled = configcat_client.get_value('isMyAwesomeFeatureEnabled', False, user)\r\nif isMyAwesomeFeatureEnabled:\r\n    do_the_new_thing()\r\nelse:\r\n    do_the_old_thing()\r\n```\r\n\r\n## Sample/Demo apps\r\n* [Sample Console App](https://github.com/configcat/python-sdk/tree/master/samples/consolesample)\r\n* [Sample Django Web App](https://github.com/configcat/python-sdk/tree/master/samples/webappsample)\r\n\r\n## Polling Modes\r\nThe ConfigCat SDK supports 3 different polling mechanisms to acquire the setting values from ConfigCat. After latest setting values are downloaded, they are stored in the internal cache then all requests are served from there. Read more about Polling Modes and how to use them at [ConfigCat Docs](https://configcat.com/docs/sdk-reference/python/).\r\n\r\n## Need help?\r\nhttps://configcat.com/support\r\n\r\n## Contributing\r\nContributions are welcome. For more info please read the [Contribution Guideline](CONTRIBUTING.md).\r\n\r\n## About ConfigCat\r\n- [Official ConfigCat SDKs for other platforms](https://github.com/configcat)\r\n- [Documentation](https://configcat.com/docs)\r\n- [Blog](https://configcat.com/blog)\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconfigcat%2Fpython-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconfigcat%2Fpython-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconfigcat%2Fpython-sdk/lists"}