We love your input! We want to make contributing to this project as easy and transparent as possible.
-
Fork the repo and create your branch from
main. -
Clone your fork:
git clone https://github.com/your-username/palabra-ai-python.git cd palabra-ai-python -
Install uv (if not already installed):
curl -LsSf https://astral.sh/uv/install.sh | sh -
Create virtual environment and install in development mode:
# Create virtual environment uv venv # Activate it src .venv/bin/activate # On Windows: .venv\Scripts\activate # Install package in development mode with all dependencies uv sync --dev # OR alternatively: # uv pip install -e . --all-extras
-
Verify installation:
python -c "import palabra_ai; print(palabra_ai.__version__)"
When you use uv sync --dev or uv pip install -e .:
- The
-eflag means "editable" (development mode) - Your code changes are immediately reflected without reinstalling
- The package is linked, not copied, to your virtual environment
- You can edit code and test changes instantly
- Make your changes
- Run tests:
uv run pytest -vs
- Check code style:
uv run ruff check . uv run ruff format .
- Run type checking (if applicable):
uv run mypy src/palabra_ai
# Run all tests
uv run pytest
# Run with coverage
uv run pytest --cov=palabra_ai --cov-report=html
# Run specific test file
uv run pytest tests/test_client.py
# Run tests with output
uv run pytest -vs- Write tests for any new functionality
- Place tests in the
tests/directory - Follow existing test patterns
- Aim for high test coverage
We use ruff for both linting and formatting:
# Check for issues
uv run ruff check .
# Fix auto-fixable issues
uv run ruff check . --fix
# Format code
uv run ruff format .- Follow PEP 8
- Use type hints where appropriate
- Write descriptive variable names
- Add docstrings to all public functions/classes
- Keep functions focused and small
To automatically run checks before each commit:
# Install pre-commit
uv pip install pre-commit
# Set up hooks
pre-commit install
# Run manually
pre-commit run --all-files-
Create a feature branch:
git checkout -b feature/amazing-feature
-
Make your changes and test thoroughly
-
Commit with clear messages:
git add . git commit -m "Add amazing feature"
-
Push to your fork:
git push origin feature/amazing-feature
-
Open a Pull Request
- Ensure all tests pass
- Update README.md if needed
- Update documentation for new features
- Add tests for new functionality
- Ensure code follows style guidelines
- Request review from maintainers
feat:New featurefix:Bug fixdocs:Documentation changestest:Test additions/changesrefactor:Code refactoringchore:Maintenance tasks
Example: feat: Add support for batch translation
If you get ModuleNotFoundError: No module named 'palabra_ai':
# Make sure you installed in development mode
uv pip install -e .
# or
uv sync --dev# Reinstall all dependencies
uv sync --reinstall
# Or clean install
rm -rf .venv
uv venv
src .venv/bin/activate
uv sync --devInstall uv first:
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"palabra-ai-python/
├── src/
│ └── palabra_ai/ # Main package code
│ ├── __init__.py
│ ├── client.py
│ ├── config.py
│ └── ...
├── tests/ # Test files
├── examples/ # Usage examples
├── docs/ # Documentation
└── pyproject.toml # Project configuration
When reporting issues, please include:
- Python version (
python --version) - palabra-ai version (
pip show palabra-ai) - Operating system
- Minimal code example that reproduces the issue
- Full error traceback
Feel free to:
- Open an issue for bugs/features
- Start a discussion for questions
- Email us at api.support@palabra.ai
Thank you for contributing! 🎉