mirror of
https://github.com/pinecone-io/examples.git
synced 2023-10-11 20:04:54 +03:00
Examples Admin Scripts
This directory contains helper scripts for admin of the /examples repo.
Shields Checker
The beginning of every notebook in the examples repo should include a Colab and nbviewer shield to allow easy navigation to either service. To confirm validity and update changing links we can use the Shields Checker script.
To use the script navigate to the root directory of the examples repo and run the following in a terminal window:
python scripts/shields-checker.py run --path . --shield-error False --update False
This will run the shields checker script across all notebooks in the directory, it will not update shield links, and it will not raise an error if no shields are found in a notebook.
We can adjust the default parameters depending on our intended use:
--pathallows us to specify a specific directory likelearnordocs. Default value is.(search all directories).--shield-errorallows us to raise aValueErrorif set toTrueand if no shields are found in a notebook. Default value isFalsewhich logs a warning to the console but does not raise an error.--updatespecifies whether shield links should be automatically updated. When set toTrueboth Colab and nbviewer links will be updated if they are found to be invalid. Default value isFalsewhich only logs whether links are valid or not.