I created this app for my grandmother. She wanted to keep track of books she had read, and whether she would reread any given book. The book list would also have to be easily searchable.
- Go to the Google Cloud Console
- Create a new project or select an existing one
- Enable the Google Sheets API and Google Drive API
- Go to Credentials > Create Credentials > Service Account
- After creating it, go to Keys > Add Key > Create new key > JSON
This downloads a .json file of the service account details and private key.
You will need to create a secrets.toml file inside a .streamlit folder, containing
the details of the Google Service Account in the following format:
[gcp_service_account]
type = "service_account"
project_id = "your-project-id"
private_key_id = "..."
private_key = """-----BEGIN PRIVATE KEY-----
YOUR
PRIVATE
KEY
-----END PRIVATE KEY-----"""
client_email = "your-service-account@project-id.iam.gserviceaccount.com"To run the app locally, run the following commands in the terminal:
- (Optional but recommended) Create a virtual environment
python -m venv venv; and activate this environment,source venv/bin/activate. - Install the requirements,
pip install -r requirements.txt - Run
streamlit run app.pyto launch the app
This app is currently deployed at https://silkenodwell-book-tracker-app-mibcug.streamlit.app/.
To deploy at a different location, choose the "Deploy" button on the app, and select Streamlit Community Cloud (or a different option if desired).