jambo package
Subpackages
- jambo.exceptions package
- jambo.parser package
- Submodules
- jambo.parser.allof_type_parser module
- jambo.parser.anyof_type_parser module
- jambo.parser.array_type_parser module
- jambo.parser.boolean_type_parser module
- jambo.parser.const_type_parser module
- jambo.parser.enum_type_parser module
- jambo.parser.float_type_parser module
- jambo.parser.int_type_parser module
- jambo.parser.null_type_parser module
- jambo.parser.object_type_parser module
- jambo.parser.oneof_type_parser module
- jambo.parser.ref_type_parser module
- jambo.parser.string_type_parser module
- Module contents
- jambo.types package
- Submodules
- jambo.types.json_schema_type module
JSONSchemaJSONSchema.additionalItemsJSONSchema.additionalPropertiesJSONSchema.allOfJSONSchema.anyOfJSONSchema.constJSONSchema.containsJSONSchema.defaultJSONSchema.dependenciesJSONSchema.descriptionJSONSchema.elseJSONSchema.enumJSONSchema.examplesJSONSchema.exclusiveMaximumJSONSchema.exclusiveMinimumJSONSchema.formatJSONSchema.ifJSONSchema.maxItemsJSONSchema.maxLengthJSONSchema.maxPropertiesJSONSchema.maximumJSONSchema.minItemsJSONSchema.minLengthJSONSchema.minPropertiesJSONSchema.minimumJSONSchema.multipleOfJSONSchema.notJSONSchema.oneOfJSONSchema.patternJSONSchema.patternPropertiesJSONSchema.prefixItemsJSONSchema.propertiesJSONSchema.requiredJSONSchema.thenJSONSchema.titleJSONSchema.typeJSONSchema.uniqueItems
- jambo.types.type_parser_options module
- Module contents
JSONSchemaJSONSchema.additionalItemsJSONSchema.additionalPropertiesJSONSchema.allOfJSONSchema.anyOfJSONSchema.constJSONSchema.containsJSONSchema.defaultJSONSchema.dependenciesJSONSchema.descriptionJSONSchema.elseJSONSchema.enumJSONSchema.examplesJSONSchema.exclusiveMaximumJSONSchema.exclusiveMinimumJSONSchema.formatJSONSchema.ifJSONSchema.maxItemsJSONSchema.maxLengthJSONSchema.maxPropertiesJSONSchema.maximumJSONSchema.minItemsJSONSchema.minLengthJSONSchema.minPropertiesJSONSchema.minimumJSONSchema.multipleOfJSONSchema.notJSONSchema.oneOfJSONSchema.patternJSONSchema.patternPropertiesJSONSchema.prefixItemsJSONSchema.propertiesJSONSchema.requiredJSONSchema.thenJSONSchema.titleJSONSchema.typeJSONSchema.uniqueItems
TypeParserOptions
Submodules
jambo.schema_converter module
- class SchemaConverter(namespace_registry=None)[source]
Bases:
objectConverts JSON Schema to Pydantic models.
This class is responsible for converting JSON Schema definitions into Pydantic models. It validates the schema and generates the corresponding Pydantic model with appropriate fields and types. The generated model can be used for data validation and serialization.
- Parameters:
namespace_registry (MutableMapping[str, MutableMapping[str, ForwardRef | type | None]] | None)
- static build(schema, ref_cache=None)[source]
Converts a JSON Schema to a Pydantic model. This method doesn’t use a reference cache if none is provided. :type schema:
JSONSchema- param schema:
The JSON Schema to convert.
- Return type:
type[BaseModel]- Parameters:
schema (JSONSchema)
ref_cache (
MutableMapping[str,ForwardRef|type|None] |None:param ref_cache: An optional reference cache to use during conversion, if provided with_clean_cache will be ignored. :return: The generated Pydantic model.)
- build_with_cache(schema, ref_cache=None, without_cache=False)[source]
Converts a JSON Schema to a Pydantic model. This is the instance method version of build and uses the instance’s reference cache if none is provided. Use this method if you want to utilize the instance’s reference cache.
- Return type:
type[BaseModel]- Parameters:
schema (
JSONSchema:param schema: The JSON Schema to convert.)ref_cache (
MutableMapping[str,ForwardRef|type|None] |None:param ref_cache: An optional reference cache to use during conversion.)without_cache (
bool:param without_cache: Whether to use a clean reference cache for this conversion. :return: The generated Pydantic model.)
- clear_ref_cache(namespace='default')[source]
Clears the reference cache.
- Return type:
None- Parameters:
namespace (str | None)
- get_cached_ref(ref_name, namespace='default')[source]
Gets a cached reference from the reference cache. :type ref_name:
str:param ref_name: The name of the reference to get. :rtype:type|None:return: The cached reference, or None if not found.- Parameters:
ref_name (str)
namespace (str)
- Return type:
type | None
Module contents
- class SchemaConverter(namespace_registry=None)[source]
Bases:
objectConverts JSON Schema to Pydantic models.
This class is responsible for converting JSON Schema definitions into Pydantic models. It validates the schema and generates the corresponding Pydantic model with appropriate fields and types. The generated model can be used for data validation and serialization.
- Parameters:
namespace_registry (MutableMapping[str, MutableMapping[str, ForwardRef | type | None]] | None)
- static build(schema, ref_cache=None)[source]
Converts a JSON Schema to a Pydantic model. This method doesn’t use a reference cache if none is provided. :type schema:
JSONSchema- param schema:
The JSON Schema to convert.
- Return type:
type[BaseModel]- Parameters:
schema (JSONSchema)
ref_cache (
MutableMapping[str,ForwardRef|type|None] |None:param ref_cache: An optional reference cache to use during conversion, if provided with_clean_cache will be ignored. :return: The generated Pydantic model.)
- build_with_cache(schema, ref_cache=None, without_cache=False)[source]
Converts a JSON Schema to a Pydantic model. This is the instance method version of build and uses the instance’s reference cache if none is provided. Use this method if you want to utilize the instance’s reference cache.
- Return type:
type[BaseModel]- Parameters:
schema (
JSONSchema:param schema: The JSON Schema to convert.)ref_cache (
MutableMapping[str,ForwardRef|type|None] |None:param ref_cache: An optional reference cache to use during conversion.)without_cache (
bool:param without_cache: Whether to use a clean reference cache for this conversion. :return: The generated Pydantic model.)
- clear_ref_cache(namespace='default')[source]
Clears the reference cache.
- Return type:
None- Parameters:
namespace (str | None)
- get_cached_ref(ref_name, namespace='default')[source]
Gets a cached reference from the reference cache. :type ref_name:
str:param ref_name: The name of the reference to get. :rtype:type|None:return: The cached reference, or None if not found.- Parameters:
ref_name (str)
namespace (str)
- Return type:
type | None