buslib
Advanced tools
| Metadata-Version: 1.1 | ||
| Name: buslib | ||
| Version: 1.4 | ||
| Version: 1.5 | ||
| Summary: Client library for interfacing with the BUS Methodology data API | ||
@@ -5,0 +5,0 @@ Home-page: https://bitbucket.org/busmethodology/python-buslib/overview |
@@ -11,23 +11,23 @@ from faker import Faker | ||
| if question['type'] == 'boolean': | ||
| return fake.boolean() | ||
| return fake.boolean() if fake.boolean() else None | ||
| if question['type'] == 'shortText': | ||
| return fake.sentence(nb_words=10, variable_nb_words=True) | ||
| return fake.sentence(nb_words=10, variable_nb_words=True) if fake.boolean() else None | ||
| if question['type'] == 'paragraph': | ||
| return fake.paragraph(nb_sentences=3, variable_nb_sentences=True) | ||
| return fake.paragraph(nb_sentences=3, variable_nb_sentences=True) if fake.boolean() else None | ||
| if question['type'] == 'integer': | ||
| return randint(question.get('min', 0), question.get('max', 100)) | ||
| return randint(question.get('min', 0), question.get('max', 100)) if fake.boolean() else None | ||
| if question['type'] == 'time': | ||
| return randint(question.get('min', 0), question.get('max', 100)) | ||
| return randint(question.get('min', 0), question.get('max', 100)) if fake.boolean() else None | ||
| if question['type'] == 'date': | ||
| return calendar.timegm(fake.date_between(start_date="-3y", end_date="today").timetuple()) | ||
| return calendar.timegm(fake.date_between(start_date="-3y", end_date="today").timetuple()) if fake.boolean() else None | ||
| if question['type'] == 'singleChoice': | ||
| return randint(1, len(question.get('choices').keys())) | ||
| return randint(1, len(question.get('choices').keys())) if fake.boolean() else None | ||
| if question['type'] == 'multipleChoice': | ||
| return [randint(1, len(question.get('choices').keys())) for i in range(randint(1, len(question.get('choices').keys())))] | ||
| return [randint(1, len(question.get('choices').keys())) for i in range(randint(1, len(question.get('choices').keys())))] if fake.boolean() else None | ||
| if question['type'] == 'leftHandScale': | ||
| return randint(1, question.get('range', 7)) | ||
| return randint(1, question.get('range', 7)) if fake.boolean() else None | ||
| if question['type'] == 'rightHandScale': | ||
| return randint(1, question.get('range', 7)) | ||
| return randint(1, question.get('range', 7)) if fake.boolean() else None | ||
| if question['type'] == 'centeredScale': | ||
| return randint(1, question.get('range', 7)) | ||
| return randint(1, question.get('range', 7)) if fake.boolean() else None | ||
@@ -34,0 +34,0 @@ responses = map(lambda q: {'name': q['name'], 'response': question_response(q)}, survey['questions']) |
+1
-1
| Metadata-Version: 1.1 | ||
| Name: buslib | ||
| Version: 1.4 | ||
| Version: 1.5 | ||
| Summary: Client library for interfacing with the BUS Methodology data API | ||
@@ -5,0 +5,0 @@ Home-page: https://bitbucket.org/busmethodology/python-buslib/overview |
+1
-1
@@ -25,3 +25,3 @@ """A setuptools based setup module. | ||
| # https://packaging.python.org/en/latest/single_source_version.html | ||
| version='1.4', | ||
| version='1.5', | ||
@@ -28,0 +28,0 @@ description='Client library for interfacing with the BUS Methodology data API', |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
22341
1.4%