A mobile-friendly Streamlit web application for collecting drilling data in the field and generating professional Excel reports for lithosphere layer analysis.
This application solves the problem of manually transcribing drilling data from paper forms to Excel spreadsheets. Field workers can now:
- Collect drilling data directly on smartphones/tablets
- Generate professional Excel reports automatically
- Ensure data consistency and validation
- Work offline (planned feature)
- Mobile-Responsive Interface: Optimized for smartphones and tablets
- Form-Based Data Collection: Intuitive forms for site info and layer data
- Real-Time Validation: Immediate feedback on data quality
- Professional Excel Reports: Multiple report templates with charts
- Data Visualization: Charts and graphs for layer analysis
- Export Options: Multiple Excel formats and templates
- Site name and location
- Drilling date and operator
- Project details
- Drilling method and depth
- Weather conditions
- Depth ranges (from/to)
- Rock type classification
- Hardness assessment
- Physical properties (color, porosity)
- Geological features (water, fractures, fossils)
- Weathering degree
- Detailed descriptions
- Framework: Streamlit (Python web framework)
- Data Processing: Pandas for data manipulation
- Excel Generation: OpenPyXL for professional reports
- Validation: Custom validation system
- Charts: Plotly for interactive visualizations
- Mobile Support: Responsive CSS and touch-friendly interface
appli_sondage/
βββ app.py # Main Streamlit application
βββ requirements.txt # Python dependencies
βββ README.md # Project documentation
βββ config/
β βββ settings.py # Configuration settings
βββ src/
β βββ components/
β β βββ form_components.py # Form UI components
β βββ utils/
β βββ excel_generator.py # Excel report generation
β βββ data_validator.py # Data validation utilities
βββ templates/ # Excel templates
βββ data/
β βββ reports/ # Generated reports
β βββ samples/ # Sample data
β βββ temp/ # Temporary files
βββ tests/ # Unit tests
-
Install Pixi: Follow instructions at pixi.sh
-
Clone and setup:
git clone <repository-url>
cd appli_sondage
pixi install- Run the application:
# Local development
pixi run dev
# Network access (for mobile devices)
pixi run dev-network- Clone the repository:
git clone <repository-url>
cd appli_sondage- Install dependencies:
pip install -r requirements.txt- Run the application:
streamlit run app.py- Local: http://localhost:8501
- Network: Access from mobile devices on same network
- Connect to WiFi: Ensure mobile device is on same network as computer
- Open Browser: Navigate to the network URL shown in terminal
- Add to Home Screen: (Optional) Add as PWA for app-like experience
- Collect Data: Use touch-friendly interface to input drilling data
- Generate Reports: Create and download Excel reports directly to device
- Site information summary
- Layer data table
- Basic statistics and analysis
- Rock type distribution charts
- All standard features plus:
- Advanced geological analysis
- Engineering recommendations
- Additional charts and visualizations
- Condensed report with key information
- Perfect for quick field reports
The app includes comprehensive validation:
- Required field checking
- Depth sequence validation
- Layer continuity verification
- Rock type classification
- Cross-validation between site and layer data
Edit config/settings.py to add new rock types:
ROCK_TYPES = {
"sedimentary": ["Clay", "Sand", "Your_New_Type"],
# ...
}- Place custom templates in
templates/directory - Update template list in
config/settings.py - Templates should follow OpenPyXL format structure
Run tests using Pixi:
# Run all tests
pixi run test
# Run tests with coverage
pixi run test-coverage
# Lint code
pixi run lint
# Format code
pixi run formatOr with traditional Python:
python -m pytest tests/App won't start: Check Python version (3.8+ required)
python --version
pip install --upgrade streamlitMobile access issues: Ensure devices are on same network
streamlit run app.py --server.address 0.0.0.0Excel generation errors: Verify OpenPyXL installation
pip install --upgrade openpyxl# With Pixi
pixi run dev-network
# With traditional Python
streamlit run app.py --server.address 0.0.0.0 --server.port 8501- Streamlit Cloud: Deploy directly from GitHub
- Heroku: Use provided Procfile
- Docker: Container-based deployment
Add to app.py for offline capabilities:
st.set_page_config(
page_title="Drilling Data",
page_icon="ποΈ",
layout="wide",
initial_sidebar_state="expanded",
menu_items={
'Get Help': None,
'Report a bug': None,
'About': "Drilling Data Collection App v1.0"
}
)- Offline data collection with sync
- GPS location integration
- Photo attachments for layers
- Database integration for data persistence
- Multi-language support
- Advanced geological analysis algorithms
- User authentication and project management
- Real-time collaboration features
- Fork the repository
- Create feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open Pull Request
This project is licensed under the MIT License - see LICENSE file for details.
- Nathan - Initial development and geological expertise
- Streamlit team for the excellent framework
- OpenPyXL contributors for Excel generation capabilities
- Geological survey teams for domain expertise and feedback
Built with β€οΈ for field geologists and drilling professionals