gws.plugin.alkis.data.geo_info_dok.generator

Schema generator.

Generate python APIs and object databases from GeoInfoDok sources.

For version 6 use RR cat files Basisschema.cat and Fachschema.cat For version 7 use the QEA (sqlite) file AAA-7.1.2.qea

Usage:

generator.py 6 /path/to/Basisschema.cat /path/to/Fachschema.cat
generator.py 7 /path/to/AAA-7.1.2.qea

Source code: gws.plugin.alkis.data.geo_info_dok.generator

Module Contents

gws.plugin.alkis.data.geo_info_dok.generator.CATEGORY_ROOTS
class gws.plugin.alkis.data.geo_info_dok.generator.CatParser

Parser for RR cat files.

re_token = Multiline-String
Show Value
"""(?x)
        ( [()] )
        |
        ( [_a-zA-Z] \w* )
        |
        (
            " (?: \\. | [^"] )* "
            |
            [^()\s]+
        )
    """
token_pos = 0
tokens = []
eof()
parse(path)
parse_item()
parse_list()
parse_object()
parse_sequence()
parse_value()
pop()
tok()
tokenize(text)
gws.plugin.alkis.data.geo_info_dok.generator.CDIR
gws.plugin.alkis.data.geo_info_dok.generator.comma
gws.plugin.alkis.data.geo_info_dok.generator.json_dict_body(d, indent)
gws.plugin.alkis.data.geo_info_dok.generator.main(version, *paths)
gws.plugin.alkis.data.geo_info_dok.generator.nl
class gws.plugin.alkis.data.geo_info_dok.generator.Node(**kwargs)
class gws.plugin.alkis.data.geo_info_dok.generator.Parser
nodes: list[Node] = []
add_enum_value(node, k, v)
check_flag(node, prop, root)
filter_category_roots()
finalize()
find_node(name)
get_doc(rec)
get_hname(node)
make_key(node)
resolve_supers()
set_cardinality_from_record(node, rec)
set_cardinality_from_string(node, s=None)
set_type_from_record(node, rec)
set_type_from_string(node, s)
class gws.plugin.alkis.data.geo_info_dok.generator.Parser6

Bases: Parser

parse(paths)
parse_associations(rec)
parse_object(rec, parent)
class gws.plugin.alkis.data.geo_info_dok.generator.Parser7

Bases: Parser

engine: sqlalchemy.Engine
build_from_sqlite()
parse(paths)
select(table)
gws.plugin.alkis.data.geo_info_dok.generator.popattr(obj, attr, default=None)
gws.plugin.alkis.data.geo_info_dok.generator.PY_HEAD = Multiline-String
Show Value
""""""GeoInfoDok <VERSION> schema.

(c) 2023 Arbeitsgemeinschaft der Vermessungsverwaltungen der Länder der Bundesrepublik Deutschland

https://www.adv-online.de/GeoInfoDok/

This code is automatically generated from .CAT/.QEA source files.
"""

from typing import Any, Literal, Optional, TypeAlias, Union
from datetime import date, datetime


# gws:nospec

class Object:
    pass


class Category:
    pass


class Enumeration:
    pass


def object__getattr__(self, item):
    if item.startswith('_'):
        raise AttributeError()
    return None


setattr(Object, '__getattr__', object__getattr__)
setattr(Category, '__getattr__', object__getattr__)
setattr(Enumeration, '__getattr__', object__getattr__)

"""
class gws.plugin.alkis.data.geo_info_dok.generator.PythonGenerator(nodes, version: str)
keyToNode
knownTypes
metadata
nameToNode
py = []
seen
unknownTypes
build()
get_docstring(node, indent, prepend_name)
get_type(typ, quoted=True)
make_category(node)
make_class(node)
make_class_metadata(node)
make_enum(node)
make_metadata(node)
make_node(node)
make_nodes(nodes)
make_union(node)
gws.plugin.alkis.data.geo_info_dok.generator.Q3 = '"""'
gws.plugin.alkis.data.geo_info_dok.generator.quote(s)
gws.plugin.alkis.data.geo_info_dok.generator.STD_TYPES
gws.plugin.alkis.data.geo_info_dok.generator.T_CATEGORY = 'category'
gws.plugin.alkis.data.geo_info_dok.generator.T_CLASS = 'class'
gws.plugin.alkis.data.geo_info_dok.generator.T_ENUM = 'enum'
gws.plugin.alkis.data.geo_info_dok.generator.T_UNION = 'union'
gws.plugin.alkis.data.geo_info_dok.generator.TAB
gws.plugin.alkis.data.geo_info_dok.generator.TAB2
gws.plugin.alkis.data.geo_info_dok.generator.to_name(s)
gws.plugin.alkis.data.geo_info_dok.generator.wrap_indent(s, indent)
gws.plugin.alkis.data.geo_info_dok.generator.WRAP_WIDTH = 110