Thank you for your interest in contributing to the Etsy Python SDK! This document provides guidelines and instructions for contributing to the project.
By participating in this project, you agree to abide by our code of conduct: be respectful, inclusive, and constructive in all interactions.
- Check if the issue already exists in GitHub Issues
- Provide a clear description of the issue
- Include steps to reproduce the problem
- Share relevant code snippets or error messages
- Specify your Python version and OS
- Open an issue with the
enhancementlabel - Clearly describe the feature and its use case
- Provide examples of how it would work
-
Fork the Repository
git clone https://github.com/yourusername/etsy-python-sdk.git cd etsy-python-sdk -
Create a Feature Branch
git checkout -b feature/your-feature-name
-
Set Up Development Environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -e . pip install -r etsy_python/requirements.txt
-
Make Your Changes
- Follow the existing code style
- Add type hints to all functions
- Update documentation as needed
- Ensure version consistency
-
Test Your Changes
# Check version consistency python scripts/check_version_consistency.py # Test imports python -c "from etsy_python._version import __version__; print(__version__)"
-
Commit Your Changes
Use semantic commit messages for automatic versioning:
fix:- Bug fixes (triggers patch version bump)feat:- New features (triggers minor version bump)breaking:orBREAKING CHANGE:- Breaking changes (triggers major version bump)docs:- Documentation updateschore:- Maintenance taskstest:- Test additions or fixes
Examples:
git commit -m "fix: correct OAuth token refresh timing" git commit -m "feat: add support for new Etsy API endpoints" git commit -m "breaking: remove deprecated v2 API support"
Skipping CI/CD: To make changes without triggering automatic versioning and deployment, add
[skip ci]to your commit message:git commit -m "docs: update README [skip ci]" git commit -m "chore: fix typo in comments [skip ci]"
-
Push and Create Pull Request
git push origin feature/your-feature-name
Then create a PR on GitHub.
- PEP 8 compliance - Follow Python style guidelines
- Type hints - Use type annotations for all functions
- Docstrings - Document all public methods and classes
- Naming conventions:
- Classes:
PascalCase - Functions/methods:
snake_case - Constants:
UPPER_SNAKE_CASE - Enums:
PascalCaseclass,UPPER_SNAKE_CASEvalues
- Classes:
When adding new features:
- Models (
etsy_python/v3/models/) - Request/response data structures - Resources (
etsy_python/v3/resources/) - API endpoint implementations - Enums (
etsy_python/v3/enums/) - Type-safe constants - Exceptions (
etsy_python/v3/exceptions/) - Custom error classes
-
Create or update the request model:
# etsy_python/v3/models/YourFeature.py class YourFeatureRequest(Request): nullable = ["optional_field"] mandatory = ["required_field"] def __init__(self, required_field, optional_field=None): self.required_field = required_field self.optional_field = optional_field super().__init__(nullable=self.nullable, mandatory=self.mandatory)
-
Add enum if needed:
# etsy_python/v3/enums/YourFeature.py class YourFeatureType(Enum): TYPE_A = "type_a" TYPE_B = "type_b"
-
Implement the resource method:
# etsy_python/v3/resources/YourFeature.py @dataclass class YourFeatureResource: session: EtsyClient def your_method(self, param: int, request: YourFeatureRequest): endpoint = f"/endpoint/{param}" return self.session.make_request(endpoint, method=Method.POST, payload=request)
While there's no formal test framework, ensure:
- Your code imports successfully
- Version consistency is maintained
- Example usage works as expected
- Update README.md with usage examples for new features
- Add docstrings to all new methods
- Update CHANGELOG.md if you create one
Releases are automated when changes are merged to master:
- Automatic Version Bump - Based on commit messages
- Package Build - Creates distribution files
- PyPI Publish - Uploads to Python Package Index
- GitHub Release - Creates release with changelog
For maintainers testing releases locally:
# Test version bump without pushing
python scripts/bump_version.py --dry-run --type patch
# Create local release without pushing
python scripts/release.py patch --no-push --no-buildIf you have questions, please:
- Check the documentation
- Search existing issues
- Open a new issue with your question
Thank you for contributing to the Etsy Python SDK!