A Python tool to generate attribution files for open source software dependencies, with enhanced support for license expressions, "others" URLs, global project configuration, and component modification details.
This project was built using Cursor, the world's best IDE for AI-powered development.
- Generates comprehensive attribution files for open source components
- Supports multiple input formats (Excel, JSON, YAML)
- Handles complex license expressions (AND, OR combinations)
- Supports "others" URLs for additional notices
- Tracks component modifications
- Configurable project settings
- Customizable templates
- Python 3.8+
- uv (Python package installer)
- Clone the repository:
git clone <repository-url>
cd Attribution_Generator- Install dependencies using uv:
uv pip install -e .- Configure your project settings in
main.py:
PROJECT_NAME = "Your Project Name"
COPYRIGHT_HOLDER_FULL = "Your Full Company Name L.L.C."
COPYRIGHT_HOLDER_SHORT = "YourCo"-
Prepare your components file:
- Use
components.xlsxfor Excel input - Required columns: name, copyright, license
- Optional columns: version, others_url, modified, modified_url
- Use
-
Run the generator:
python main.pyThe tool will generate an ATTRIBUTIONS.txt file with properly formatted attributions for all components.
Required columns:
- name: Component name
- copyright: Copyright notice
- license: License expression
Optional columns:
- version: Component version
- others_url: URL for additional notices
- modified: Whether the component is modified (true/false)
- modified_url: URL to modified code
{
"components": [
{
"name": "Component Name",
"copyright": "Copyright Notice",
"license": "License Expression",
"version": "1.0.0",
"others_url": "https://example.com/notice",
"modified": false,
"modified_url": null
}
]
}Contains license texts and definitions. Example:
MIT: |
MIT License
Copyright (c) [year] [fullname]
...
OTHERS_DEFINITION: |
[Default text for components with "others" license]Contains templates for different sections of the attribution file. Example:
header: |
Open Source Software Attribution
Project: {project_name}
Copyright (c) {copyright_holder_full}
...
component_listing: |
{serial_number}. {name} (v{version})
{copyright}{modification_notice}This project uses pyproject.toml for dependency management and uv as the package installer. The main dependencies are:
- pandas (>=1.5.0)
- PyYAML (>=6.0)
- openpyxl (>=3.0.0)
The project maintains high code quality standards through:
- Automated Pylint checks on every push
- Testing against Python 3.8, 3.9, and 3.10
- Comprehensive docstrings and type hints
- PEP 8 style compliance
MIT License
Contributions are welcome! Please feel free to submit a Pull Request.