Example:
Basic code to use Python and Split REST API to export the tags associated with feature flags and segments.
How to use:
- Class wrapper for Admin API, installation instructions in this link: Python Admin API Library Wrapper
- Update your relevant Split Admin API key in code below.
from splitapiclient.main import get_client
client = get_client({'apikey': 'ADMIN API KEY'})
print('workspace, split, segment, tag')
for ws in client.workspaces.list():
for split in client.splits.list(ws.id):
if split._tags is None:
continue
for tag in split._tags:
print(ws.name+","+split._name+",,"+tag['name']))
for segment in client.segments.list(ws.id):
if segment._tags is None:
continue
for tag in segment._tags:
print(ws.name+","+split._name+",,"+tag['name']))
Comments
0 comments
Please sign in to leave a comment.