Skip to main content

Set of tools and utilities connected with press code generator.

Project description

genpypress

This library contains several code generator helpers. It is connected to the press code generator.

This package will only run on Windows (submodule table uses external binary as dependency, the binary only exists for Windows).

Usage

Command line application

  • ph --help - zobrazí nápovědu
  • ph apatch - provede patch TPT skriptů pro asynchronní stage
  • ph cc - připraví SQL a/nebo BTEQ skripty tabulek na podmíněné nasazení

Markdown (mapping) parser

from pathlib import Path
from genpypress import mapping

# import a file in markdown format
file = Path("TGT_ACCS_METH_RLTD_906_900_915_AMR_NIC_PCR_2_M2C.md", encoding="utf-8")
map = mapping.from_markdown(file.read_text(encoding="utf-8"))

# access table mapping property
print("Type of historization:", map.etl_historization)

# access a column mapping property (case insensitive)
print("hist_type =", map["hist_type"].transformation_rule)

# nonexisting column will - of course - blow the code up
try:
    print(map["not available"])
except KeyError as err:
    print(f"error: {err}")

Table parser

Only supported on MS Windows.

from genpypress import table
filename = "ddl_script.sql"
data = table.from_file(filename)
t = data[0]

# access to table properties and/or columns
print("table name", t.name)
print("first column", t[0])
print("column by name", t["column_name"])

# deletion of columns by name and/or index
del t["another_column"]
del t[O]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

genpypress-0.1.48.tar.gz (3.1 MB view hashes)

Uploaded Source

Built Distribution

genpypress-0.1.48-py3-none-any.whl (3.2 MB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page