Two parts. One: Python code that fetches the schedule using guidebook Open API and writes a json file
TLDR: cd to python directory and run python main.py to get the schedule in schedule.json. you need to have put the .env file in the same directory with your Guidebook API key.
Two: React app that reads the json file and displays the schedule in a nice way.
To start develope, type npm start in the root directory.
I use pyenv to manage my python environment. pyenv and virtualenv via brew v3.12
brew update
brew install python pyenv pyenv-virtualenv
pyenv install 3.12
pyenv virtualenv 3.12 AAJA
pyenv activate AAJA
pip install -r requirements.txtand this blog post as reference for setting up the virtual environment.
The script fetches the schedule from Guidebook Open API and writes it to schedule.json.
Running the script
python main.pySee memo.md for more details
To deploy, simply run npm run deploy in the root directory. which will push contents of /dist to the gh-pages branch.
To embed the github page use following code in your HTML part of file:
<side-chain src="https://daigofuji.github.io/aaja25-schedule/"></side-chain>
<script src="https://apps.npr.org/sidechain/loader.js"></script>
<p style="font-size: 12px;">Calendar not displaying? <button onclick="location.reload()" style="font-size: 12px;border:none;">Reload</button></p>
This project was made with Node v20.19.0.
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the TS template for information on how to integrate TypeScript and typescript-eslint in your project.