Thank you for your interest in contributing to the Office365-REST-Python-Client library. This project provides a comprehensive Python client for Microsoft 365 and Microsoft Graph APIs.
- Getting Started
- Development Environment Setup
- Code Style and Quality Standards
- Testing Guidelines
- Submitting Changes
- Issue Reporting
- Documentation
- Community Guidelines
- Python 3.6+
- Git
- A Microsoft 365 tenant for testing (recommended)
- Basic understanding of REST APIs and Microsoft Graph/SharePoint APIs
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/your-username/Office365-REST-Python-Client.git
cd Office365-REST-Python-ClientActivate the Virtual Environment and install dependencies:
uv sync --all-extrasuv tool install prek
prek run --all-filesThe project uses the following tools (mirroring CI):
- Black (formatting)
- Ruff (linting and import sorting)
- Pylint (static analysis)
Line length: 121 characters (configured in pyproject.toml).
Run locally before pushing:
prekMost tests are end-to-end and require actual Microsoft 365 credentials.
-
Create a
.envfile in the project root:export office365_python_sdk_securevars='{username};{password};{client_id};{client_secret}'
-
Source the environment file:
. .env
Note: The order of values is significant because tests parse by index.
For comprehensive testing, your test tenant should have these admin roles:
- Global reader
- Groups admin
- Search admin
- SharePoint admin
- Teams service admin
pytest
# or
pytest -v
# or a specific suite
pytest tests/sharepoint/CI note: Full E2E tests in CI rely on repository secrets and may not run on forks. Please run tests locally; maintainers trigger full CI runs as needed.
- Forked pull requests do not receive repository secrets. The CI pipeline will run formatting and linting, and it will skip
pytestautomatically if secrets are unavailable. - To validate your changes, run tests locally using your own tenant credentials as described above.
- Maintainers will run the full E2E test suite on branches with access to secrets before merging.
-
Create a feature branch from
master:git checkout -b feature/your-feature-name
-
Make your changes with clear, focused commits
-
Ensure all tests pass and quality checks are satisfied
- CI Checks must pass:
- Ruff linting
- Black formatting
- Pylint analysis
- Pytest execution
- Await maintainer review
- Update documentation where applicable
- Use clear, descriptive commit messages
- Reference issue numbers when applicable
- Keep commits focused and atomic
Before filing an issue:
- Search existing issues
- Check documentation and examples
- Test with the latest version
Include in your report:
- Environment: Python version, OS, library version
- Reproduction: minimal code example
- Expected vs Actual behavior
- Authentication method used
- Targeted service area (SharePoint, Graph, etc.)
The library supports multiple Microsoft 365 APIs, including SharePoint REST, Microsoft Graph, OneDrive, Outlook, Teams, OneNote, and Planner. See examples/ for usage.
This project is maintained by the community. Be respectful and constructive in all interactions.
MIT License. By contributing, you agree that your contributions are licensed under these terms.