babelizer.config module¶
Library configuration used by the babelizer to wrap libraries.
- class babelizer.config.BabelConfig(library: dict[str, Any] | None = None, build: dict[str, Any] | None = None, package: dict[str, Any] | None = None, info: dict[str, Any] | None = None, plugin: dict[str, Any] | None = None, ci: dict[str, Any] | None = None)[source]¶
-
Babelizer configuration.
- LOADERS: dict[str, Callable[[str], dict[str, Any]]] = {'toml': <function loads>, 'yaml': <function safe_load>}¶
- __init__(library: dict[str, Any] | None = None, build: dict[str, Any] | None = None, package: dict[str, Any] | None = None, info: dict[str, Any] | None = None, plugin: dict[str, Any] | None = None, ci: dict[str, Any] | None = None)[source]¶
Configuration used by the babelizer to wrap a library.
- Parameters:
library (dict, optional) – Information about the library being babelized.
build (dict, optional) – User-specified compiler flags.
package (dict, optional) – Name and requirements to build the babelized library.
info (dict, optional) – Descriptive information about the package.
plugin (dict, optional) – Deprecated, use package.
ci (dict, optional) – Information about how to set up continuous integration.
- dump(fp: TextIOBase, fmt: str = 'toml') None [source]¶
Write serialized configuration to a file.
- Parameters:
fp (file-like) – File object for output.
fmt (str, optional) – Format to serialize data.
- format_toml() str [source]¶
Serialize configuration as TOML.
- Returns:
Serialized configuration as a TOML-formatted string
- Return type:
- classmethod from_path(filepath: str) BabelConfig [source]¶
Create an instance of BabelConfig from a path-like object.
- Parameters:
filepath (str) – Path to a babelizer configuration file.
- Return type:
A BabelConfig instance.
- classmethod from_stream(stream: TextIOBase, fmt: str = 'toml') BabelConfig [source]¶
Create an instance of BabelConfig from a file-like object.
- Parameters:
stream (file-like) – File object with a babelizer configuration
fmt (str, optional) – File format.
- Returns:
A BabelConfig instance.
- Return type: