new: typeform
This commit is contained in:
parent
0c60de9c4c
commit
c858189508
1 changed files with 40 additions and 0 deletions
40
my/typeform.py
Normal file
40
my/typeform.py
Normal file
|
@ -0,0 +1,40 @@
|
|||
'''
|
||||
Typeform data
|
||||
'''
|
||||
|
||||
REQUIRES = [
|
||||
'git+https://github.com/hpi/typeform'
|
||||
]
|
||||
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
from typing import Sequence, Iterable
|
||||
|
||||
from .core import Paths, get_files
|
||||
|
||||
from my.config import typeform as user_config
|
||||
|
||||
@dataclass
|
||||
class typeform(user_config):
|
||||
# paths[s]/glob to the exported JSON data
|
||||
export_path: Paths
|
||||
|
||||
|
||||
def inputs() -> Sequence[Path]:
|
||||
return get_files(typeform.export_path)
|
||||
|
||||
|
||||
import typeform.dal as dal
|
||||
|
||||
|
||||
def responses():
|
||||
_dal = dal.DAL(inputs())
|
||||
yield from _dal.responses()
|
||||
|
||||
def answers():
|
||||
_dal = dal.DAL(inputs())
|
||||
yield from _dal.answers()
|
||||
|
||||
def forms():
|
||||
_dal = dal.DAL(inputs())
|
||||
yield from _dal.forms()
|
Loading…
Add table
Add a link
Reference in a new issue