Skip to main content

Python package to extract table names from github url and check whether the tables are stale

Project description

stale_data_detection

Extract table names from GitHub Repositories and check whether the tables are stale.

Requirements

pip install sql-metadata

Folder Structures:

stale_data_detection
├── test
│   ├── __init__.py
│   └── demo.ipynb
│   └── test_flag_stale_table.py
│   └── test_extract_tables.py
├── stale_data_detection
│   ├── __init__.py
│   ├── extract_table_names.py
│   ├── flag_stale_table.py
│   └── get_table_update_status.py
└── README.md

extract_table_names.py

Get raw download urls of all files given a GitHub repo or subdirectory and files extension (default .hql file). Read file content and extract names of all tables mentioned in the .hql files.

flag_stale_table.py

Read table content into Pandas DataFrame and check whether a table is stale given the table name.

get_table_update_status.py

Identify all columns that likely contain update dates and return the last update date given a table Pandas DataFrame

test_extract_tables.py

Test module in extract_table_names.py.
Usage:

python test_extract_tables.py -u github/repo/url -b branch_name -a access_token -e file_extension

GitHub repo URL and branch name are required. Other arguments are optional.

test_flag_stale_table.py

Test module in flag_stale_table.py.
Usage:

python test_extract_tables.py -u github/repo/url -b branch_name -a access_token -e file_extension -o path/to/output/file

GitHub repo URL and branch name are required. Other arguments are optional.

demo.ipynb

Demo functions in Jupyter notebook.

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

stale_data_detection-0.5.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stale_data_detection-0.5-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file stale_data_detection-0.5.tar.gz.

File metadata

  • Download URL: stale_data_detection-0.5.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.8.2 requests/2.28.1 setuptools/65.6.3 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.7.16

File hashes

Hashes for stale_data_detection-0.5.tar.gz
Algorithm Hash digest
SHA256 8665c87325b8108191f8e938f8e2259664460574b3aad69fbc83cedd0c0a086f
MD5 1427d58c8d8acf6a8360f3efd25c14d9
BLAKE2b-256 9030f4e49980dc93fa69c1e3ca9d29c0338466be0ec0db02b1708cb5eda4435d

See more details on using hashes here.

File details

Details for the file stale_data_detection-0.5-py3-none-any.whl.

File metadata

  • Download URL: stale_data_detection-0.5-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.8.2 requests/2.28.1 setuptools/65.6.3 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.7.16

File hashes

Hashes for stale_data_detection-0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3b0fffc897547f1fe0782087d5d1cc5d7280cc94d8989d75709f85edd5af74a2
MD5 71a94d6d4773b4382d041e308ebdbda2
BLAKE2b-256 d9bd37b716e4e0cbf389a1d9eb87ee38e29cf0e7bd4a3d2f5d13f79d41b4398d

See more details on using hashes here.

Supported by

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