Skip to main content

IBM Cloud App Configuration Python server SDK

Repository for IBM Cloud App Configuration Python server SDK

Install SDK

To install, use pip or easy_install:

pip install --upgrade ibm-appconfiguration-python-sdk

or

 easy_install --upgrade ibm-appconfiguration-python-sdk

Import the SDK

from ibm_appconfiguration import AppConfiguration, Feature, FeatureType

Initialize SDK

app_config = AppConfiguration.get_instance()
app_config.init(region=AppConfiguration.REGION_US_SOUTH,
               guid='GUID',
               apikey='APIKEY')

## Initialize feature 
app_config.set_collection_id(collection_id='collection_id') 

## set the file or offline feature
app_config.fetch_features_from_file(feature_file='custom/userJson.json', # Add this field if liveFeatureUpdateEnabled false or get features when the device is offline during the first app load.
                                    live_feature_update_enabled=True) # This is for live update from server.
  • region : Region name where the service instance is created. Eg: AppConfiguration.REGION_US_SOUTH
  • guid : GUID of the App Configuration service. Get it from the service credentials section of the dashboard
  • apikey : ApiKey of the App Configuration service. Get it from the service credentials section of the dashboard
  • collection_id : Id of the collection created in App Configuration service instance.
  • feature_file : Path to the JSON file which contains feature details and segment details. r
  • live_feature_update_enabled : Set this value to false if the new feature values shouldn't be fetched from the server. Make sure to provide a proper JSON file in the feature_file path. By default, this value is enabled.

Set listener for feature data changes

def features_update(self):
    print('Get your Feature value NOW')

app_config.register_features_update_listener(features_update)

Get single feature

feature = app_config.get_feature('feature_id')

Get all features

features_dictionary = app_config.get_features()

Evaluate a feature

identity = {
    'city': 'Bangalore',
    'country': 'India'
}
feature_value = feature.get_current_value(identity_id='pvQr45', identity_attributes=identity)

Fetch latest data

app_config.fetch_feature_data()

License

This project is released under the Apache 2.0 license. The license's full text can be found in LICENSE

Release files for srikanth-test-python-sdk 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for srikanth-test-python-sdk 1.0.1
File Size Uploaded
srikanth-test-python-sdk-1.0.1.tar.gz 18.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for srikanth-test-python-sdk 1.0.1
File Interpreter ABI Platform
srikanth_test_python_sdk-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 86.4 kB

Release files / srikanth-test-python-sdk-1.0.1.tar.gz

Download URL srikanth-test-python-sdk-1.0.1.tar.gz
Size 18.4 kB
Tags Source
SHA-256 checksum
How to use checksums
083dbfd18b0e8f14d8395c76f686a110b5238b12913e9222aea0fa7ec0b1255a
BLAKE2b-256 checksum
How to use checksums
b266175ed8ca3e375e9b257b8b7307bd72be9750ee45a6de938698bd437c4501
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.0

Release files / srikanth_test_python_sdk-1.0.1-py3-none-any.whl

Download URL srikanth_test_python_sdk-1.0.1-py3-none-any.whl
Size 68.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ce37b2c862cd63a789f21fa1ee2eaf6618c68ff0e1fc97bbcaa2eb92c45c571
BLAKE2b-256 checksum
How to use checksums
6a1070015dc27260f275b9abc5d3032853618e0738c0f0268fd5f87504e5ba2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.0

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page