A Python-based Command-Line Interface (CLI) application for managing a multi-user project tracker system. This tool allows administrators to efficiently manage users, projects, and tasks through structured CLI commands with persistent data storage.
- User Management: Create, update, delete, and list users
- Project Management: Create, assign, and manage projects with due dates
- Task Management: Create, assign, complete, and track tasks within projects
- Data Persistence: JSON-based local file storage for all entities
- Relationship Management: One-to-many relationships between users and projects, projects and tasks
- Assign multiple users to projects as contributors
- Assign tasks to specific users
- Track task completion status
- Maintain data integrity with cascade delete operations
- Comprehensive error handling and validation
- User-friendly CLI interface with clear feedback
- Python 3.7 or higher
- pip (Python package manager)
-
Clone or download the project files
# Create project directory mkdir project-management-cli cd project-management-cli # Copy the main.py file to this directory
-
Install dependencies
pip install -r requirements.txt
-
Make the script executable (optional)
chmod +x main.py
python main.py <command> <subcommand> [options]python main.py user add --name "John Doe" --email "john@example.com"python main.py user listpython main.py user update --id 123456 --name "John Smith" --email "johnsmith@example.com"python main.py user delete --id 123456python main.py project add --user 123456 --title "Website Redesign" --description "Complete redesign of company website" --due-date "2024-12-31"python main.py project listpython main.py project list --user 123456python main.py project update --id 789012 --title "New Title" --description "Updated description" --due-date "2025-01-15"python main.py project delete --id 789012python main.py project add-user --user 123456 --project 789012python main.py task add --project 789012 --title "Design homepage mockup"python main.py task add --project 789012 --title "Implement user authentication" --assigned-to 123456python main.py task listpython main.py task list --project 789012python main.py task list --user 123456python main.py task complete --id 345678python main.py task update --id 345678 --title "New task title" --status "in-progress" --assigned-to 123456python main.py task update --id 345678 --assigned-to 0python main.py task delete --id 345678Here's a complete example demonstrating typical usage:
# 1. Create users
python main.py user add --name "Alice Johnson" --email "alice@company.com"
python main.py user add --name "Bob Smith" --email "bob@company.com"
# 2. Create a project (assume Alice's user ID is 123456)
python main.py project add --user 123456 --title "Mobile App Development" --description "Develop iOS and Android app" --due-date "2024-06-30"
# 3. Add Bob to the project (assume project ID is 789012 and Bob's ID is 654321)
python main.py project add-user --user 654321 --project 789012
# 4. Create tasks
python main.py task add --project 789012 --title "UI/UX Design" --assigned-to 123456
python main.py task add --project 789012 --title "Backend API" --assigned-to 654321
python main.py task add --project 789012 --title "Testing & QA"
# 5. Mark a task as complete (assume task ID is 111222)
python main.py task complete --id 111222
# 6. View project progress
python main.py task list --project 789012
python main.py project list --user 123456The application creates a data/ directory with the following JSON files:
users.json- Stores user information and project assignmentsprojects.json- Stores project details and contributor liststasks.json- Stores task information and assignments
- Users ↔ Projects: Many-to-many relationship (users can contribute to multiple projects)
- Projects → Tasks: One-to-many relationship (projects contain multiple tasks)
- Users ← Tasks: Many-to-one relationship (tasks can be assigned to users)
python test_project_manager.pyThe test suite includes comprehensive coverage for:
- User class functionality and data persistence
- Project class functionality and relationships
- Task class functionality and status management
- DataManager JSON serialization/deserialization
- ProjectManager business logic and cascade operations
- Error handling and edge cases
# Test error handling
python main.py user delete --id 999999 # Non-existent user
python main.py project add --user 999999 --title "Test" --description "Test" --due-date "2024-12-31" # Invalid user
# Test data persistence
python main.py user add --name "Test User" --email "test@example.com"
# Restart application
python main.py user list # Should show previously created user- User Class: Manages user data and project relationships
- Project Class: Handles project information and contributor/task relationships
- Task Class: Manages task details and assignment status
- DataManager Class: Handles JSON persistence and file I/O operations
- ProjectManager Class: Main business logic coordinator
- Repository Pattern: DataManager abstracts data storage
- Command Pattern: CLI commands map to specific business operations
- Factory Pattern: ID generation for entities
- Cascade Operations: Maintains referential integrity
- argparse: CLI argument parsing and help generation
- json: Data serialization and persistence
- pathlib: Cross-platform file system operations
- datetime: Timestamp generation and handling
- typing: Type hints for better code documentation
The application includes comprehensive error handling for:
- Invalid user inputs and command arguments
- Missing or corrupted data files
- Referential integrity violations
- File system permission issues
- JSON parsing errors
- Single-threaded: Not designed for concurrent access
- Local Storage Only: Uses local JSON files (no database integration)
- Basic Validation: Limited input validation for email formats and dates
- No User Authentication: All operations are administrative level
- Memory Usage: Loads all data into memory (not suitable for very large datasets)
Potential improvements for future versions:
- Database integration (SQLite, PostgreSQL)
- Web-based interface
- User authentication and role-based permissions
- Advanced search and filtering capabilities
- Task dependencies and scheduling
- Email notifications and reminders
- Data export/import functionality (CSV, Excel)
- Multi-project templates and cloning
To contribute to this project:
- Follow the existing code structure and naming conventions
- Add unit tests for any new functionality
- Update documentation for new features
- Ensure all tests pass before submitting changes
This project is created for educational purposes as part of a Python programming assignment.
For issues or questions:
- Check the error messages for specific guidance
- Review the command help:
python main.py --help - Examine the test cases for usage examples
- Verify data file integrity in the
data/directory