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
This repository was archived by the owner on Jul 3, 2023. It is now read-only.

Typeform Python API client

License

NotificationsYou must be signed in to change notification settings

Typeform/typeform-python-sdk

Repository files navigation

⚠️This library hasn't been maintained for a while so we've decided to deprecate it and archive the repository. Feel free to fork it!


typeform

PyPI versionBuild StatusCoverage Status

Python Client wrapper forTypeform API

Table of contents

Installation

pip install typeform

Usage

Initialize

1 - Import client library

fromtypeformimportTypeform

2 - Create an instance with your personal token

typeform=Typeform('<api_key>')

3 - Use any of the methods available in thereference

# will retrieve all formsforms:dict=typeform.forms.list()

Reference

Typeform('<api_key>')

  • Creates a new instance of Typeform's Python client
  • Returns an instance with the methods described below
typeform=Typeform('<api_key>')

Client returns the following properties:

  • forms
  • responses

Each one of them encapsulates the operations related to it (like listing, updating, deleting the resource).

Forms

forms.create(data: dict = {})

Creates a form. Returnsdict of created form.See docs.

forms=Typeform('<api_key>').formsresult:dict=forms.create({'title':'Hello World' })

forms.delete(uid: str)

Deletes the form with the given form_id and all of the form's responses. Returns astr based on success of deletion,OK on success, otherwise an error message.See docs.

forms=Typeform('<api_key>').formsresult:str=forms.delete('abc123')

forms.get(uid: str)

Retrieves a form by the given form_id. Includes any theme and images attached to the form as references.See docs.

forms=Typeform('<api_key>').formsresult:dict=forms.get('abc123')

forms.list(page: int = None, pageSize: int = None, search: str = None, workspaceId: str = None)

Retrieves a list of JSON descriptions for all forms in your Typeform account (public and private). Forms are listed in reverse-chronological order based on the last date they were modified.See docs.

forms=Typeform('<api_key>').formsresult:dict=forms.list()

forms.update(uid: str, patch: bool = False, data: dict = {})

Updates an existing form. Defaults toput.put will return the modified form as adict object.patch will Returns astr based on success of change,OK on success, otherwise an error message.Seeput docs orpatch docs.

forms=Typeform('<api_key>').formsresult:dict=forms.update('abc123', {'title':'Hello World, Again' })result:str=forms.update('abc123', {'title':'Hello World, Again' },patch=True)

forms.messages.get(uid: str)

Retrieves the customizable messages for a form (specified by form_id) using the form's specified language. You can format messages with bold (bold) and italic (italic) text. HTML tags are forbidden.See docs.

forms=Typeform('<api_key>').formsresult:dict=forms.messages.get('abc123')

forms.messages.update(uid: str, data={})

Specifies new values for the customizable messages in a form (specified by form_id). You can format messages with bold (bold) and italic (italic) text. HTML tags are forbidden. Returns astr based on success of change,OK on success, otherwise an error message.See docs.

forms=Typeform('<api_key>').formsresult:str=forms.messages.update('abc123', {'label.buttonHint.default':'New Button Hint'})

Responses

responses.list(uid: str, pageSize: int = None, since: str = None, until: str = None, after: str = None, before: str = None, includedResponseIds: str = None, completed: bool = None, sort: str = None, query: str = None, fields: List[str] = None)

Returns form responses and date and time of form landing and submission.See docs.

responses=Typeform('<api_key>').responsesresult:dict=responses.list('abc123')

responses.delete(uid: str, includedTokens: Union[str, List[str]])

Delete responses to a form. You must specify theincluded_tokens parameter. Returns astr based on success of deletion,OK on success, otherwise an error message.See docs.

responses=Typeform('<api_key>').responsesresult:str=responses.delete('abc123''token1')result:str=responses.delete('abc123' ['token2','token3'])

Themes

themes.get(uid: str)

Retrieves a theme by the given theme_id.See docs.

themes=Typeform('<api_key>').themesresult:dict=themes.get('abc123')

themes.list(page: int = None, pageSize: int = None)

Retrieves a list of JSON descriptions for all themes in your Typeform account (public and private). Themes are listed in reverse-chronological order based on the date you added them to your account.

themes=Typeform('<api_key>').themesresult:dict=themes.get('abc123')

Images

images.get(uid: str)

Retrieves an image by the given id.See docs.

images=Typeform('<api_key>').imagesresult:dict=images.get('abc123')

images.list()

Retrieves a list of JSON descriptions for all images in your Typeform account. Images are listed in reverse-chronological order based on the date you added them to your account.

images=Typeform('<api_key>').imagesresult:dict=images.list()

images.upload(file_name : str, image : str = None, url : str = None)

Adds an image in your Typeform account.

Specify the URL of your image or send your image in base64 format, which encodes the image data as ASCII text. You can use a tool like Base64 Image Encoder to get the base64 code for the image you want to add.

Tests

Check typeform/test/fixtures.py to configure test run.

Packages

No packages published

Contributors10

Languages


[8]ページ先頭

©2009-2025 Movatter.jp