The Productivity Tracker Plugin is a VSCode extension designed to monitor and analyze programming productivity. It tracks coding activity, trains a machine learning model, and provides insights into productivity trends.
- Tracks characters added to files during coding sessions.
- Saves activity logs to
productivity_log.jsonin the user's workspace. - Uses a Decision Tree model to predict productivity trends based on day and time.
- Displays productivity insights and time series analysis in VSCode.
- Provides options to retrain the model and generate insights via the Command Palette.
Clone the project to your local machine:
git clone <repository-url>
cd productivity-tracker-pluginEnsure Node.js and npm are installed on your system.
Install the required dependencies for the extension:
npm installInstall the Python libraries required for the ML scripts:
pip install -r requirements.txt- Open the project folder in VSCode.
- Open the
productivitytrackerpluginworkspace.
- Press
F5in VSCode to run the extension in a new Extension Development Host window.
- Open a folder in VSCode. The extension automatically tracks coding activity and saves it to
productivity_log.jsonin the folder.
- Open the Command Palette (
Ctrl+Shift+PorCmd+Shift+Pon Mac). - Search for and select "ProductivityTracker: Generate Insights".
- Insights are displayed in VSCode, and a time series plot is saved as
productivity_plot.pngin the workspace folder.
- The model is retrained automatically when insights are generated.
- The raw productivity logs are saved as
productivity_log.jsonin the workspace.
extension.js: Main file for the VSCode extension.train_model.py: Python script for training the Decision Tree model.generate_insights.py: Python script for generating productivity insights and plots.requirements.txt: Python dependencies.test_productivity_log.json: Sample log data for testing.
- Node.js (16.x or higher)
- Python (3.8 or higher)
- VSCode
scikit-learnpandasmatplotlib
Install all required Python libraries using:
pip install -r requirements.txt- No Productivity Log Found: Ensure you have a folder open in VSCode before using the extension.
- Python Script Errors: Ensure all Python dependencies are installed and the paths to the scripts are correct.
- Empty Plot: Ensure there is sufficient data in the
productivity_log.jsonfile.
- Use the VSCode Output tab to check for logs.
- Check the console logs in the Extension Development Host window.