SyncEventOption#
- class teamworksams.export_option.SyncEventOption(interactive_mode: bool = True, include_user_data: bool = True, cache: bool = True, include_missing_users: bool = False, guess_col_type: bool = True, include_uuid: bool = False)[source]#
Bases:
object
Options for configuring sync event data export.
Customizes the behavior of
sync_event_data()
, controlling output formatting, user metadata inclusion, caching, and interactive feedback. Optimizes performance for synchronized event exports. See Exporting Data for synchronization workflows.- Parameters:
interactive_mode (bool) – Whether to print status messages during execution, such as the number of events retrieved. Defaults to True.
include_user_data (bool) – Whether to include user metadata (e.g., ‘about’, ‘first_name’) in the output DataFrame. Defaults to True.
cache (bool) – Whether to cache API responses to improve performance for repeated requests. Defaults to True.
include_missing_users (bool) – Whether to include users from the filter without event data, ensuring all specified users are represented. Defaults to False.
guess_col_type (bool) – Whether to infer column data types (e.g., numeric, datetime) in the resulting DataFrame. Defaults to True.
include_uuid (bool) – Whether to include the user’s UUID in the output DataFrame. Defaults to False.
- interactive_mode#
Indicates whether interactive mode is enabled.
- Type:
bool
- include_user_data#
Indicates whether user metadata is included.
- Type:
bool
- cache#
Indicates whether caching is enabled.
- Type:
bool
- include_missing_users#
Indicates whether missing users are included.
- Type:
bool
- guess_col_type#
Indicates whether column type inference is enabled.
- Type:
bool
- include_uuid#
Indicates whether UUID inclusion is enabled.
- Type:
bool
Examples
>>> from teamworksams import sync_event_data, SyncEventOption >>> option = SyncEventOption( ... interactive_mode = True, ... include_user_data = True, ... include_uuid = True ... ) >>> df, new_sync_time = sync_event_data( ... form = "Training Log", ... last_synchronisation_time = 1677654321000, ... url = "https://example.smartabase.com/site", ... option = option ... )
Additional Notes#
Set
include_user_data=True
to append user metadata (e.g., ‘about’) to thepandas.DataFrame
, useful for reporting without additional API calls.Use
include_uuid=True
to include user UUIDs, requiring user data retrieval and increasing API load.Enable
interactive_mode=True
for status messages like “Retrieved 5 events,” enhancing visibility in interactive scripts.
See Also#
sync_event_data(): Function using
SyncEventOption
.SyncEventFilter() <sync_event_filter_ref_>`_
: For filtering synchronized events.Exporting Data: Synchronization workflows.