aria.parser.reading

Reading package.

aria.parser.reading.ReadingContext Reading context.
ReaderException ARIA reader exception.
ReaderNotFoundError ARIA reader error: reader not found for source.
ReaderSyntaxError ARIA read format error.
AlreadyReadException ARIA reader exception: already read.
JinjaReader ARIA Jinja reader.
JsonReader ARIA JSON reader.
Locator Stores location information (line and column numbers) for agnostic raw data.
deepcopy_with_locators Like deepcopy(), but also copies over locators.
copy_locators Copies over _locator for all elements, recursively.
RawReader ARIA raw reader.
Reader Base class for ARIA readers.
ReaderSource Base class for ARIA reader sources.
DefaultReaderSource The default ARIA reader source will generate a YamlReader for locations that end in “.yaml”, a JsonReader for locations that end in “.json”, and a JinjaReader for locations that end in “.jinja”.
YamlReader ARIA YAML reader.
exception aria.parser.reading.ReaderException(message=None, cause=None, cause_traceback=None)

Bases: aria.exceptions.AriaException

ARIA reader exception.

exception aria.parser.reading.ReaderNotFoundError(message=None, cause=None, cause_traceback=None)

Bases: aria.parser.reading.exceptions.ReaderException

ARIA reader error: reader not found for source.

exception aria.parser.reading.ReaderSyntaxError(message, cause=None, cause_tb=None, location=None, line=None, column=None, locator=None, snippet=None, level=1)

Bases: aria.parser.reading.exceptions.ReaderException

ARIA read format error.

exception aria.parser.reading.AlreadyReadException(message=None, cause=None, cause_traceback=None)

Bases: aria.parser.reading.exceptions.ReaderException

ARIA reader exception: already read.

class aria.parser.reading.Reader(context, location, loader)

Bases: object

Base class for ARIA readers.

Readers provide agnostic raw data by consuming aria.parser.loading.Loader instances.

load()
read()
class aria.parser.reading.ReaderSource

Bases: object

Base class for ARIA reader sources.

Reader sources provide appropriate Reader instances for locations.

static get_reader(context, location, loader)
class aria.parser.reading.DefaultReaderSource(literal_reader_class=<class 'aria.parser.reading.yaml.YamlReader'>)

Bases: aria.parser.reading.source.ReaderSource

The default ARIA reader source will generate a YamlReader for locations that end in “.yaml”, a JsonReader for locations that end in “.json”, and a JinjaReader for locations that end in “.jinja”.

get_reader(context, location, loader)
class aria.parser.reading.ReadingContext

Bases: object

Reading context.

Variables:
  • reader_source (ReaderSource) – for finding reader instances
  • reader (type) – overrides reader_source with a specific class
class aria.parser.reading.RawReader(context, location, loader)

Bases: aria.parser.reading.reader.Reader

ARIA raw reader.

Expects to receive agnostic raw data from the loader, and so does nothing to it.

read()
class aria.parser.reading.Locator(location, line, column, children=None)

Bases: object

Stores location information (line and column numbers) for agnostic raw data.

dump(key=None)
get_child(*names)
merge(locator)
aria.parser.reading.deepcopy_with_locators(value)

Like deepcopy(), but also copies over locators.

aria.parser.reading.copy_locators(target, source)

Copies over _locator for all elements, recursively.

Assumes that target and source have exactly the same list/dict structure.

class aria.parser.reading.YamlReader(context, location, loader)

Bases: aria.parser.reading.reader.Reader

ARIA YAML reader.

read()
class aria.parser.reading.JsonReader(context, location, loader)

Bases: aria.parser.reading.reader.Reader

ARIA JSON reader.

read()
class aria.parser.reading.JinjaReader(context, location, loader)

Bases: aria.parser.reading.reader.Reader

ARIA Jinja reader.

Forwards the rendered result to a new reader in the reader source.

read()