Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Segment Public API Python SDK

License

NotificationsYou must be signed in to change notification settings

segmentio/public-api-sdk-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚠️ This SDK is currently released asPublic Beta. Its use in critical systems is discouraged, butfeedback is welcome.

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

Requirements.

Python 3.7+

Installation & Usage

pip install

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

Setuptools

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

Getting Started

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)

Contributing

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

Stars

Watchers

Forks

Packages

No packages published

Contributors2

  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp