hdx-data-freshness-dbclean


Namehdx-data-freshness-dbclean JSON
Version 1.0.2 PyPI version JSON
download
home_pagehttps://github.com/OCHA-DAP/hdx-data-freshness-dbclean
SummaryHDX Data Freshness Database Clean
upload_time2023-05-30 00:35:34
maintainer
docs_urlNone
authorMichael Rans
requires_python>=3.8
licenseMIT
keywords hdx fresh freshness database
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            ### Utility to clean Freshness Database
[![Build Status](https://github.com/OCHA-DAP/hdx-data-freshness-dbclean/actions/workflows/run-python-tests.yml/badge.svg)](https://github.com/OCHA-DAP/hdx-data-freshness-dbclean/actions/workflows/run-python-tests.yml)
[![Coverage Status](https://codecov.io/gh/OCHA-DAP/hdx-data-freshness-dbclean/branch/main/graph/badge.svg?token=JpWZc5js4y)](https://codecov.io/gh/OCHA-DAP/hdx-data-freshness-dbclean)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)

# DEPRECATED - code moved to https://github.com/OCHA-DAP/hdx-data-freshness

This script cleans the freshness database.


### Usage

    python -m hdx.freshness.dbactions [-db/--db_uri=] [-dp/--db_params=] [action]

Either db_uri or db_params must be provided or the environment variable DB_URI
must be set. db_uri or DB_URI are of form: 
`postgresql+psycopg://user:password@host:port/database`

db_params is of form:
`database=XXX,host=X.X.X.X,username=XXX,password=XXX,port=1234,
ssh_host=X.X.X.X,ssh_port=1234,ssh_username=XXX,
ssh_private_key=/home/XXX/.ssh/keyfile`

action: 

- "clone" which creates a shallow clone of the database which only
has all the runs and one dataset and its resources per run for testing 
purposes.

- "clean" (the default) cleans the database by removing runs according to these 
rules:
  1. Keep a handful of runs around the end of each quarter all the way back to 
  the first run in 2017
  2. Keep daily runs going back 2 years
  3. Keep weekly runs from 2 to 4 years back
  4. Keep monthly runs for 4 years back and earlier

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/OCHA-DAP/hdx-data-freshness-dbclean",
    "name": "hdx-data-freshness-dbclean",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "HDX,fresh,freshness,database",
    "author": "Michael Rans",
    "author_email": "rans@email.com",
    "download_url": "https://files.pythonhosted.org/packages/07/82/8ec84882ec36153451c06c98bc33aaf54b4b93e3d2de410683e0cf5299cf/hdx-data-freshness-dbclean-1.0.2.tar.gz",
    "platform": "any",
    "description": "### Utility to clean Freshness Database\n[![Build Status](https://github.com/OCHA-DAP/hdx-data-freshness-dbclean/actions/workflows/run-python-tests.yml/badge.svg)](https://github.com/OCHA-DAP/hdx-data-freshness-dbclean/actions/workflows/run-python-tests.yml)\n[![Coverage Status](https://codecov.io/gh/OCHA-DAP/hdx-data-freshness-dbclean/branch/main/graph/badge.svg?token=JpWZc5js4y)](https://codecov.io/gh/OCHA-DAP/hdx-data-freshness-dbclean)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)\n\n# DEPRECATED - code moved to https://github.com/OCHA-DAP/hdx-data-freshness\n\nThis script cleans the freshness database.\n\n\n### Usage\n\n    python -m hdx.freshness.dbactions [-db/--db_uri=] [-dp/--db_params=] [action]\n\nEither db_uri or db_params must be provided or the environment variable DB_URI\nmust be set. db_uri or DB_URI are of form: \n`postgresql+psycopg://user:password@host:port/database`\n\ndb_params is of form:\n`database=XXX,host=X.X.X.X,username=XXX,password=XXX,port=1234,\nssh_host=X.X.X.X,ssh_port=1234,ssh_username=XXX,\nssh_private_key=/home/XXX/.ssh/keyfile`\n\naction: \n\n- \"clone\" which creates a shallow clone of the database which only\nhas all the runs and one dataset and its resources per run for testing \npurposes.\n\n- \"clean\" (the default) cleans the database by removing runs according to these \nrules:\n  1. Keep a handful of runs around the end of each quarter all the way back to \n  the first run in 2017\n  2. Keep daily runs going back 2 years\n  3. Keep weekly runs from 2 to 4 years back\n  4. Keep monthly runs for 4 years back and earlier\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "HDX Data Freshness Database Clean",
    "version": "1.0.2",
    "project_urls": {
        "Homepage": "https://github.com/OCHA-DAP/hdx-data-freshness-dbclean"
    },
    "split_keywords": [
        "hdx",
        "fresh",
        "freshness",
        "database"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dbdf9acb94f034d07eec97225a4eace02c5c9bcab566f10a081d176df75fb2e5",
                "md5": "1eadb4a0eaeff4496c5ff47fe784926a",
                "sha256": "8532ce3ba26ac5ba3d463acd4979b597eef199ec2918154da94fd0d1c5580d48"
            },
            "downloads": -1,
            "filename": "hdx_data_freshness_dbclean-1.0.2-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1eadb4a0eaeff4496c5ff47fe784926a",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.8",
            "size": 7817,
            "upload_time": "2023-05-30T00:35:33",
            "upload_time_iso_8601": "2023-05-30T00:35:33.170682Z",
            "url": "https://files.pythonhosted.org/packages/db/df/9acb94f034d07eec97225a4eace02c5c9bcab566f10a081d176df75fb2e5/hdx_data_freshness_dbclean-1.0.2-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "07828ec84882ec36153451c06c98bc33aaf54b4b93e3d2de410683e0cf5299cf",
                "md5": "dfdfaae7179e84a317f6b9f73a60071e",
                "sha256": "cacbd61897f2ec7dc30491339ffb26ae66c3c43a1691900f0809afa6088ff9f6"
            },
            "downloads": -1,
            "filename": "hdx-data-freshness-dbclean-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "dfdfaae7179e84a317f6b9f73a60071e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 301244,
            "upload_time": "2023-05-30T00:35:34",
            "upload_time_iso_8601": "2023-05-30T00:35:34.750817Z",
            "url": "https://files.pythonhosted.org/packages/07/82/8ec84882ec36153451c06c98bc33aaf54b4b93e3d2de410683e0cf5299cf/hdx-data-freshness-dbclean-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-30 00:35:34",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "OCHA-DAP",
    "github_project": "hdx-data-freshness-dbclean",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "lcname": "hdx-data-freshness-dbclean"
}
        
Elapsed time: 0.07885s