- Notifications
You must be signed in to change notification settings - Fork0
Segment Public API Python SDK
License
segmentio/public-api-sdk-python
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs.
All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace.
See the next sections for more information on how to use the Segment Public API.
This Python package is automatically generated by theOpenAPI Generator project:
- API version: 58.13.0
- Package version: 58.13.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
For more information, please visithttps://docs.segmentapis.com
Python 3.7+
If the python package is hosted on a repository, you can install directly using:
pip install git+https://github.com/segmentio/public-api-sdk-python.git
(you may need to runpip
with root permission:sudo pip install git+https://github.com/segmentio/public-api-sdk-python.git
)
Then import the package:
importsegment_public_api
Install viaSetuptools.
python setup.py install --user
(orsudo python setup.py install
to install the package for all users)
Then import the package:
importsegment_public_api
Please follow theinstallation procedure and then run the following:
importtimeimportsegment_public_apifromsegment_public_api.restimportApiExceptionfrompprintimportpprint# Configure Bearer authorization: tokenconfiguration=segment_public_api.Configuration(access_token=os.environ["BEARER_TOKEN"])# Enter a context with an instance of the API clientwithsegment_public_api.ApiClient(configuration)asapi_client:# Create an instance of the API classapi_instance=segment_public_api.WorkspacesApi(api_client)try:# Get Workspaceapi_response=api_instance.get_workspace()print("The response of WorkspacesApi->get_workspace:\n")pprint(api_response)exceptApiExceptionase:print("Exception when calling WorkspacesApi->get_workspace: %s\n"%e)source_api_instance=segment_public_api.SourcesApi(api_client)cursor=NonewhileTrue:try:# Get Sourcespagination=segment_public_api.PaginationInput(count=50,cursor=cursor)api_response=source_api_instance.list_sources(pagination)print("The response of SourcesApi->list_sources:\n")pprint(api_response)cursor=api_response.data.pagination.nextifapi_response.data.pagination.nextisNone:breakexceptApiExceptionase:print("Exception when calling SourcesApi->list_sources: %s\n"%e)
The contents of this repository are automatically generated, so we can't take contributions from external developers. If you have any issues with this SDK, please raise an issue or reach out tofriends@segment.com instead of opening a pull request. Pull requests will not be reviewed.
About
Segment Public API Python SDK
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.