ProfileOption#
- class teamworksams.export_option.ProfileOption(interactive_mode: bool = True, guess_col_type: bool = True, clean_names: bool = False, cache: bool = True, include_missing_users: bool = False)[source]#
Bases:
object
Options for configuring profile data export.
Customizes the behavior of
get_profile_data()
, controlling output formatting, caching, and interactive feedback. Optimizes performance for profile data exports.- Parameters:
interactive_mode (bool) – Whether to print status messages during execution (default: True).
guess_col_type (bool) – Whether to infer column data types (default: True).
clean_names (bool) – Whether to clean column names (e.g., lowercase, replace spaces) (default: False).
cache (bool) – Whether to cache API responses (default: True).
include_missing_users (bool) – Whether to include users from the filter without profile data (default: False).
- interactive_mode#
Whether interactive mode is enabled.
- Type:
bool
- guess_col_type#
Whether to guess column types.
- Type:
bool
- clean_names#
Whether to clean column names.
- Type:
bool
- cache#
Whether caching is enabled.
- Type:
bool
- include_missing_users#
Whether to include missing users.
- Type:
bool
- Examples#
- >>> from teamworksams import get_profile_data, ProfileOption
- >>> option = ProfileOption(
- ... interactive_mode = True,
- ... guess_col_type = True,
- ... clean_names = True
- ... )
- >>> df = get_profile_data(
- ... form = "Athlete Profile",
- ... url = "https
//example.smartabase.com/site”,
- ... option = option
- ... )
Additional Notes#
Use
clean_names=True
to standardize column names (e.g., ‘Athlete Profile’ to ‘athlete_profile’) for consistency in data analysis.Set
include_missing_users=True
to include users without profiles in the outputpandas.DataFrame
, ensuring complete user coverage.Enable
interactive_mode=True
for feedback like “Retrieved 5 profiles,” useful in interactive environments.
See Also#
get_profile_data(): Function using
ProfileOption
.ProfileFilter
: For filtering profile data.