A CLI tool for updating analytic data and statistics for the family-pickem.com website.
- Pick Statistics: Calculate correct pick percentages and totals for users
- Team Preferences: Track most and least picked teams per user
- Weeks Won: Calculate weekly and seasonal wins
- Daemon Mode: Continuous data collection and updates
- Database Upserts: Automatic create/update operations for user statistics
go build -o pickemctl
# Pull from Docker Hub
docker pull familypickem/pickemctl:latest
# Or build locally
docker build -t familypickem/pickemctl .
Copy the example configuration file and update with your settings:
cp config.yaml.example config.yaml
Edit config.yaml
with your database credentials and preferences.
- Pick Statistics:
./pickemctl pickStats
- Most Picked Teams:
./pickemctl topPicked
- Least Picked Teams:
./pickemctl leastPicked
Start the daemon for continuous data collection:
./pickemctl daemon
Run in daemon mode with mounted config:
docker run -d \
--name pickemctl-daemon \
-v $(pwd)/config.yaml:/app/config.yaml:ro \
familypickem/pickemctl
Run individual commands:
docker run --rm \
-v $(pwd)/config.yaml:/app/config.yaml:ro \
familypickem/pickemctl \
/app/pickemctl userStats
See DOCKER.md for comprehensive Docker usage examples.
The daemon will:
- Run all analytics functions immediately
- Continue running them at the configured interval (default: 30 seconds)
- Automatically update or create user statistics records in the database
The tool uses intelligent upsert operations that:
- Create new user statistics records if they don't exist
- Update existing records with only the fields being modified
- Preserve existing data when updating specific statistics
All operations work with the PostgreSQL database defined in the Django userStats
model.
Setting | Description | Default |
---|---|---|
database.host |
PostgreSQL host | localhost |
database.port |
PostgreSQL port | 5432 |
database.user |
Database username | postgres |
database.password |
Database password | (none) |
database.name |
Database name | pickem |
database.sslmode |
SSL mode | disable |
app.season.current |
Current NFL season | 2425 |
daemon.interval |
Update interval (seconds) | 30 |