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.main(version, *paths)
gws.plugin.alkis.data.geo_info_dok.generator.CDIR
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.Q3 = '"""'
gws.plugin.alkis.data.geo_info_dok.generator.WRAP_WIDTH = 110
gws.plugin.alkis.data.geo_info_dok.generator.CATEGORY_ROOTS
gws.plugin.alkis.data.geo_info_dok.generator.T_CLASS = 'class'
gws.plugin.alkis.data.geo_info_dok.generator.T_CATEGORY = 'category'
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.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__)

"""
gws.plugin.alkis.data.geo_info_dok.generator.STD_TYPES
class gws.plugin.alkis.data.geo_info_dok.generator.Node(**kwargs)
class gws.plugin.alkis.data.geo_info_dok.generator.Parser
nodes: list[Node] = []
finalize()
make_key(node)
filter_category_roots()
resolve_supers()
check_flag(node, prop, root)
find_node(name)
get_doc(rec)
get_hname(node)
add_enum_value(node, k, v)
set_type_from_record(node, rec)
set_type_from_string(node, s)
set_cardinality_from_string(node, s=None)
set_cardinality_from_record(node, rec)
class gws.plugin.alkis.data.geo_info_dok.generator.Parser6

Bases: Parser

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

Bases: Parser

engine: sqlalchemy.Engine
parse(paths)
select(table)
build_from_sqlite()
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]+
        )
    """
tokens = []
token_pos = 0
parse(path)
tokenize(text)
tok()
pop()
eof()
parse_sequence()
parse_item()
parse_list()
parse_object()
parse_value()
class gws.plugin.alkis.data.geo_info_dok.generator.PythonGenerator(nodes, version: str)
unknownTypes
knownTypes
nameToNode
keyToNode
seen
metadata
py = []
build()
make_nodes(nodes)
make_node(node)
make_union(node)
make_category(node)
make_enum(node)
make_class(node)
make_metadata(node)
make_class_metadata(node)
get_type(typ, quoted=True)
get_docstring(node, indent, prepend_name)
gws.plugin.alkis.data.geo_info_dok.generator.popattr(obj, attr, default=None)
gws.plugin.alkis.data.geo_info_dok.generator.wrap_indent(s, indent)
gws.plugin.alkis.data.geo_info_dok.generator.quote(s)
gws.plugin.alkis.data.geo_info_dok.generator.to_name(s)
gws.plugin.alkis.data.geo_info_dok.generator.json_dict_body(d, indent)
gws.plugin.alkis.data.geo_info_dok.generator.comma
gws.plugin.alkis.data.geo_info_dok.generator.nl