ProjectMap
A modern Python tool for creating visual maps of project structures in the terminal.
Installation
pip install projectmap
Features
- Interactive Project Mapping: Visualize your project's structure with clear, hierarchical representations
- Smart Filtering: Built-in ignore patterns for common development artifacts
- Flexible Configuration: Easily customize which files and directories to include or exclude
- Clean Unicode Output: Beautiful terminal visualization using box-drawing characters
- Python API & CLI: Use as a command-line tool or integrate into your Python applications
- Intelligent Sorting: Organized display with directories first, followed by files
Quick Start
Command Line
projectmap
projectmap --path /path/to/project
projectmap --path . --ignore-dirs "logs" "temp" --ignore-files "*.tmp" "*.bak"
Python API
from projectmap import ProjectStructureVisualizer
visualizer = ProjectStructureVisualizer()
visualizer.visualize('.')
visualizer = ProjectStructureVisualizer(
ignore_dirs={'logs', 'temp'},
ignore_files={'.env', '*.bak'}
)
visualizer.visualize('/path/to/project')
Example Output
Project Structure (/your/project):
ββββββββββββββββββββββββββββββ
βββ src
β βββ projectmap
β βββ __init__.py
β βββ visualizer.py
βββ tests
β βββ test_visualizer.py
βββ docs
β βββ api.md
β βββ usage.md
βββ README.md
βββ pyproject.toml
βββ LICENSE
ββββββββββββββββββββββββββββββ
Configuration
Default Ignored Patterns
Directories
DEFAULT_IGNORE_DIRS = {
'__pycache__',
'.git',
'.idea',
'venv',
'.venv',
'env',
'node_modules',
'.pytest_cache',
'.mypy_cache',
'.ruff_cache',
'build',
'dist',
'htmlcov',
'.coverage',
'.tox'
}
Files
DEFAULT_IGNORE_FILES = {
'.gitignore',
'.env',
'.env.local',
'.env.development',
'.env.production',
'.DS_Store',
'*.pyc',
'*.pyo',
'*.pyd',
'.python-version',
'*.so',
'*.egg',
'*.egg-info',
'*.log',
'.coverage',
'coverage.xml',
'.coverage.*'
}
Development Setup
git clone https://github.com/yourusername/projectmap.git
cd projectmap
python -m venv venv
source venv/bin/activate
pip install -e ".[dev]"
pytest
Project Structure
projectmap/
βββ src/
β βββ projectmap/
β βββ __init__.py
β βββ visualizer.py
βββ tests/
β βββ test_visualizer.py
βββ README.md
βββ pyproject.toml
βββ LICENSE
Package Configuration (pyproject.toml)
Roadmap
Version 0.2.0
Contributing
We welcome contributions! Here's how you can help:
- Check our issues page
- Fork the repository
- Create a feature branch
- Write your changes
- Submit a pull request
License
MIT License - feel free to use this project for your needs.