Contributing to Edgartools
July 27, 2026 ยท View on GitHub
A big welcome and thank you for considering contributing to Edgartools! We appreciate your interest in helping make this library better. ๐
There are many ways to contribute, from reporting bugs and suggesting features to writing code, improving documentation, and sharing your expertise.
Ways to Contribute
- Report Bugs: If you encounter a bug, please check if it has already been reported in the GitHub Issues. If not, please open a new issue. Include a clear title, a detailed description of the bug, steps to reproduce it, expected behavior, actual behavior, and your environment details (OS, Python version, Edgartools version).
- Suggest Enhancements: Have an idea for a new feature or an improvement to an existing one? Open an issue using the "Feature request" template. Describe your idea clearly, why it would be beneficial, and any potential implementation details you've considered.
- Improve Documentation: See a typo, something unclear, or an area that needs more explanation in the documentation or docstrings? Submit a pull request with your improvements!
- Write Code: If you want to fix a bug or implement a new feature:
- Find an issue you want to work on (or open one).
- Discuss your plan in the issue comments if it's a significant change.
- Follow the development setup and contribution workflow below.
- Share Expertise: If you have experience with SEC filings, XBRL, financial data analysis, or related areas, your insights are valuable! Participate in discussions on issues or share your knowledge.
Development Setup
This project uses Hatch for environment and project management.
- Fork & Clone: Fork the repository on GitHub and clone your fork locally:
git clone https://github.com/<YOUR_USERNAME>/edgartools.git cd edgartools - Install Hatch: If you don't have Hatch installed, follow the official installation guide.
- Activate Environment: Set up the development environment and install dependencies (including development tools like
ruff,pytest,mkdocs):
This command activates a virtual environment managed by Hatch with all necessary dependencies installed.hatch shell
Contribution Workflow
- Create a Branch: Create a new branch for your changes, based on the
mainbranch:
Use a descriptive branch name (e.g.,git checkout main git pull origin main # Ensure you have the latest changes git checkout -b your-feature-or-fix-branch-namefix-filing-parsing-error,add-insider-transaction-api). - Make Changes: Write your code or documentation improvements.
- Format & Lint: Ensure your code adheres to the project's style guidelines by running the formatter and linter:
Fix any reported issues.# Format code hatch run ruff format . # Check for linting errors hatch run lint - Test: Run the test suite to ensure your changes haven't introduced regressions:
Make sure all tests pass and coverage doesn't significantly decrease. Consider adding new tests for your changes if applicable.hatch run cov - Commit: Commit your changes with a clear and descriptive commit message. Follow conventional commit message formats if possible (e.g.,
fix: Resolve issue with date parsing in Form 4,feat: Add support for 8-K item retrieval).git add . git commit -m "feat: Describe your change here" - Push: Push your branch to your fork:
git push origin your-feature-or-fix-branch-name - Open Pull Request: Go to the original
edgartoolsrepository on GitHub and open a pull request from your branch to themainbranch.- Provide a clear title and description for your PR.
- Reference any relevant issues (e.g., "Closes #123").
- Explain the changes you made and why.
- Review: A maintainer will review your PR. Be prepared to discuss your changes and make further adjustments based on feedback.
Test Cassettes (VCR)
Network-dependent tests replay recorded SEC responses from tests/cassettes/
rather than hitting the network on every run. A cassette is the test's ground
truth: when a test asserts that a section is 91,682 characters, the authority
for that number is the recorded response body, not SEC. Cassettes are therefore
held to the same standard as the assertions they support.
Record from live SEC, and don't edit afterwards. Delete the cassette and
re-run the test to record it (record_mode is once, so an existing file is
never overwritten). Never hand-edit a recorded response โ not to shrink a large
cassette, not to remove a field that makes a test flaky, and not to adjust a
value so an assertion passes. An edited cassette produces a test that looks like
it verifies against a real filing while verifying against something SEC never
sent.
Record against main, not against your fix. If you record while your change
is applied, the cassette captures your patched behaviour and the test can no
longer fail if the fix regresses. Record first, then develop against the
recording.
Keep cassettes small by scoping the test, not by trimming the file. If a cassette is unreasonably large, narrow what the test fetches โ a smaller filing, a single request โ and re-record.
CI will not generate cassettes for you. They are committed artifacts, and they are reviewed as part of the PR. Say in the PR description which filings you recorded and when, so a reviewer can spot-check a value against SEC directly.
Cassettes are loaded as plain data โ recorded requests, headers and response
bodies only. hatch run check-cassettes verifies this and runs in CI ahead of
the test jobs; run it locally if you are about to run a branch you did not write.
Documentation Structure
EdgarTools uses a three-tier documentation system:
External Documentation (docs/)
- Purpose: User-facing documentation published to edgartools.readthedocs.com
- Content: API reference, user guides, tutorials, installation, configuration
- Standards: Must be maintained, versioned, and follow consistent style
- Audience: End users and developers using EdgarTools
Internal Documentation (docs-internal/)
- Purpose: Internal planning, research, and development documentation
- Content: Architecture decisions, feature proposals, research analysis, runbooks
- Standards: Can include sensitive details, work-in-progress, more informal
- Audience: EdgarTools maintainers and contributors
AI Documentation (ai_docs/)
- Purpose: Documentation for AI agents working with the codebase
- Content: Agent instructions, API context, code patterns, generated docs
- Standards: CLAUDE.md is source of truth, context should be accurate and concise
- Audience: AI assistants and automated tools
Local Documentation Management
To avoid conflicts over temporary documentation, use local exclusions instead of global .gitignore:
# Setup local exclusions (run once per developer)
cat >> .git/info/exclude << 'EOF'
# AI-generated documentation
ai_docs/generated/
# Module-specific ephemeral docs
edgar/**/.docs/
# Personal temporary docs
**/TEMP_*.md
**/WIP_*.md
**/LOCAL_*.md
EOF
Building Documentation Locally
To preview the external documentation site locally:
hatch run mkdocs serve
Then open your browser to http://127.0.0.1:8000.
Thank you again for your contribution!