speedhive-tools 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- speedhive_tools-0.1.0/MANIFEST.in +5 -0
- speedhive_tools-0.1.0/PKG-INFO +168 -0
- speedhive_tools-0.1.0/README.md +149 -0
- speedhive_tools-0.1.0/examples/__init__.py +3 -0
- speedhive_tools-0.1.0/examples/__pycache__/__init__.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/examples/__pycache__/export_full_dump.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/examples/__pycache__/extract_laps_to_csv.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/examples/__pycache__/get_event_sessions.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/examples/__pycache__/get_session_laps.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/examples/__pycache__/ndjson_to_sqlite.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/examples/export_announcements_by_org.py +185 -0
- speedhive_tools-0.1.0/examples/export_full_dump.py +409 -0
- speedhive_tools-0.1.0/examples/get_event_sessions.py +86 -0
- speedhive_tools-0.1.0/examples/get_session_laps.py +73 -0
- speedhive_tools-0.1.0/examples/get_session_results.py +119 -0
- speedhive_tools-0.1.0/examples/list_events_by_org.py +205 -0
- speedhive_tools-0.1.0/examples/processing/README_PROCESSING.md +80 -0
- speedhive_tools-0.1.0/examples/processing/__init__.py +3 -0
- speedhive_tools-0.1.0/examples/processing/__pycache__/__init__.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/examples/processing/__pycache__/extract_announcements_to_csv.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/examples/processing/__pycache__/extract_laps_to_csv.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/examples/processing/__pycache__/extract_sessions_to_csv.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/examples/processing/__pycache__/ndjson_to_sqlite.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/examples/processing/__pycache__/processor_cli.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/examples/processing/extract_announcements_to_csv.py +85 -0
- speedhive_tools-0.1.0/examples/processing/extract_laps_to_csv.py +78 -0
- speedhive_tools-0.1.0/examples/processing/extract_sessions_to_csv.py +92 -0
- speedhive_tools-0.1.0/examples/processing/ndjson_to_sqlite.py +68 -0
- speedhive_tools-0.1.0/examples/processing/processor_cli.py +125 -0
- speedhive_tools-0.1.0/mylaps_client/.gitignore +23 -0
- speedhive_tools-0.1.0/mylaps_client/.ruff_cache/.gitignore +2 -0
- speedhive_tools-0.1.0/mylaps_client/.ruff_cache/0.14.8/1221433885022394569 +0 -0
- speedhive_tools-0.1.0/mylaps_client/.ruff_cache/CACHEDIR.TAG +1 -0
- speedhive_tools-0.1.0/mylaps_client/README.md +124 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/__init__.py +8 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/__pycache__/__init__.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/__pycache__/client.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/__pycache__/errors.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/__pycache__/types.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/__init__.py +1 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/__pycache__/__init__.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/account_controller/__init__.py +1 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/account_controller/get_event_list_2.py +125 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/account_controller/get_event_list_5.py +125 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/account_controller/get_session_list_1.py +125 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/account_controller/get_session_list_3.py +116 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/account_controller/get_session_list_by_event_id.py +124 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/championship_controller/__init__.py +1 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/championship_controller/get_championship.py +92 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/championship_controller/get_championship_1.py +92 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/championship_controller/get_championship_csv.py +92 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/championship_upload_controller/__init__.py +1 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/championship_upload_controller/process_upload_request.py +97 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/championship_upload_controller/process_upload_request_1.py +97 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/chip_migration_controller/__init__.py +1 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/chip_migration_controller/add.py +98 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/chip_migration_controller/add_for_member.py +103 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/chip_migration_controller/disconnect.py +97 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/chip_migration_controller/get_chip.py +92 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/chip_migration_controller/get_chip_used.py +92 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/event_controller/__init__.py +1 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/event_controller/__pycache__/__init__.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/event_controller/__pycache__/get_event_list_1.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/event_controller/__pycache__/get_session_list.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/event_controller/delete_event.py +110 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/event_controller/get_event.py +116 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/event_controller/get_event_1.py +92 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/event_controller/get_event_list_1.py +151 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/event_controller/get_event_list_4.py +142 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/event_controller/get_events_updated_after.py +116 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/event_controller/get_session_list.py +107 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/event_controller/get_session_list_2.py +92 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/member_controller/__init__.py +1 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/member_controller/add_member.py +100 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/member_controller/find_member.py +106 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/organization_controller/__init__.py +1 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/organization_controller/__pycache__/__init__.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/organization_controller/__pycache__/get_event_list.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/organization_controller/__pycache__/get_event_list_3.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/organization_controller/__pycache__/get_organization.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/organization_controller/__pycache__/get_organization_1.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/organization_controller/get_championship_list.py +116 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/organization_controller/get_championship_list_1.py +116 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/organization_controller/get_event_list.py +116 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/organization_controller/get_event_list_3.py +116 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/organization_controller/get_organization.py +92 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/organization_controller/get_organization_1.py +92 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/progress_controller/__init__.py +1 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/progress_controller/off_line_upload_progress.py +117 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/progress_controller/off_line_upload_progress_1.py +117 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/progress_controller/upload_login.py +99 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/progress_controller/upload_login_1.py +99 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/progress_controller/upload_progress_2.py +97 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/progress_controller/upload_progress_2_1.py +97 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/session_controller/__init__.py +1 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/session_controller/__pycache__/__init__.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/session_controller/__pycache__/get_all_lap_times.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/session_controller/__pycache__/get_announcements.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/session_controller/__pycache__/get_classification.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/session_controller/__pycache__/get_classification_1.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/session_controller/get_all_lap_times.py +92 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/session_controller/get_announcements.py +92 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/session_controller/get_announcements_1.py +92 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/session_controller/get_classification.py +92 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/session_controller/get_classification_1.py +92 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/session_controller/get_lap_chart.py +92 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/session_controller/get_lap_chart_1.py +92 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/session_controller/get_lap_csv.py +100 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/session_controller/get_lap_data_response.py +100 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/session_controller/get_lap_times.py +107 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/session_controller/get_session.py +92 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/session_controller/get_session_1.py +92 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/session_controller/get_session_csv.py +92 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/system_time_controller/__init__.py +1 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/system_time_controller/get_time.py +119 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/third_party_upload_controller/__init__.py +1 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/third_party_upload_controller/third_party_login.py +124 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/third_party_upload_controller/third_party_login_1.py +124 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/third_party_upload_controller/third_party_login_10.py +124 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/third_party_upload_controller/third_party_login_11.py +124 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/third_party_upload_controller/third_party_login_12.py +124 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/third_party_upload_controller/third_party_login_13.py +124 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/third_party_upload_controller/third_party_login_2.py +124 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/third_party_upload_controller/third_party_login_3.py +124 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/third_party_upload_controller/third_party_login_4.py +124 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/third_party_upload_controller/third_party_login_5.py +124 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/third_party_upload_controller/third_party_login_6.py +124 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/third_party_upload_controller/third_party_login_7.py +124 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/third_party_upload_controller/third_party_login_8.py +124 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/third_party_upload_controller/third_party_login_9.py +124 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/third_party_upload_controller/third_party_upload.py +97 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/third_party_upload_controller/third_party_upload_1.py +97 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/third_party_upload_controller/third_party_upload_10.py +97 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/third_party_upload_controller/third_party_upload_11.py +97 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/third_party_upload_controller/third_party_upload_12.py +97 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/third_party_upload_controller/third_party_upload_13.py +97 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/third_party_upload_controller/third_party_upload_2.py +97 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/third_party_upload_controller/third_party_upload_3.py +97 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/third_party_upload_controller/third_party_upload_4.py +97 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/third_party_upload_controller/third_party_upload_5.py +97 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/third_party_upload_controller/third_party_upload_6.py +97 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/third_party_upload_controller/third_party_upload_7.py +97 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/third_party_upload_controller/third_party_upload_8.py +97 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/third_party_upload_controller/third_party_upload_9.py +97 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/time_resource/__init__.py +1 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/time_resource/get_system_time.py +119 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/upload_controller/__init__.py +1 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/upload_controller/process_and_persist_request_with_validation.py +106 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/upload_controller/process_and_persist_request_with_validation_1.py +106 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/upload_controller/process_and_persist_request_without_validation.py +106 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/api/upload_controller/process_and_persist_request_without_validation_1.py +106 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/client.py +268 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/errors.py +16 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__init__.py +99 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/__init__.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/announcement_row.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/championship.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/championship_competitor_dto.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/championship_competitor_event_dto.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/championship_competitor_event_round_dto.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/championship_data_dto.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/championship_event_dto.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/championship_event_round_dto.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/championship_model.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/championships.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/chip.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/chip_used.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/country.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/duration.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/event.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/event_sessions_and_groups.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/event_sport.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/group.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/lap_chart.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/lap_comparison.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/lap_data_result.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/lap_difference.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/lap_info.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/lap_info_classification_type_string.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/lap_position.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/lap_position_status_item.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/lap_times.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/lap_times_info.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/lap_times_info_status_item.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/lap_times_lap.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/lap_times_lap_status_item.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/location.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/member.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/orbit_upload_result.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/orbit_validation_error.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/organization.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/organization_sport.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/participant_info.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/results_competitor.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/run_announcements.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/run_classification_object.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/run_classification_object_type.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/session.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/time.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/upload_login_1_data_body.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/upload_login_data_body.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/__pycache__/upload_software.cpython-312.pyc +0 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/announcement_row.py +79 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/championship.py +124 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/championship_competitor_dto.py +160 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/championship_competitor_event_dto.py +115 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/championship_competitor_event_round_dto.py +88 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/championship_data_dto.py +147 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/championship_event_dto.py +106 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/championship_event_round_dto.py +79 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/championship_model.py +97 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/championships.py +79 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/chip.py +84 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/chip_used.py +70 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/country.py +79 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/duration.py +97 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/event.py +197 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/event_sessions_and_groups.py +102 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/event_sport.py +22 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/group.py +136 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/lap_chart.py +147 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/lap_comparison.py +124 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/lap_data_result.py +97 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/lap_difference.py +70 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/lap_info.py +145 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/lap_info_classification_type_string.py +14 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/lap_position.py +110 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/lap_position_status_item.py +10 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/lap_times.py +106 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/lap_times_info.py +179 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/lap_times_info_status_item.py +10 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/lap_times_lap.py +201 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/lap_times_lap_status_item.py +10 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/location.py +119 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/member.py +161 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/orbit_upload_result.py +97 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/orbit_validation_error.py +79 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/organization.py +145 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/organization_sport.py +22 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/participant_info.py +124 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/results_competitor.py +70 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/run_announcements.py +79 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/run_classification_object.py +91 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/run_classification_object_type.py +14 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/session.py +160 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/time.py +70 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/upload_login_1_data_body.py +69 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/upload_login_data_body.py +69 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/models/upload_software.py +70 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/py.typed +1 -0
- speedhive_tools-0.1.0/mylaps_client/event_results_client/types.py +54 -0
- speedhive_tools-0.1.0/mylaps_client/pyproject.toml +26 -0
- speedhive_tools-0.1.0/pyproject.toml +3 -0
- speedhive_tools-0.1.0/requirements.txt +3 -0
- speedhive_tools-0.1.0/setup.cfg +35 -0
- speedhive_tools-0.1.0/speedhive_tools.egg-info/PKG-INFO +168 -0
- speedhive_tools-0.1.0/speedhive_tools.egg-info/SOURCES.txt +263 -0
- speedhive_tools-0.1.0/speedhive_tools.egg-info/dependency_links.txt +1 -0
- speedhive_tools-0.1.0/speedhive_tools.egg-info/entry_points.txt +2 -0
- speedhive_tools-0.1.0/speedhive_tools.egg-info/requires.txt +3 -0
- speedhive_tools-0.1.0/speedhive_tools.egg-info/top_level.txt +1 -0
- speedhive_tools-0.1.0/tests/test_examples_imports.py +29 -0
- speedhive_tools-0.1.0/tests/test_import.py +5 -0
- speedhive_tools-0.1.0/tests/test_processing_extractors.py +92 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: speedhive-tools
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Utilities for the MyLaps Event Results API
|
|
5
|
+
Home-page: https://github.com/ncrosty58/speedhive-tools
|
|
6
|
+
Author: Nathan Crosty
|
|
7
|
+
Author-email: ncrosty58@example.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Requires-Python: >=3.10
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
Requires-Dist: httpx<0.29.0,>=0.23.0
|
|
17
|
+
Requires-Dist: attrs>=22.2.0
|
|
18
|
+
Requires-Dist: python-dateutil>=2.8.0
|
|
19
|
+
|
|
20
|
+
# speedhive-tools
|
|
21
|
+
|
|
22
|
+
Utilities and examples for interacting with the MyLaps / Event Results API using a locally-generated OpenAPI Python client.
|
|
23
|
+
|
|
24
|
+
This repository contains a generated client under `mylaps_client/` and example scripts that demonstrate how to list events and export session announcements for an organization.
|
|
25
|
+
|
|
26
|
+
Table of contents
|
|
27
|
+
|
|
28
|
+
- Quick start
|
|
29
|
+
- Examples
|
|
30
|
+
- Exporter details
|
|
31
|
+
- Troubleshooting
|
|
32
|
+
- Regenerating the client
|
|
33
|
+
- Contributing
|
|
34
|
+
|
|
35
|
+
Quick start
|
|
36
|
+
|
|
37
|
+
Requirements
|
|
38
|
+
- Python 3.10+
|
|
39
|
+
- `pip install -r requirements.txt`
|
|
40
|
+
|
|
41
|
+
Create and activate a virtualenv, then install:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
python -m venv .venv
|
|
45
|
+
# speedhive-tools
|
|
46
|
+
|
|
47
|
+
Small, practical tools for the MyLaps / Event Results API using a locally-generated OpenAPI Python client.
|
|
48
|
+
|
|
49
|
+
Quick overview
|
|
50
|
+
- Generated client: `mylaps_client/` (importable as `event_results_client` when running examples from the repo root).
|
|
51
|
+
- Examples live in `examples/` and are runnable without installing the client.
|
|
52
|
+
# 🚀 speedhive-tools
|
|
53
|
+
|
|
54
|
+
Small, playful utilities for the MyLaps Event Results API — examples included ✨
|
|
55
|
+
|
|
56
|
+
Why this repo
|
|
57
|
+
---------------------------------
|
|
58
|
+
- A locally-generated OpenAPI client lives in `mylaps_client/`.
|
|
59
|
+
- Example scripts show common tasks (list events, export announcements, fetch laps/results).
|
|
60
|
+
|
|
61
|
+
Quick start — get running ⚡
|
|
62
|
+
---------------------------------
|
|
63
|
+
Requirements: Python 3.10+
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
python -m venv .venv
|
|
67
|
+
source .venv/bin/activate
|
|
68
|
+
pip install -r requirements.txt
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Client usage (one-line) 🧩
|
|
72
|
+
---------------------------------
|
|
73
|
+
Import and construct a client:
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
from event_results_client import AuthenticatedClient
|
|
77
|
+
client = AuthenticatedClient(base_url="https://api2.mylaps.com", token="YOUR_TOKEN")
|
|
78
|
+
|
|
79
|
+
Regenerating the client
|
|
80
|
+
|
|
81
|
+
If the OpenAPI spec changes you can regenerate the client and drop it into `mylaps_client/`.
|
|
82
|
+
|
|
83
|
+
<!-- Lightweight README for speedhive-tools -->
|
|
84
|
+
# speedhive-tools
|
|
85
|
+
|
|
86
|
+
Small utilities to interact with the MyLaps Event Results API using a locally-generated OpenAPI client.
|
|
87
|
+
|
|
88
|
+
**Quick Start**
|
|
89
|
+
- Requirements: Python 3.10+ and a virtualenv.
|
|
90
|
+
- Install:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
python -m venv .venv
|
|
94
|
+
source .venv/bin/activate
|
|
95
|
+
pip install -r requirements.txt
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**What’s in this repo**
|
|
99
|
+
- `mylaps_client/` — generated OpenAPI Python client (importable as `event_results_client` when running examples from the repo root).
|
|
100
|
+
- `examples/` — short, runnable examples that demonstrate common API tasks.
|
|
101
|
+
- `examples/processing/` — small data-processing helpers (convert NDJSON -> CSV/SQLite).
|
|
102
|
+
- `output/` — suggested place for example outputs (this directory is in `.gitignore`).
|
|
103
|
+
|
|
104
|
+
**Common commands**
|
|
105
|
+
- List events for an org:
|
|
106
|
+
```bash
|
|
107
|
+
python examples/list_events_by_org.py 30476 --verbose
|
|
108
|
+
```
|
|
109
|
+
- Export announcements for an org (per-event JSON files):
|
|
110
|
+
```bash
|
|
111
|
+
python examples/export_announcements_by_org.py 30476 --output ./output/announcements --verbose
|
|
112
|
+
```
|
|
113
|
+
- Full dump (stream NDJSON, gzipped by default):
|
|
114
|
+
```bash
|
|
115
|
+
python examples/export_full_dump.py --org 30476 --output ./output/full_dump --verbose
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**Process exported data**
|
|
119
|
+
- Extract laps to CSV:
|
|
120
|
+
```bash
|
|
121
|
+
python examples/processing/extract_laps_to_csv.py --input output/full_dump/30476 --out output/full_dump/30476/laps_flat.csv
|
|
122
|
+
```
|
|
123
|
+
- Import laps to SQLite:
|
|
124
|
+
```bash
|
|
125
|
+
python examples/processing/ndjson_to_sqlite.py --input output/full_dump/30476/laps.ndjson.gz --out output/full_dump/30476/dump.db
|
|
126
|
+
sqlite3 output/full_dump/30476/dump.db "SELECT COUNT(*) FROM laps;"
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Notes & tips**
|
|
130
|
+
- Run examples from the repository root so the local `mylaps_client` package is on `sys.path`.
|
|
131
|
+
- Use `--token` on example CLIs when endpoints require authentication.
|
|
132
|
+
- The exporter supports `--max-events`, `--max-sessions-per-event`, and `--dry-run` for low-memory testing.
|
|
133
|
+
- Long runs write a checkpoint file (`outdir/.checkpoint.json`) so you can resume after interruptions.
|
|
134
|
+
|
|
135
|
+
**Regenerating the client**
|
|
136
|
+
If the API OpenAPI spec changes, regenerate the client and place it under `mylaps_client/`.
|
|
137
|
+
|
|
138
|
+
Example using `openapi-python-client`:
|
|
139
|
+
```bash
|
|
140
|
+
python -m openapi_python_client generate --url https://api2.mylaps.com/v3/api-docs --output-path ./mylaps_client
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**Need help or next steps?**
|
|
144
|
+
- I can add CI tests with recorded fixtures, retries and backoff for the exporter, or more processing utilities (aggregation, progress summaries). Tell me which and I’ll implement it.
|
|
145
|
+
|
|
146
|
+
High-level steps (example using `openapi-python-client`):
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
python -m openapi_python_client generate --url https://api2.mylaps.com/v3/api-docs --output-path ./mylaps_client
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
After regenerating, run the examples to validate and adjust any sanitization logic if payload shapes changed.
|
|
153
|
+
|
|
154
|
+
Testing and CI
|
|
155
|
+
|
|
156
|
+
- There is a minimal import test under `tests/` to ensure the generated package imports correctly. Add unit tests or mocks if you want to run the exporter in CI.
|
|
157
|
+
|
|
158
|
+
Contributing and next steps
|
|
159
|
+
|
|
160
|
+
If you'd like I can implement any of the following (pick one or more):
|
|
161
|
+
|
|
162
|
+
- Add a `--concurrency` CLI flag to control parallelism.
|
|
163
|
+
- Add an `--aggregate` flag to emit a single combined file for all events instead of per-event files.
|
|
164
|
+
- Add a unit test that verifies exporter output using recorded fixtures (recommended for CI).
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# speedhive-tools
|
|
2
|
+
|
|
3
|
+
Utilities and examples for interacting with the MyLaps / Event Results API using a locally-generated OpenAPI Python client.
|
|
4
|
+
|
|
5
|
+
This repository contains a generated client under `mylaps_client/` and example scripts that demonstrate how to list events and export session announcements for an organization.
|
|
6
|
+
|
|
7
|
+
Table of contents
|
|
8
|
+
|
|
9
|
+
- Quick start
|
|
10
|
+
- Examples
|
|
11
|
+
- Exporter details
|
|
12
|
+
- Troubleshooting
|
|
13
|
+
- Regenerating the client
|
|
14
|
+
- Contributing
|
|
15
|
+
|
|
16
|
+
Quick start
|
|
17
|
+
|
|
18
|
+
Requirements
|
|
19
|
+
- Python 3.10+
|
|
20
|
+
- `pip install -r requirements.txt`
|
|
21
|
+
|
|
22
|
+
Create and activate a virtualenv, then install:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
python -m venv .venv
|
|
26
|
+
# speedhive-tools
|
|
27
|
+
|
|
28
|
+
Small, practical tools for the MyLaps / Event Results API using a locally-generated OpenAPI Python client.
|
|
29
|
+
|
|
30
|
+
Quick overview
|
|
31
|
+
- Generated client: `mylaps_client/` (importable as `event_results_client` when running examples from the repo root).
|
|
32
|
+
- Examples live in `examples/` and are runnable without installing the client.
|
|
33
|
+
# 🚀 speedhive-tools
|
|
34
|
+
|
|
35
|
+
Small, playful utilities for the MyLaps Event Results API — examples included ✨
|
|
36
|
+
|
|
37
|
+
Why this repo
|
|
38
|
+
---------------------------------
|
|
39
|
+
- A locally-generated OpenAPI client lives in `mylaps_client/`.
|
|
40
|
+
- Example scripts show common tasks (list events, export announcements, fetch laps/results).
|
|
41
|
+
|
|
42
|
+
Quick start — get running ⚡
|
|
43
|
+
---------------------------------
|
|
44
|
+
Requirements: Python 3.10+
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
python -m venv .venv
|
|
48
|
+
source .venv/bin/activate
|
|
49
|
+
pip install -r requirements.txt
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Client usage (one-line) 🧩
|
|
53
|
+
---------------------------------
|
|
54
|
+
Import and construct a client:
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
from event_results_client import AuthenticatedClient
|
|
58
|
+
client = AuthenticatedClient(base_url="https://api2.mylaps.com", token="YOUR_TOKEN")
|
|
59
|
+
|
|
60
|
+
Regenerating the client
|
|
61
|
+
|
|
62
|
+
If the OpenAPI spec changes you can regenerate the client and drop it into `mylaps_client/`.
|
|
63
|
+
|
|
64
|
+
<!-- Lightweight README for speedhive-tools -->
|
|
65
|
+
# speedhive-tools
|
|
66
|
+
|
|
67
|
+
Small utilities to interact with the MyLaps Event Results API using a locally-generated OpenAPI client.
|
|
68
|
+
|
|
69
|
+
**Quick Start**
|
|
70
|
+
- Requirements: Python 3.10+ and a virtualenv.
|
|
71
|
+
- Install:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
python -m venv .venv
|
|
75
|
+
source .venv/bin/activate
|
|
76
|
+
pip install -r requirements.txt
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**What’s in this repo**
|
|
80
|
+
- `mylaps_client/` — generated OpenAPI Python client (importable as `event_results_client` when running examples from the repo root).
|
|
81
|
+
- `examples/` — short, runnable examples that demonstrate common API tasks.
|
|
82
|
+
- `examples/processing/` — small data-processing helpers (convert NDJSON -> CSV/SQLite).
|
|
83
|
+
- `output/` — suggested place for example outputs (this directory is in `.gitignore`).
|
|
84
|
+
|
|
85
|
+
**Common commands**
|
|
86
|
+
- List events for an org:
|
|
87
|
+
```bash
|
|
88
|
+
python examples/list_events_by_org.py 30476 --verbose
|
|
89
|
+
```
|
|
90
|
+
- Export announcements for an org (per-event JSON files):
|
|
91
|
+
```bash
|
|
92
|
+
python examples/export_announcements_by_org.py 30476 --output ./output/announcements --verbose
|
|
93
|
+
```
|
|
94
|
+
- Full dump (stream NDJSON, gzipped by default):
|
|
95
|
+
```bash
|
|
96
|
+
python examples/export_full_dump.py --org 30476 --output ./output/full_dump --verbose
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Process exported data**
|
|
100
|
+
- Extract laps to CSV:
|
|
101
|
+
```bash
|
|
102
|
+
python examples/processing/extract_laps_to_csv.py --input output/full_dump/30476 --out output/full_dump/30476/laps_flat.csv
|
|
103
|
+
```
|
|
104
|
+
- Import laps to SQLite:
|
|
105
|
+
```bash
|
|
106
|
+
python examples/processing/ndjson_to_sqlite.py --input output/full_dump/30476/laps.ndjson.gz --out output/full_dump/30476/dump.db
|
|
107
|
+
sqlite3 output/full_dump/30476/dump.db "SELECT COUNT(*) FROM laps;"
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Notes & tips**
|
|
111
|
+
- Run examples from the repository root so the local `mylaps_client` package is on `sys.path`.
|
|
112
|
+
- Use `--token` on example CLIs when endpoints require authentication.
|
|
113
|
+
- The exporter supports `--max-events`, `--max-sessions-per-event`, and `--dry-run` for low-memory testing.
|
|
114
|
+
- Long runs write a checkpoint file (`outdir/.checkpoint.json`) so you can resume after interruptions.
|
|
115
|
+
|
|
116
|
+
**Regenerating the client**
|
|
117
|
+
If the API OpenAPI spec changes, regenerate the client and place it under `mylaps_client/`.
|
|
118
|
+
|
|
119
|
+
Example using `openapi-python-client`:
|
|
120
|
+
```bash
|
|
121
|
+
python -m openapi_python_client generate --url https://api2.mylaps.com/v3/api-docs --output-path ./mylaps_client
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**Need help or next steps?**
|
|
125
|
+
- I can add CI tests with recorded fixtures, retries and backoff for the exporter, or more processing utilities (aggregation, progress summaries). Tell me which and I’ll implement it.
|
|
126
|
+
|
|
127
|
+
High-level steps (example using `openapi-python-client`):
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
python -m openapi_python_client generate --url https://api2.mylaps.com/v3/api-docs --output-path ./mylaps_client
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
After regenerating, run the examples to validate and adjust any sanitization logic if payload shapes changed.
|
|
134
|
+
|
|
135
|
+
Testing and CI
|
|
136
|
+
|
|
137
|
+
- There is a minimal import test under `tests/` to ensure the generated package imports correctly. Add unit tests or mocks if you want to run the exporter in CI.
|
|
138
|
+
|
|
139
|
+
Contributing and next steps
|
|
140
|
+
|
|
141
|
+
If you'd like I can implement any of the following (pick one or more):
|
|
142
|
+
|
|
143
|
+
- Add a `--concurrency` CLI flag to control parallelism.
|
|
144
|
+
- Add an `--aggregate` flag to emit a single combined file for all events instead of per-event files.
|
|
145
|
+
- Add a unit test that verifies exporter output using recorded fixtures (recommended for CI).
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
Binary file
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
"""Export track announcements for all sessions in all events for an organization.
|
|
2
|
+
|
|
3
|
+
Writes one combined JSON file per event containing only sessions that have announcements.
|
|
4
|
+
|
|
5
|
+
Usage:
|
|
6
|
+
python examples/export_announcements_by_org.py 30476 --output ./announcements --verbose
|
|
7
|
+
"""
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import argparse
|
|
11
|
+
import json
|
|
12
|
+
import sys
|
|
13
|
+
import asyncio
|
|
14
|
+
from pathlib import Path
|
|
15
|
+
from typing import Any, Iterable, List, Optional
|
|
16
|
+
|
|
17
|
+
# Make generated client importable when running from any cwd
|
|
18
|
+
REPO_ROOT = Path(__file__).resolve().parent.parent
|
|
19
|
+
sys.path.insert(0, str(REPO_ROOT / "mylaps_client"))
|
|
20
|
+
|
|
21
|
+
from event_results_client import Client, AuthenticatedClient
|
|
22
|
+
from event_results_client.api.organization_controller.get_event_list import asyncio_detailed as get_events_for_org_async
|
|
23
|
+
from event_results_client.api.event_controller.get_session_list import asyncio_detailed as get_sessions_for_event_async
|
|
24
|
+
from event_results_client.api.session_controller.get_announcements import asyncio_detailed as get_announcements_for_session_async
|
|
25
|
+
from event_results_client.models.session import Session
|
|
26
|
+
from event_results_client.models.run_announcements import RunAnnouncements
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def build_client(token: Optional[str] = None) -> Client:
|
|
30
|
+
if token:
|
|
31
|
+
return AuthenticatedClient(base_url="https://api2.mylaps.com", token=token)
|
|
32
|
+
return Client(base_url="https://api2.mylaps.com")
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def safe_load_json(raw: bytes) -> Any:
|
|
36
|
+
try:
|
|
37
|
+
return json.loads(raw)
|
|
38
|
+
except Exception:
|
|
39
|
+
return None
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def sanitize_for_model(d: dict) -> dict:
|
|
43
|
+
# Fix a few known API quirks: nested `sessions` or similar fields set to null
|
|
44
|
+
if d.get("sessions") is None:
|
|
45
|
+
d = dict(d)
|
|
46
|
+
d["sessions"] = {}
|
|
47
|
+
return d
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def _has_announcements(payload: Any) -> bool:
|
|
51
|
+
if payload is None:
|
|
52
|
+
return False
|
|
53
|
+
if isinstance(payload, list):
|
|
54
|
+
return len(payload) > 0
|
|
55
|
+
if isinstance(payload, dict):
|
|
56
|
+
rows = payload.get("rows")
|
|
57
|
+
if rows is None:
|
|
58
|
+
# dict payload but no rows; treat empty dict as no announcements
|
|
59
|
+
return bool(payload)
|
|
60
|
+
return bool(rows)
|
|
61
|
+
return False
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
async def export_announcements_for_org_async(org_id: int, out_dir: Path, client: Client, verbose: bool = False, concurrency: int = 20) -> None:
|
|
65
|
+
out_dir.mkdir(parents=True, exist_ok=True)
|
|
66
|
+
|
|
67
|
+
# Get events for the organization (async)
|
|
68
|
+
resp = await get_events_for_org_async(org_id, client=client)
|
|
69
|
+
if verbose:
|
|
70
|
+
print(f"[DEBUG] events request status={getattr(resp,'status_code',None)} size={len(resp.content) if resp.content else 0}")
|
|
71
|
+
|
|
72
|
+
if not getattr(resp, "content", None):
|
|
73
|
+
print("No events returned for org id", org_id)
|
|
74
|
+
return
|
|
75
|
+
|
|
76
|
+
events_payload = safe_load_json(resp.content)
|
|
77
|
+
if not isinstance(events_payload, Iterable):
|
|
78
|
+
print("Unexpected events payload format")
|
|
79
|
+
return
|
|
80
|
+
|
|
81
|
+
events = list(events_payload)
|
|
82
|
+
|
|
83
|
+
sem = asyncio.Semaphore(concurrency)
|
|
84
|
+
|
|
85
|
+
async def fetch_announcements_for_session(session_dict: dict) -> Optional[dict]:
|
|
86
|
+
sid = session_dict.get("id")
|
|
87
|
+
sname = session_dict.get("name")
|
|
88
|
+
if sid is None:
|
|
89
|
+
return None
|
|
90
|
+
async with sem:
|
|
91
|
+
aresp = await get_announcements_for_session_async(sid, client=client)
|
|
92
|
+
if not getattr(aresp, "content", None):
|
|
93
|
+
return None
|
|
94
|
+
payload = safe_load_json(aresp.content)
|
|
95
|
+
if not _has_announcements(payload):
|
|
96
|
+
return None
|
|
97
|
+
# Normalize payload using generated model when possible
|
|
98
|
+
if isinstance(payload, dict) and "rows" in payload:
|
|
99
|
+
try:
|
|
100
|
+
run_ann = RunAnnouncements.from_dict(payload)
|
|
101
|
+
result = run_ann.to_dict()
|
|
102
|
+
except Exception:
|
|
103
|
+
result = payload
|
|
104
|
+
else:
|
|
105
|
+
result = payload
|
|
106
|
+
return {"id": sid, "name": sname, "announcements": result}
|
|
107
|
+
|
|
108
|
+
for ev in events:
|
|
109
|
+
ev_id = ev.get("id")
|
|
110
|
+
ev_name = ev.get("name") or f"event_{ev_id}"
|
|
111
|
+
if verbose:
|
|
112
|
+
print(f"Processing event {ev_id}: {ev_name}")
|
|
113
|
+
|
|
114
|
+
# Get sessions for event (async)
|
|
115
|
+
sresp = await get_sessions_for_event_async(ev_id, client=client)
|
|
116
|
+
if verbose:
|
|
117
|
+
print(f"[DEBUG] sessions request status={getattr(sresp,'status_code',None)} size={len(sresp.content) if sresp.content else 0}")
|
|
118
|
+
if not getattr(sresp, "content", None):
|
|
119
|
+
if verbose:
|
|
120
|
+
print(f" No sessions for event {ev_id}")
|
|
121
|
+
continue
|
|
122
|
+
|
|
123
|
+
sess_payload = safe_load_json(sresp.content)
|
|
124
|
+
if not isinstance(sess_payload, (dict, list)):
|
|
125
|
+
if verbose:
|
|
126
|
+
print(f" Unexpected sessions payload for event {ev_id}")
|
|
127
|
+
continue
|
|
128
|
+
|
|
129
|
+
raw_sessions: List[dict] = []
|
|
130
|
+
if isinstance(sess_payload, list):
|
|
131
|
+
raw_sessions = list(sess_payload)
|
|
132
|
+
elif isinstance(sess_payload, dict):
|
|
133
|
+
if isinstance(sess_payload.get("sessions"), list):
|
|
134
|
+
raw_sessions.extend(sess_payload.get("sessions", []))
|
|
135
|
+
for g in sess_payload.get("groups", []):
|
|
136
|
+
for s_item in g.get("sessions", []) if isinstance(g.get("sessions"), list) else []:
|
|
137
|
+
raw_sessions.append(s_item)
|
|
138
|
+
|
|
139
|
+
# Launch concurrent fetches for announcements
|
|
140
|
+
tasks = [asyncio.create_task(fetch_announcements_for_session(s)) for s in raw_sessions if isinstance(s, dict) and s.get("id")]
|
|
141
|
+
results = await asyncio.gather(*tasks)
|
|
142
|
+
# Filter out sessions with no announcements
|
|
143
|
+
sessions_with_ann = [r for r in results if r]
|
|
144
|
+
|
|
145
|
+
if not sessions_with_ann:
|
|
146
|
+
if verbose:
|
|
147
|
+
print(f" No announcements found for any sessions in event {ev_id}")
|
|
148
|
+
continue
|
|
149
|
+
|
|
150
|
+
ev_out = {"id": ev_id, "name": ev_name, "sessions": sessions_with_ann}
|
|
151
|
+
out_file = out_dir / f"event_{ev_id}_announcements.json"
|
|
152
|
+
with out_file.open("w", encoding="utf-8") as f:
|
|
153
|
+
json.dump(ev_out, f, ensure_ascii=False, indent=2)
|
|
154
|
+
if verbose:
|
|
155
|
+
print(f" Wrote event announcements to {out_file}")
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
def main(argv: Optional[List[str]] = None) -> int:
|
|
159
|
+
parser = argparse.ArgumentParser(description="Export announcements for all sessions in events for an org")
|
|
160
|
+
parser.add_argument("org_id", type=int, help="Organization id")
|
|
161
|
+
parser.add_argument("--output", "-o", default="./output/announcements", help="Output directory")
|
|
162
|
+
parser.add_argument("--token", help="API token for authenticated endpoints", default=None)
|
|
163
|
+
parser.add_argument("--verbose", action="store_true", help="Verbose debug output")
|
|
164
|
+
parser.add_argument("--concurrency", "-c", type=int, default=20, help="Maximum concurrent requests")
|
|
165
|
+
args = parser.parse_args(argv)
|
|
166
|
+
|
|
167
|
+
client = build_client(token=args.token)
|
|
168
|
+
out_dir = Path(args.output)
|
|
169
|
+
|
|
170
|
+
async def _run():
|
|
171
|
+
async with client:
|
|
172
|
+
await export_announcements_for_org_async(
|
|
173
|
+
args.org_id,
|
|
174
|
+
out_dir,
|
|
175
|
+
client=client,
|
|
176
|
+
verbose=args.verbose,
|
|
177
|
+
concurrency=args.concurrency,
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
asyncio.run(_run())
|
|
181
|
+
return 0
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
if __name__ == "__main__":
|
|
185
|
+
raise SystemExit(main())
|