# Astrolabe Python SDK
A Python SDK for the Astrolabe feature flag system, supporting number, string, boolean, and JSON flags with environment-based configuration.
## Installation
```bash
pip install astrolabe-python-sdk
```
## Quick Start
```python
from astrolabe import AstrolabeClient
# Initialize the client with your environment
client = AstrolabeClient(env="development") # or "staging", "production"
# Evaluate different types of flags
boolean_flag = client.get_boolean_flag("feature_enabled", default=False)
string_flag = client.get_string_flag("welcome_message", default="Hello!")
number_flag = client.get_number_flag("max_items", default=10)
json_flag = client.get_json_flag("config", default={"theme": "light"})
# Generic flag evaluation (type inferred from default)
flag_value = client.get_flag("any_flag", default="default_value")
```
## Usage
### Initialization
```python
from astrolabe import AstrolabeClient
from astrolabe.client import Environment
# Using string
client = AstrolabeClient("production")
# Using enum
client = AstrolabeClient(Environment.PRODUCTION)
```
### Flag Evaluation with Attributes
```python
# Pass attributes for context-aware flag evaluation
attributes = {
"user_id": "12345",
"region": "us-east-1",
"plan": "premium"
}
result = client.get_boolean_flag(
key="premium_feature",
default=False,
attributes=attributes
)
```
### Supported Flag Types
- **Boolean flags**: `get_boolean_flag(key, default, attributes=None)`
- **String flags**: `get_string_flag(key, default, attributes=None)`
- **Number flags**: `get_number_flag(key, default, attributes=None)` (supports int and float)
- **JSON flags**: `get_json_flag(key, default, attributes=None)` (returns dict)
- **Generic flags**: `get_flag(key, default, attributes=None)` (type inferred from default)
### Environments
Supported environments:
- `development`
- `staging`
- `production`
## Development
This SDK is currently in development. Flag evaluation logic is stubbed and will be implemented in future versions.
## License
MIT License
Raw data
{
"_id": null,
"home_page": null,
"name": "astrolabe-python-sdk",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "feature-flags, feature-toggles, configuration, sdk",
"author": null,
"author_email": "Astrolabe Team <md.hawamdeh@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/24/f4/25e10cd8498e03bc108fadf48ea2378e3b5f12f4a922e08fa102be53a5ba/astrolabe_python_sdk-1.0.5.tar.gz",
"platform": null,
"description": "# Astrolabe Python SDK\n\nA Python SDK for the Astrolabe feature flag system, supporting number, string, boolean, and JSON flags with environment-based configuration.\n\n## Installation\n\n```bash\npip install astrolabe-python-sdk\n```\n\n## Quick Start\n\n```python\nfrom astrolabe import AstrolabeClient\n\n# Initialize the client with your environment\nclient = AstrolabeClient(env=\"development\") # or \"staging\", \"production\"\n\n# Evaluate different types of flags\nboolean_flag = client.get_boolean_flag(\"feature_enabled\", default=False)\nstring_flag = client.get_string_flag(\"welcome_message\", default=\"Hello!\")\nnumber_flag = client.get_number_flag(\"max_items\", default=10)\njson_flag = client.get_json_flag(\"config\", default={\"theme\": \"light\"})\n\n# Generic flag evaluation (type inferred from default)\nflag_value = client.get_flag(\"any_flag\", default=\"default_value\")\n```\n\n## Usage\n\n### Initialization\n\n```python\nfrom astrolabe import AstrolabeClient\nfrom astrolabe.client import Environment\n\n# Using string\nclient = AstrolabeClient(\"production\")\n\n# Using enum\nclient = AstrolabeClient(Environment.PRODUCTION)\n```\n\n### Flag Evaluation with Attributes\n\n```python\n# Pass attributes for context-aware flag evaluation\nattributes = {\n \"user_id\": \"12345\",\n \"region\": \"us-east-1\",\n \"plan\": \"premium\"\n}\n\nresult = client.get_boolean_flag(\n key=\"premium_feature\", \n default=False, \n attributes=attributes\n)\n```\n\n### Supported Flag Types\n\n- **Boolean flags**: `get_boolean_flag(key, default, attributes=None)`\n- **String flags**: `get_string_flag(key, default, attributes=None)`\n- **Number flags**: `get_number_flag(key, default, attributes=None)` (supports int and float)\n- **JSON flags**: `get_json_flag(key, default, attributes=None)` (returns dict)\n- **Generic flags**: `get_flag(key, default, attributes=None)` (type inferred from default)\n\n### Environments\n\nSupported environments:\n- `development`\n- `staging` \n- `production`\n\n## Development\n\nThis SDK is currently in development. Flag evaluation logic is stubbed and will be implemented in future versions.\n\n## License\n\nMIT License\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python SDK for Astrolabe feature flag system",
"version": "1.0.5",
"project_urls": {
"Bug Tracker": "https://github.com/astrolabe/astrolabe-python-sdk/issues",
"Documentation": "https://docs.astrolabe.dev/python-sdk",
"Homepage": "https://github.com/astrolabe/astrolabe-python-sdk",
"Repository": "https://github.com/astrolabe/astrolabe-python-sdk"
},
"split_keywords": [
"feature-flags",
" feature-toggles",
" configuration",
" sdk"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "fa7fc802711b6dbffc6ab0ca658b48c27748d5074bf8169a30845e014618fa4c",
"md5": "b5a415c0dac2e1eea3a33e1f99d3e76a",
"sha256": "8f3295ce99405dfb3f753143be4d6aa6bb9310dad418cc36580165f886a156fd"
},
"downloads": -1,
"filename": "astrolabe_python_sdk-1.0.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b5a415c0dac2e1eea3a33e1f99d3e76a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 12151,
"upload_time": "2025-09-02T08:38:55",
"upload_time_iso_8601": "2025-09-02T08:38:55.929785Z",
"url": "https://files.pythonhosted.org/packages/fa/7f/c802711b6dbffc6ab0ca658b48c27748d5074bf8169a30845e014618fa4c/astrolabe_python_sdk-1.0.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "24f425e10cd8498e03bc108fadf48ea2378e3b5f12f4a922e08fa102be53a5ba",
"md5": "9e03949715d0056597ea46ee8df84e22",
"sha256": "293884fae828b66d2c50b0691117f6ce1ddcf8abbd2e0c3cfa0c3a7b1c51b80d"
},
"downloads": -1,
"filename": "astrolabe_python_sdk-1.0.5.tar.gz",
"has_sig": false,
"md5_digest": "9e03949715d0056597ea46ee8df84e22",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 26725,
"upload_time": "2025-09-02T08:38:57",
"upload_time_iso_8601": "2025-09-02T08:38:57.559826Z",
"url": "https://files.pythonhosted.org/packages/24/f4/25e10cd8498e03bc108fadf48ea2378e3b5f12f4a922e08fa102be53a5ba/astrolabe_python_sdk-1.0.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-02 08:38:57",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "astrolabe",
"github_project": "astrolabe-python-sdk",
"github_not_found": true,
"lcname": "astrolabe-python-sdk"
}