|
ORE Studio 0.0.4
|
Functions | |
| Path | get_repo_root () |
| str | get_header () |
| str | escape_sql_string (str s) |
| generate_catalog_sql (dict manifest, Path output_file) | |
| generate_methodology_sql (dict manifest, str methodology_text, Path output_file) | |
| generate_dataset_sql (dict manifest, Path output_file) | |
| generate_dataset_tag_sql (dict manifest, Path output_file) | |
| generate_dataset_dependency_sql (dict manifest, Path output_file) | |
| generate_master_sql (Path output_file) | |
| main () | |
Generates SQL populate scripts for IP to Country metadata (catalog, methodology, datasets).
Reads the manifest.json and methodology.txt from external/ip2country/ and generates:
- ip2country_catalog_populate.sql
- ip2country_methodology_populate.sql
- ip2country_dataset_populate.sql
- populate_ip2country.sql (master include file)
Usage:
python3 ip2country_generate_metadata_sql.py
python3 ip2country_generate_metadata_sql.py --manifest-dir /path/to/external/ip2country
python3 ip2country_generate_metadata_sql.py --output-dir /path/to/output
| Path get_repo_root | ( | ) |
Get the repository root directory.

| str get_header | ( | ) |
Generate SQL file header.

| str escape_sql_string | ( | str | s | ) |
Escape single quotes for SQL strings.

| generate_catalog_sql | ( | dict | manifest, |
| Path | output_file | ||
| ) |
Generate the catalog populate SQL file.

| generate_methodology_sql | ( | dict | manifest, |
| str | methodology_text, | ||
| Path | output_file | ||
| ) |
Generate the methodology populate SQL file.

| generate_dataset_sql | ( | dict | manifest, |
| Path | output_file | ||
| ) |
Generate the dataset populate SQL file.

| generate_dataset_tag_sql | ( | dict | manifest, |
| Path | output_file | ||
| ) |
Generate the dataset tag populate SQL file.

| generate_dataset_dependency_sql | ( | dict | manifest, |
| Path | output_file | ||
| ) |
Generate the dataset dependency populate SQL file.

| generate_master_sql | ( | Path | output_file | ) |
Generate the populate_ip2country.sql master include file.
