Skip to main content

Utility functions and scripts to manage CDP GitHub repositories.

Project description

cdp-gh-utils

Build Status Documentation

Utility functions and scripts to manage CDP (and other) GitHub repositories.


Installation

Stable Release: pip install cdp-gh-utils
Development Head: pip install git+https://github.com/CouncilDataProject/cdp-gh-utils.git

Backfilling Instances

⚠️ ⚠️ Note: prior to using this library, be sure to create a GitHub Personal Access Token and store it to a GITHUB_TOKEN environment variable (.env file also works). ⚠️ ⚠️

❯ backfill-cdp-instance -h

usage: backfill-cdp-instance [-h] [--outfile OUTFILE] [--iter_days ITER_DAYS] [--overlap_days OVERLAP_DAYS] [--token TOKEN] [--workflow_filename WORKFLOW_FILENAME] [--ref REF]
                             [--ignore_errors] [--debug]
                             owner repo start_datetime end_datetime

Iteratively triggers the Event Gather Pipeline workflow via GitHub Actions to backfill a CDP instance. Only one workflow run will ever happen at a single time.

positional arguments:
  owner                 The organization which hosts the instance. i.e. 'CouncilDataProject'
  repo                  The organization which hosts the instance. i.e. 'seattle'
  start_datetime        The start datetime of the backfill in ISO format. i.e. '2022-01-01'
  end_datetime          The end datetime of the backfill in ISO format. i.e. '2023-01-01'

options:
  -h, --help            show this help message and exit
  --outfile OUTFILE     Path to the where the backfill results should be stored to CSV.
  --iter_days ITER_DAYS
                        The number of days to backfill during each workflow run.
  --overlap_days OVERLAP_DAYS
                        The number of days to overlap each workflow run by.
  --token TOKEN         GitHub Personal Access Token to use for initializing workflow runs.
  --workflow_filename WORKFLOW_FILENAME
                        The name of the workflow file which acts as the event gather pipeline action definition.
  --ref REF             The branch or git ref name to trigger the workflow on.
  --ignore_errors       Try to backfill all batches regardless of errors.
  --debug               Run with debug logging.
backfill-cdp-instance evamaxfield cdp-dev 2023-02-01 2023-03-01

Documentation

For full package documentation please visit CouncilDataProject.github.io/cdp-gh-utils.

Development

See CONTRIBUTING.md for information related to developing the code.

MIT License

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

cdp-gh-utils-0.2.0.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

cdp_gh_utils-0.2.0-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file cdp-gh-utils-0.2.0.tar.gz.

File metadata

  • Download URL: cdp-gh-utils-0.2.0.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for cdp-gh-utils-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8580fa9714d26337b1855ff42aeeb3b254d9778ea357d03ef2fa377da658d51c
MD5 cc6637df3c0515fb379ea1e4086f09d4
BLAKE2b-256 a5117f3710f1d3b490f7910425bc19e4f21df17b6d52c63dfa7851c22200ea9c

See more details on using hashes here.

File details

Details for the file cdp_gh_utils-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cdp_gh_utils-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 87f3a31ababd832956b2b419289f2c70fe081622bdee269c3256cada67095cc2
MD5 94cfea388d6c1c9bda6aa33bbc78b468
BLAKE2b-256 0fa81053838fba629759e33c2a23e98850e4f79ac498eeec6f98fbf0776465a8

See more details on using hashes here.

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