FormOption#
- class teamworksams.form_option.FormOption(interactive_mode: bool = True, cache: bool = True, raw_output: bool = False, field_details: bool = False, include_instructions: bool = False)[source]#
Bases:
object
Options for configuring form schema export and summary functions.
Customizes the behavior of
get_forms()
andget_form_schema()
, controlling interactive feedback, caching, output format, and schema detail level. These options optimize form metadata retrieval for administrative tasks like auditing or integration. See Managing Forms for form management workflows.- Parameters:
interactive_mode (bool) – If True, prints status messages during execution, such as “Retrieved 5 forms” or schema details, ideal for interactive environments like Jupyter notebooks. Set to False for silent execution. Defaults to False.
cache (bool) – If True, reuses cached API responses via the
AMSClient
, reducing API calls for repeated form queries. Set to False for fresh data. Defaults to True.raw_output (bool) – If True,
get_form_schema()
returns the raw API response as a dictionary instead of a formatted string, useful for custom processing. Defaults to False.field_details (bool) – If True,
get_form_schema()
includes detailed field information (e.g., options, scores, date selection) in the schema summary, increasing verbosity. Defaults to False.include_instructions (bool) – If True,
get_form_schema()
includes section and field instructions in the schema summary, useful for documentation. Defaults to False.
- interactive_mode#
Indicates whether interactive mode is enabled.
- Type:
bool
- cache#
Indicates whether caching is enabled.
- Type:
bool
- raw_output#
Indicates whether raw output is enabled.
- Type:
bool
- field_details#
Indicates whether field details are included.
- Type:
bool
- include_instructions#
Indicates whether instructions are included.
- Type:
bool
Examples
>>> from teamworksams import get_form_schema, FormOption >>> option = FormOption( ... interactive_mode = True, ... cache = True, ... raw_output = False, ... field_details = True, ... include_instructions = True ... ) >>> summary = get_form_schema( ... form_name = "Allergies", ... url = "https://example.smartabase.com/site", ... option = option ... ) ℹ Fetching summary for form 'Allergies'... ✔ Retrieved summary for form 'Allergies'. Form Schema Summary ================== Form Name: Allergies ...
Additional Notes#
Set
interactive_mode=True
for status messages like “Retrieved 5 forms,” useful for administrative tasks in interactive environments.Use
raw_output=True
with get_forms() to process the raw API response programmatically, bypassing the formatted string.Enable
field_details=True
andinclude_instructions=True
to get verbose schema summaries, ideal for form documentation or integration planning.
See Also#
get_forms() Function for listing forms.
get_form_schema() Function for schema summaries.
Managing Forms: Form management workflows.