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
TypeForm.getformByID("XXXXXX")
Get Workspaces <-- returns an array with Workspace 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 Workspace Object
workspaceobject = TypeForm.getWorkspaceByID("XXXXXXXX")
Get Form by ID <-- returns the Form Object
formobject = TypeForm.getformByID("XXXXXX")
Get Form by ID <-- returns the Form Object
responselist = TypeForm.getFormResponse(formobject)
OR
responselist = TypeForm.getFormResponse(formobject,true) <-- This will replace every choice answer with the index instead of the name
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
Release history Release notifications | RSS feed
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
Close
Hashes for typeform_advancedapi-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f91ecb34a45c44a405d9b9250436bd748ccaee1cbe6ed713b3641428a5df0086 |
|
MD5 | 3b6eb57ad8e0080d4f28a20112687030 |
|
BLAKE2b-256 | 812c04b7deb0a4f7cb7eb340b1f7e5792c4fef5012adc83f2eb6e4ea48553a9c |