A Python desktop application for tracking water quality samples and analysis requests for the Water Resources Research Center.
- Sample Search: Quickly find samples by UNH ID or Sample Name
- Project Search: Search for samples based on project information
- Sample Import: Import sample data from standardized Excel submission forms
- Record Editing: Edit sample information and analysis requests
- Database Integration: Seamlessly connects to Access database
- Due Date Tracking: Set and monitor analysis due dates with calendar view
- Data Existence Indicators: Visual indicators showing when measurement data exists for samples
- Download the latest release from the Releases page
- Extract the ZIP file to a location of your choice
- Place the Access database file (
wrrc database 110907.accdb) in the same folder as the executable - Run
SampleTracker.exe
- Windows 10/11
- Microsoft Access Database Driver (included with most Microsoft Office installations)
- No Python installation needed
-
Clone the repository:
git clone https://github.com/yourusername/sampletracker.git -
Create a virtual environment:
python -m venv venv -
Activate the virtual environment:
venv\Scripts\activate -
Install dependencies:
pip install -r requirements.txt -
Run the application:
python sampletracking.py
- Open the "Search" tab
- Enter a UNH ID or Sample Name in the "Search by Sample" field
- Click "Search Sample" to find matching records
- Alternatively, search by project information using the "Search by Project" field
- Open the "Import" tab
- Enter a Project Name (this will be used in the database)
- Click "Browse" to select a sample submission Excel file
- Review the data in the preview panes
- Click "Import Data" to add the samples to the database
- Find a record using the search functionality
- Select the record in the results list
- Click "Edit Selected" or double-click the record
- Make changes in the "Edit" tab
- Click "Save Changes" to update the database
- Navigate to the "Calendar" tab to view all samples with due dates
- Use the month and year dropdowns or navigation buttons to move between months
- Days with due samples display the UNH# of samples due that day
- Click on a day to view all samples due on that day in the list below
- Double-click a sample in the list to open it for editing
- When editing a sample, set or update its due date using the date picker in the edit form
- When editing a sample, green "Data exists" indicators appear next to fields where measurement data exists in the database
- This helps users quickly identify which analyses have been completed
- Indicators are shown for common analysis types like DOC, TDN, Anions, Cations, etc.
The application expects Excel files with the following sheets:
- Project Information: Contains contact details and project metadata
- Sample Information: Contains sample data and analysis requests
- Chain of Custody: (Optional) Tracking information
Sample submission templates are available in the templates folder.
To create an executable:
-
Activate your virtual environment
-
Install PyInstaller:
pip install pyinstaller -
Build the executable using the spec file:
pyinstaller sample_tracker.spec -
The executable will be created in the
distfolder
- Database Connection Issues: Ensure the Access database file is in the same folder as the executable and that you have the Microsoft Access Database Driver installed
- Import Errors: Verify that your Excel file follows the required template format
- Search Not Returning Results: Try using partial terms or searching by project instead
- Calendar Navigation: If calendar navigation buttons aren't working in the date picker, try using the dropdown selectors instead
This project is licensed under the MIT License - see the LICENSE file for details.
- Created for the Water Resources Research Center by Miguel Leon
- Built with CustomTkinter
- Uses Pandas for data processing
- Calendar functionality implemented with tkcalendar