This Streamlit application serves as a tool for tracking and managing body measurements over time. It enables users to record, visualize, and analyze weight and body composition metrics: weight along with body fat, water content, and muscle mass. OnTheScales is designed for individuals who want to monitor their body composition changes, whether for fitness goals, health monitoring, or weight management. While being comprehensive in its tracking capabilities, it maintains a straightforward and practical approach to data management and visualization.
--> check out OnTheScales @ streamlit.app to see it in action!
Data Visualization:
- Chronological progress tracking
- Trend analysis with customizable time ranges
- Prediction when target weight will be reached based on current trend
- Body composition analysis (percentage or kg)
Measurement Management:
- Record and edit body measurements (weight in kg, body composition in %)
- Auto-fill feature based on previous measurements
- Date-based entries with update and delete capabilities
- Tabular overview of all recorded measurements
User Management:
- Multi-user support with individual profiles
- User profile customization (height and target weight)
- Basic user administration (add, edit, delete)
- Data persistence through CSV files
Withings Integration:
- Connect to Withings smart scales for automatic data sync
- OAuth2 authentication with automatic token refresh
- Selective import of measurements with date tracking
- Support for weight, body fat, water, and muscle mass data
The interface aims to be straightforward and functional, focusing on providing useful information without unnecessary complexity. As the application runs entirely on your local machine, all data remains under your control and is stored locally in simple CSV files. This ensures complete data privacy while maintaining easy access to your data for backup or external analysis if desired.
Clone this repository
git clone https://github.com/azabicki/OnTheScalesOnTheScales is written in Python 3.11.2.
Install a virtual environment according to your OS:
python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txtpy -m venv venv
venv\Scripts\activate
pip install --upgrade pip
pip install -r requirements.txtIf you are using *conda, an environment.yml file is provided, which also installs the required python version 3.11.2:
conda env create -f conda_environment.yml
conda activate OnTheScalesTo start the app, run the following command:
streamlit run OnTheScales.pyThe app will be available at http://localhost:8501.
Using OnTheScales is straightforward. Simply select a user profile from the dropdown menu, and start tracking your body composition. You can also create multiple user profiles to track different persons.
To connect your Withings smart scale:
- Create a Withings App: Visit the Withings Developer Portal and create a new app
- Configure Credentials: Set up your API credentials in
.streamlit/secrets.toml(seeWITHINGS_SETUP.mdfor detailed instructions) - Connect Users: Go to "Manage Users" page and connect each user to their Withings account
- Sync Data: Use the "Measurements" page to fetch and selectively import Withings data
For detailed setup instructions, see WITHINGS_SETUP.md.
OnTheScales can also be run on a Raspberry Pi, I did it on an older Raspberry Pi 3B+. The following steps are required to install and run OnTheScales on a Raspberry Pi:
python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txtThere is also script to start OnTheScales in the misc/RaspPi folder. It will start the app in the background and automatically start when the Raspberry Pi boots.
In the following commands, first edit the path to the OnTheScales folder, and then run these in your bash console:
EDIT_THIS_PATH="/path/to/OnTheScales"
chmod +x $EDIT_THIS_PATH/misc/RaspPi/autorun_OnTheScales.sh
echo "# ----- autostart OnTheScales after boot -----" >> ~/.bashrc
echo "if [ \$(tty) == /dev/tty1 ]; then" >> ~/.bashrc
echo " $EDIT_THIS_PATH/misc/RaspPi/autorun_OnTheScales.sh" >> ~/.bashrc
echo "fi" >> ~/.bashrcThis application runs entirely locally on your machine. All user data is stored in CSV files in the data/ directory, ensuring complete control over your personal information.
Feel free to open issues or submit pull requests if you have suggestions for improvements.
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.