Open Data Day is a gathering of citizens in cities around the world to write applications, liberate data, create visualizations and publish analyses using open public data to show support for and encourage the adoption of open data policies by the world's local, regional and national governments.
You're invited. Again. The next Open Data Day will take place between 1-7 March 2025.
Check http://opendataday.org for public website.
- This site is built with Lektor.
- npm is required (
sudo apt install nodejs npmon Ubuntu). - Install dependencies:
make install - Start dev server:
make serve gruntwill watch for changes to your SCSS files, and also icons (see svgstore).lektor deploywill deploy to the gh-pages branch, putting changes live, if you have deploy permissions.
To translate the site we need to duplicate the contents.lr file, and save with the language code in the file name, like contents+de.lr.
We also need to add translations to:
If we are adding new language to the site we also need to:
- Add the new language to languages.json
- Add the language to project.lektorproject
Requirements:
- Python >= 3.12
- Node JS >= 20
- NPM >= 10
Setup:
- Create a python >=3.12 virtual environment
- Base requirements are defined in the
requirements.infile (to ejecutepip-compileit's required to updaterequirements.txt) pip install -r requirements.txtnvm use 20npm cilektor server- http://127.0.0.1:5000/
Events are populated using a very lightweight import script which:
- Imports data from a google sheet
- Does some cleaning and checks on it
- Writes it out to a JSON file
- Generates .lr files for any event report
- Harvests any images we want to use on the site
- Commits the JSON file, event reports and images back to the repo (remember to
git pull) - Builds and deploys the site
This is run in a github action with a workflow_dispatch trigger, which allows our content manager to maintain the events in a spreadsheet update the site via a button in github.
In general, the import process is designed to be lax about missing fields and unexpected values. Some minimal validation is performed on the fields we require for the site to build correctly. Any errors will fail the action and be displayed in the GitHub actions log. e.g:
marshmallow.exceptions.ValidationError: {'Latitude': ['Not a valid number.'], 'Longitude': ['Not a valid number.']}
These will need to be resolved by editing the input spreadsheet.
There are three bits of setup we need to do each year:
Before we start, we will need a Google Form and a Google Sheet to collect the event data. This is the 2026 form.
You can just duplicate last year's form and create a new Google Sheet for responses.
Also, ensure you allow view access for everyone with the link to the google sheet to allow the ETL script to read the data.
The Google Sheet identificators must be added to the /etl/202x.py file.
This script will attempt to read the data from the Google Sheet so you need to ensure this sheet is public.
- 1. Create a new import job:
- Create
./etl/202x.pybased on a previous year's file - Fill in
PUBLISH_ID,SHEET_IDandTHIS_YEAR - Update schema as applicable if the spreadsheet has changed, but we want to keep the JSON output the same if possible as every year's events page uses the same template to render the JSON to HTML
- Replace the GitHub workflow update-data.yml with the new job tu run
python ./etl/202X.py. We don't need to keep running last year's script. - Once we've run the job for the first time it will create a
/databags/202x.jsonfile. This is consumed by the events list page and the events map - We can run
python ./etl/202x.pylocally as well as triggering it with GitHub actions
- Create
- 2. Update the map:
- Update map.js file to consume the new JSON file
- 3. Create a new events page:
- Create
./content/events/202x/contents.lrbased on a previous year's file - Fill in the fields
- Create a stub
./content/events/202x/contents.<lang>.lrfor each supported alternate language - It is not necessary to manually create the
./content/events/202x/reportsdir or edit any content under it. This will be automatically generated by the import job. - Add the new 202x events page to the menu:
- Add
/events/202xto the list of events pages (main-nav.json). - Update the 'Search events' link to the current year (main-nav.json).
- Repeat for each supported alternate language
- Add
- Create
For reference, you can check the:
The previous version of the site has been moved to the v1 branch.