Skip to main content

TypeForm API written in python

Project description

TypeForm_AdvancedAPI written in Python

by Anton Kaiser

pip install typeform-advancedapi

Initialize

from typeform_advancedapi import *
API_KEY = ""
TypeForm = TypeForm_AdvancedAPI.CTypeForm(API_KEY)

Get Form by ID <-- returns a CForm Object

formobject = TypeForm.getformByID("XXXXXX")

Get Workspaces <-- returns an array with CWorkspace Objects

for workspace in TypeForm.getWorkspaces():
	print(workspace.getID())
	print(workspace.getName())
	for form in workspace.getForms():
		print(form.getFormID())
		print(form.getTitle())

Get Workspace by ID <-- returns the requested CWorkspace Object

workspaceobject = TypeForm.getWorkspaceByID("XXXXXXXX")

getFormResponse <-- returns a CResponse Array from the Form

responselist = TypeForm.getFormResponse(formobject)
OR
responselist = TypeForm.getFormResponse(formobject,true) <-- This will replace every choice answer with the index instead of the name

getFormResponse - After date <-- returns a CResponse Array from the Form

date = "2019-04-29T00%3A00%3A00"
responselist = TypeForm.getFormResponse(formobject,false,date)

Objects:

CWorkspace:
getID() - Returns a String
getName() - Returns a String
getForms() - Returns a CForm array
CForm:
getFormID() - Returns a String
getTitle() - Returns a String
getLastUpdatedAt() - Returns a String
getFormFields() - Returns a CFormField Array
GetQuestionFromRef(QuestionREF) - Returns a String
CFormField:
getID() - Returns a String
getType() - Returns a String
getRef() - Returns a String
getTitle() - Returns a String
getProperties() - Returns a JSON Object

CResponse:
getLandingID() - Returns a String
getToken() - Returns a String
getResponseID() - Returns a String
getLandedAt() - Returns a String
getSubmittedAt() - Returns a String
getMetadata() - Returns a CMetadata Object
getAnswers() - Returns a CAnswer Array
CAnswer:
getField() - Returns a String
getType() - Returns a String
getResult() - Returns a String
CMetadata:
getUserAgent() - Returns a String
getPlatform() - Returns a String
getReferer() - Returns a String
getNetworkID() - Returns a String
getBrowser() - Returns a String

Example: Dumping Questions from a Form with QuestionID, Question

formID = "XXXXX"
form = TypeForm.getformByID(formID)
responselist = TypeForm.getFormResponse(form)
counter = 1
for answer in responselist[0].getAnswers():
	print(row.ExternalSurveyID + " Question " + str(counter) + "> " + answer.getField().getID() + " - " + form.GetQuestionFromRef(answer.getField().getRef()) + " | " + answer.getType())
	counter += 1

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

typeform_advancedapi-1.1.8-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file typeform_advancedapi-1.1.8-py3-none-any.whl.

File metadata

  • Download URL: typeform_advancedapi-1.1.8-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for typeform_advancedapi-1.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 ba7d838895fbaf1f2d02bb324167e3831cb707a72e2689564840fd510de4b450
MD5 ea16e660677669de7d8d0698abbdd721
BLAKE2b-256 183925233414d7bb6a68c0ca41be7ae701e0e924c9b9b0ae1d490e5e347dfb0b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page