Redivis doesn't have the concept of scheduling notebooks to run. This is a bummer for datasets that we want to update with any kind of frequency. It does, however, let you run a notebook via its API. That's what this program does, and it can be used on any notebook.
In the future, whenever Redivis implements scheduled runs, we can hopefully discontinue these — though we'll still need to update the dataset pages in WordPress
Coming soon: Once WordPress updating is available via API, this program will do that too — Nass is working on it.
- Fork this repo.
- Rename the repo following this convention
BUTLER_[name_of_dataset]. So for ther_gvadataset it'sBUTLER_r_gva. - Change the following variables in the
get.pyfile.
username = "[YOUR_USERNAME]" # Replace with your Redivis username
workflow_name = "[WORKFLOW_NAME]" # Replace with your workflow name
notebook_name = "[NOTEBOOK_NAME]" # Replace with your notebook name
Sticking with the r_gva example that would be:
username = "glevines"
workflow_name = "gva:kgtn"
notebook_name = "gva_updater:x4bf"
Note: The URL format for a notebook https://redivis.com/workflows/kgtn-7vy84cvbr/notebooks/x4bf-9jy3tv2tp is the easiest way to grab the 'qualified reference' information required after the : above. This is the URL grabbed from the gva workflow with the gva_updater notebook selected in the workflow's lefthand tree diagram.
- Lastly, set the time that the notebook should run in the
dataset-butler.ymlfile. If you don't wanna think too hard about crontab time formatting here's a helpful resource.
# schedule: # Uncomment to enable scheduled runs
# - cron: '0 10 * * *' # Uncomment to enable scheduled runs
- Test that it works by clicking the
Actionsbutton above on the GitHub page. ClickPython applicationin the left rail and then click the grayRun workflowbutton in the blue highlighted area.