Thank you for your interest in contributing to the LiteLLM CloudZero ETL project! We welcome contributions from the community and appreciate your help in making this tool better.
- Getting Started
- Development Setup
- Contributing Process
- Code Style and Standards
- Testing
- Submitting Changes
- Reporting Issues
- Code Review Process
- Community Guidelines
Before contributing, please:
- Read this document completely
- Review our Code of Conduct
- Check existing issues and pull requests
- Join our community discussions if available
- Python 3.11 or higher
- uv for dependency management
- Git for version control
- Access to a LiteLLM PostgreSQL database for testing (optional)
-
Fork and Clone the Repository
git clone https://github.com/YOUR_USERNAME/litellm-cz-etl.git cd litellm-cz-etl -
Set Up Python Environment
# Install dependencies using uv uv sync # Activate virtual environment source .venv/bin/activate
-
Install in Development Mode
uv pip install -e . -
Verify Installation
ll2cz --help
-
Set Up Configuration (Optional)
# Create example config ll2cz config example # Edit with your database credentials ll2cz config edit
src/ll2cz/
├── __init__.py # Package initialization and version
├── cli.py # Command-line interface
├── database.py # PostgreSQL database connection
├── cached_database.py # SQLite caching layer
├── cache.py # Cache management
├── analysis.py # Data analysis and reporting
├── transform.py # CBF data transformation
├── czrn.py # CloudZero Resource Names
├── output.py # CSV and API output
└── config.py # Configuration management
tests/
├── test_czrn.py # CZRN generation tests
├── test_transform.py # Data transformation tests
└── test_output.py # Output format tests
- Check open issues for tasks
- Look for issues labeled
good first issuefor beginners - Propose new features by opening an issue first
git checkout -b feature/your-feature-name
# or
git checkout -b fix/issue-description- Write clean, readable code following our style guidelines
- Add tests for new functionality
- Update documentation as needed
- Follow commit message conventions
# Run tests
uv run pytest
# Run specific test files
uv run pytest tests/test_czrn.py
# Run with coverage (if configured)
uv run pytest --cov=ll2cz- Follow PEP 8 Python style guide
- Use Black for code formatting (if configured)
- Use type hints where appropriate
- Write docstrings for public functions and classes
- Functions should be focused and do one thing well
- Use descriptive variable and function names
- Keep functions reasonably short (prefer < 50 lines)
- Add comments for complex logic
- Handle errors gracefully with proper exception handling
- Update README.md if you change installation or usage
- Add docstrings to new functions and classes
- Update type hints for new parameters
- Include examples in docstrings where helpful
# Standard library imports
import json
from pathlib import Path
from typing import Optional
# Third-party imports
import polars as pl
from rich.console import Console
# Local imports
from .database import LiteLLMDatabase
from .config import Config# Run all tests
uv run pytest
# Run with verbose output
uv run pytest -v
# Run specific test
uv run pytest tests/test_czrn.py::test_czrn_generation- Write tests for new features and bug fixes
- Use descriptive test names that explain what is being tested
- Include both positive and negative test cases
- Test edge cases and error conditions
Example test structure:
def test_czrn_generation_with_valid_data():
"""Test CZRN generation with valid LiteLLM data."""
# Arrange
data = create_test_data()
# Act
result = generate_czrn(data)
# Assert
assert result.startswith('czrn:litellm:')
assert 'gpt-4' in result-
Ensure your branch is up to date
git checkout main git pull upstream main git checkout your-branch git rebase main
-
Push your changes
git push origin your-branch
-
Create a Pull Request
- Use a clear, descriptive title
- Reference any related issues
- Provide a detailed description of changes
- Include testing instructions if applicable
When creating a PR, please include:
## Description
Brief description of changes
## Related Issues
Fixes #issue_number
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Documentation update
- [ ] Refactoring
## Testing
- [ ] Tests pass locally
- [ ] New tests added for new functionality
- [ ] Manual testing completed
## Checklist
- [ ] Code follows style guidelines
- [ ] Self-review completed
- [ ] Documentation updated
- [ ] No breaking changes (or breaking changes documented)When reporting bugs, please include:
- Clear description of the issue
- Steps to reproduce the problem
- Expected behavior vs actual behavior
- Environment information:
- Python version
- Operating system
- Package version
- Database version (if applicable)
- Error messages or logs
- Minimal code example that reproduces the issue
For feature requests:
- Describe the problem you're trying to solve
- Explain the proposed solution
- Consider alternative solutions
- Assess the impact on existing functionality
- Be open to feedback and suggestions
- Respond promptly to review comments
- Make requested changes in a timely manner
- Ask questions if review feedback is unclear
Code reviews will evaluate:
- Functionality: Does the code work as intended?
- Code Quality: Is the code clean, readable, and maintainable?
- Testing: Are there adequate tests for the changes?
- Documentation: Is documentation updated appropriately?
- Performance: Are there any performance implications?
- Security: Are there any security concerns?
- Use welcoming and inclusive language
- Respect differing viewpoints and experiences
- Accept constructive criticism gracefully
- Focus on what is best for the community
- Help others learn and grow
- Share knowledge and expertise
- Provide constructive feedback
- Celebrate others' contributions
- Keep discussions focused and on-topic
- Avoid personal attacks or inflammatory language
- Report inappropriate behavior to maintainers
- Follow our Code of Conduct
If you need help:
- Check the README.md for basic usage
- Review existing issues
- Open a new issue with the
questionlabel - Reach out to maintainers if needed
By contributing to this project, you agree that your contributions will be licensed under the Apache License 2.0.
Thank you for taking the time to contribute to the LiteLLM CloudZero ETL project! Your contributions help make this tool better for everyone in the community.