This is the source for the govhack-science website highlighing sciency datasets at govhack-science.github.io
Content served by Jekyll, with layout and nice bits stolen shamelessly from Rasmus Andersson
- Ruby
- RubyGems
- NodeJS
- Python
- Jekyll
https://jekyllrb.com/docs/installation/ https://jekyllrb.com/docs/github-pages/
Our friends at GitHub have provided the github-pages gem which is used to manage Jekyll and its dependencies on GitHub Pages. Using it in your projects means that when you deploy your site to GitHub Pages, you will not be caught by unexpected differences between various versions of the gems. To use the currently-deployed version of the gem in your project, add the following to your Gemfile
The best way to install Jekyll is via RubyGems. At the terminal prompt, simply run the following command to install Jekyll:
$ gem install github-pages
All of the GitHub pages flavour of Jekyll, and its gem dependencies are automatically installed by the above command, so you won’t have to worry about them at all.
https://jekyllrb.com/docs/usage/
jekyll serve
If you receive a message like:
Could not find gem 'github-pages (= 67)' in any of the gem sources listed in your Gemfile or available on this machine. (Bundler::GemNotFound)
Then it means GitHub has upgraded their github-pages
gem version, so just run bundle install
from the root directory to upgrade to the latest set of deps GitHub is using.
We have a few Python tools to help us manage the ingest of data, and generating a static JSON API.
To setup a virtual environment run (from the root directory):
virtualenv --system-site-packages venv
. venv/bin/activate
pip install -r python/requirements.txt
In 2017, data for the portal is fetch directly from Google Sheets
You'll need to copy of the Google Sheets Client Secret before running the import scripts. If you're reading this, you most likely have access to the GOT Google Drive - the file is in GovHack Drive 💾/Portal Data/google_sheets_client_secret.json
.
Download this file to your computer, and place it in the python
directory of this project.
ATTENTION: do not commit this file 👍
The first time you run one of the scripts, you will be asked to grant access to the Portal App to use your account to access to Google Sheets. Grant access or you won't be able to run any of the scripts.
In python/govhack_config.py
there are a few Spreadsheet IDS grabbed from Google Drive. The sheets only need to bo accessible by anyone with a GovHack Google account, no need for them to be public - even if the data in those sheets will then be made public by this site... 🔒
This scripts uses a Google Sheets to create .md
files for all regions and locations. Any local edit to files in pages/_jurisdictions
and pages/_locations/*
will be lost!
To run:
. venv/bin/activate
cd python
python regions_locations.py
This script takes a .csv
file exported from FormStack and generates a set of new .md files.
To run:
. venv/bin/activate
python python/mentors.py
The script tries its best to auto-populate the mentor files based on what exists in Jabberwocky (events, organisations, et cetera), but you should still read the output of the script to check for any WARNINGS
you might need to fix up.
This script takes a directroy of .csv
file downloaded from Google Drive and generates a set of new .md files.
To run:
. venv/bin/activate
python python/prizes.py
The script tries its best to auto-populate the prize files based on what exists in Jabberwocky (events, organisations, et cetera), but you should still read the output of the script to check for any WARNINGS
you might need to fix up.
This script takes a .csv
file exported from FormStack and generates a set of new .md files.
To run:
. venv/bin/activate
python python/datasets.py
The script tries its best to auto-populate the dataset files based on what exists in Jabberwocky (events, organisations, et cetera), but you should still read the output of the script to check for any WARNINGS
you might need to fix up.
This script need to be run everytime we change the frontmatter of an .md file so that we always serve the latest content to govhack.org. This generates one .json.
file for each Markdown file thanks to the magic of python-frontmatter.
At this stage it's a straight conversion from one to the other - with no magic to compose the full entity object, include links to and from it, yet.
To run:
. venv/bin/activate
python python/frontmatter-to-json.py
Tip: If
importError: No module named yaml
, try this SO. Otherwise thevirtualenv --system-site-packages venv
command should have imported the usual suspects like pyyaml.