odatadol.metadata#

An entity type’s declared properties, read from the service’s CSDL $metadata.

entity_metadata() returns {name: {'type': ..., 'nullable': ..., 'annotations': {...}}} in declaration order, with Edm type names intact (Edm.Decimal, Edm.Binary, Collection(Edm.String)), so a caller can decide how to render a value or which properties are not worth fetching (a binary, a stream, a server-side global). annotations is present only when the property has any.

Module Attributes

EDM_NAMESPACE

The CSDL namespace of OData v4.

Functions

entity_metadata(service, entity, *[, ...])

The declared properties of one entity set's type, in declaration order.

parse_entity_metadata(body, entity)

The properties of entity in a CSDL document, inherited ones first.

odatadol.metadata.EDM_NAMESPACE = 'http://docs.oasis-open.org/odata/ns/edm'#

The CSDL namespace of OData v4.

odatadol.metadata.entity_metadata(service, entity, *, credentials=None, fetch=None)[source]#

The declared properties of one entity set’s type, in declaration order.

entity may name the entity set (resolved through the container) or the type.

Raises:

ODataError – If the service declares no such entity, naming the ones it has.

Return type:

dict[str, dict[str, Any]]

odatadol.metadata.parse_entity_metadata(body, entity)[source]#

The properties of entity in a CSDL document, inherited ones first.

entity may be an entity set, a qualified type (Namespace.Name or Alias.Name) or, when only one schema declares it, a type’s short name. Annotations are merged from inline <Annotation> and out-of-line <Annotations Target=...> elements.

Return type:

dict[str, dict[str, Any]]