pycsamt.api.view.config#

Global configuration for pyCSAMT API view wrappers.

Functions

configure_api_view(**kw)

Configure the global API view backend.

reset_api_view()

Reset the global API view backend.

Classes

APIViewConfig()

Package-wide policy for dataframe-like public API views.

class pycsamt.api.view.config.APIViewConfig[source]#

Bases: object

Package-wide policy for dataframe-like public API views.

The backend controls what pycsamt.api.view.wrap_frame() returns:

  • "pycsamt" / True: return the built-in APIFrame.

  • "pandas" / False: return the original dataframe-like object.

  • callable: call wrapper(data, **metadata) and return its result.

configure(**kw)[source]#

Configure the view policy.

Parameters:

kw (Any)

Return type:

None

context(**kw)[source]#

Temporarily override API view settings.

Parameters:

kw (Any)

Return type:

Generator[APIViewConfig, None, None]

reset()[source]#

Reset to defaults.

Return type:

None

wrap_frame(data, **metadata)[source]#

Apply the configured dataframe wrapper.

Parameters:
Return type:

Any

enabled()[source]#

Return whether API view wrapping is enabled.

Return type:

bool

summary()[source]#

Return a compact configuration summary.

Return type:

str

pycsamt.api.view.config.configure_api_view(**kw)[source]#

Configure the global API view backend.

Parameters:

kw (Any)

Return type:

None

pycsamt.api.view.config.reset_api_view()[source]#

Reset the global API view backend.

Return type:

None