Python sdk for Reforge Feature Flags and Config as a Service: https://www.reforge.com
Project description
reforge-python
Python client for reforge.com, providing Config, FeatureFlags as a Service
Example usage
from sdk_reforge import ReforgeSDK, Options
import sdk_reforge
options = Options(
sdk_key="your-reforge-sdk-key"
)
context = {
"user": {
"team_id": 432,
"id": 123,
"subscription_level": 'pro',
"email": "alice@example.com"
}
}
sdk_reforge.set_options(options)
result = sdk_reforge.get_sdk().enabled("my-first-feature-flag", context=context)
print("my-first-feature-flag is:", result)
Protocol Buffer Types
If you need to work with the underlying Protocol Buffer types, the following are re-exported for convenience:
from sdk_reforge import ConfigValue, StringList, ProtoContext, ContextSet, ContextShape, LogLevel, Json, Schema
# Create a config value
config_value = ConfigValue(string="example value")
# Create a JSON value
json_value = ConfigValue(json=Json(json='{"key": "value"}'))
# Create a Schema value
schema_value = Schema(definition='{"type": "object", "properties": {"name": {"type": "string"}}}')
See full documentation https://docs.reforge.com/docs/sdks/python
Development
- Ensure that
poetryis installed: https://python-poetry.org/docs/#installation - From the root of this directory, run
poetry installto ensure dependencies are installed poetry run pythonto open a Python REPL with access to the project dependencies
Running tests
To run all tests, including integration tests
poetry run pytest tests
To run only local tests and skip integration tests
poetry run pytest tests -k "not integration"
To run only one specific test file
poetry run pytest tests/name_of_test_file.py
Examples
There are examples in examples
Releasing
- Run pre-commit hooks to check and fix formatting, other rule enforcement.
poetry run pre-commit run --show-diff-on-failure --color=always --all-files - On a branch
- Update the version in
pyproject.toml - Update
CHANGELOG.md
- Update the version in
- Merge the branch
git tag <version> && git push --tagspoetry publish --build- To do this you will need an pypi.org account, and to be added to this project (ask Michael for an invitation)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sdk_reforge-1.2.2.tar.gz.
File metadata
- Download URL: sdk_reforge-1.2.2.tar.gz
- Upload date:
- Size: 41.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
480f035df697e5f43997f3b07ddd97a02412df0d711c576760d52bdd8d2d563b
|
|
| MD5 |
bffaef2a139811463ca9a2b2f1960193
|
|
| BLAKE2b-256 |
4a241e52b2509ab5bd159e27f193cc3484a6cf6ef35ef5d617eb9cc6452ef0c0
|
Provenance
The following attestation bundles were made for sdk_reforge-1.2.2.tar.gz:
Publisher:
publish.yml on ReforgeHQ/sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sdk_reforge-1.2.2.tar.gz -
Subject digest:
480f035df697e5f43997f3b07ddd97a02412df0d711c576760d52bdd8d2d563b - Sigstore transparency entry: 1134413179
- Sigstore integration time:
-
Permalink:
ReforgeHQ/sdk-python@a644e357bfef1a3f58978a942f3cdab5b22167d0 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ReforgeHQ
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a644e357bfef1a3f58978a942f3cdab5b22167d0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file sdk_reforge-1.2.2-py3-none-any.whl.
File metadata
- Download URL: sdk_reforge-1.2.2-py3-none-any.whl
- Upload date:
- Size: 50.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2289cd4c702c51fe5b7b9cfe1548b69493b80b2edfc23932fb6b8648637f5fbf
|
|
| MD5 |
f8da32f88ba92f091f7c908e6f75646b
|
|
| BLAKE2b-256 |
8872e9f41fb153905587af3b06c0bd74db919344b9634d4e4cab87cde9973e4d
|
Provenance
The following attestation bundles were made for sdk_reforge-1.2.2-py3-none-any.whl:
Publisher:
publish.yml on ReforgeHQ/sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sdk_reforge-1.2.2-py3-none-any.whl -
Subject digest:
2289cd4c702c51fe5b7b9cfe1548b69493b80b2edfc23932fb6b8648637f5fbf - Sigstore transparency entry: 1134413460
- Sigstore integration time:
-
Permalink:
ReforgeHQ/sdk-python@a644e357bfef1a3f58978a942f3cdab5b22167d0 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ReforgeHQ
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a644e357bfef1a3f58978a942f3cdab5b22167d0 -
Trigger Event:
push
-
Statement type: