AI-powered activity logger that captures screenshots and analyzes user actions
Project description
Activity Logger
An AI-powered activity logger that captures screenshots and analyzes user actions using OpenAI's GPT-4 Vision API. Perfect for tracking computer usage patterns, productivity analysis, or creating activity reports.
Features
- Automatic Screenshot Capture: Takes screenshots when you press Enter
- AI-Powered Analysis: Uses OpenAI's GPT-4 Vision to analyze and describe actions
- Activity Logging: Saves detailed logs with timestamps
- Low-Level Key Interception: Captures Enter key presses before system processing
- Threaded Processing: Non-blocking screenshot capture and analysis
- macOS Optimized: Built specifically for macOS with proper accessibility permissions
Prerequisites
- macOS: This tool is designed for macOS and uses macOS-specific APIs
- Python 3.8+: Required for running the application
- OpenAI API Key: You'll need an API key from OpenAI to use the AI analysis features
- Accessibility Permissions: The app requires accessibility permissions to intercept keyboard events
Installation
Setup
1. Download activity-logger using pip
pip3 install activity_logger
Then add your python to your path
echo 'export PATH="$HOME/Library/Python/3.14/bin:$PATH"' >> ~/.zshrc
# Restart zsh to apply the changes
exec zsh
# Run the activity-logger command
activity-logger
Provide your OpenAI API key as a flag to activity-logger, and you can customize the behavior.
activity-logger --api-key sk-... # Start with specific API key
activity-logger # Start with default settings
activity-logger --api-key sk-... # Start with specific API key
activity-logger --screenshots ~/MyScreenshots # Custom screenshot folder
activity-logger --logs ~/MyLogs # Custom log directory
2. Grant Accessibility Permissions
- Open System Preferences → Security & Privacy → Privacy
- Select Accessibility from the left sidebar
- Click the lock icon and enter your password
- Add your Terminal application (or the application you're running the script from)
- Make sure it's checked/enabled
Usage
Command Line Usage
After installation, you can run the activity logger with:
activity-logger
How It Works
- Start the application: Run the command above
- View logs: Check the
logs/directory for daily activity logs
Log Files
- Activity Logs: Saved to
logs/actions_log_MM-DD-YY.txt - Format: Each log entry includes timestamp
File Structure
activity_logger/
├── activity_logger.py # Main application
├── setup.py # Package setup
├── requirements.txt # Dependencies
├── README.md # This file
├── LICENSE # MIT License
├── MANIFEST.in # Package manifest
├── logs/ # Activity logs directory
│ └── actions_log_*.txt # Daily log files
└── ~/Desktop/Screenshots/ # Screenshots (created automatically)
Dependencies
pyautogui- Screenshot capturepynput- Input monitoringPillow- Image processingopenai- AI API integrationpyobjc-framework-Quartz- macOS system integration
Troubleshooting
"Could not create event tap!" Error
This means the application doesn't have accessibility permissions:
- Go to System Preferences → Security & Privacy → Privacy → Accessibility
- Add your Terminal/Python application
- Make sure it's enabled
- Restart the application
OpenAI API Errors
- Verify your API key is set correctly:
echo $OPENAI_API_KEY - Check you have sufficient API credits
- Ensure you have access to the GPT-4 Vision API
Performance Issues
- The app uses threading to avoid blocking
- Screenshots and AI analysis run in background threads
- If experiencing lag, consider reducing
max_tokensin the API call
Privacy & Security
- Screenshots are saved locally to your Desktop
- AI analysis is sent to OpenAI (review their privacy policy)
- No data is sent to third parties except OpenAI
- You can delete screenshots and logs at any time
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
If you encounter issues:
- Check the troubleshooting section above
- Make sure you're running on macOS with proper permissions
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file activity_logger-1.0.0.tar.gz.
File metadata
- Download URL: activity_logger-1.0.0.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad03c1452fa3a5a8ca3a9542c3b1feedeffc3666065987a5ffdcf83801ab5374
|
|
| MD5 |
26800a5a605098e3ef4786c9fbc37daa
|
|
| BLAKE2b-256 |
fbe9dd96a649a5511de5d46b2492e172284efd6b319cf2c02cd5512cf5d0f9e6
|
File details
Details for the file activity_logger-1.0.0-py3-none-any.whl.
File metadata
- Download URL: activity_logger-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ffafaf1325e11f7e8f99379eda3d5e3e3e74b9f97cb0504811cd659b7f6aaa94
|
|
| MD5 |
6d9ca668a3dcc77d5c690e7433a5c5f6
|
|
| BLAKE2b-256 |
a6ab218def45aaf7d3d8ea0d25cae22ccb2af1bc25b83c332ff3390e379e1909
|