Skip to main content

edgar-sec

A feature-rich python package for interacting with the US Securities and Exchange Commission API: EDGAR

Edgar-SEC Logo
Build and test GitHub Analyze Status Test Status CodeQL codecov Packaging status PyPI version PyPI Downloads Conda-Forge Version Conda Downloads

Features

  • Now available on Conda-Forge!
  • Native support for asynchronous requests (async).
  • All method outputs are mapped to dataclasses for better usability.
  • Local caching for easier data access and faster execution times.
  • Built-in rate limiter that doesn't exceed 10 calls per second (ignores local caching).
  • MyPy compatible type stubs.

Installation

You can install the package using pip:

pip install edgar-sec

Or install from conda-forge:

conda install -c conda-forge edgar-sec

For type checking support, install with optional type stubs:

pip install edgar-sec[types]

We recommend using a virtual environment with either installation method.

Rest API Usage

I recommend consulting the documentation at: https://nikhilxsunder.github.io/edgar-sec/

Here is a simple example of how to use the package:

# EDGAR API
import edgar_sec as ed
edgar = ed.EdgarAPI()

# Get company concept disclosures
company_concept = edgar.get_company_concept(central_index_key='0001067983', taxonomy='us-gaap', tag='AccountsPayableCurrent')
print(company_concept.label)

# Get company concept disclosures (async)
import asyncio
async def main():
    edgar = ed.EdgarAPI().Async
    company_concept = await edgar.get_company_concept(central_index_key='0001067983', taxonomy='us-gaap', tag='AccountsPayableCurrent')
    print(company_concept.label)
asyncio.run(main())

Continuous Integration

Edgar-SEC uses GitHub Actions for continuous integration. The following workflows run automatically:

  • Build and Test: Triggered on every push and pull request to verify the codebase builds and tests pass
  • Analyze: Runs static code analysis to identify potential issues
  • Test: Comprehensive test suite with coverage reporting
  • CodeQL: Security analysis to detect vulnerabilities
  • Docs: Deploys Sphinx docs site to Github Pages.

These checks ensure that all contributions maintain code quality and don't introduce regressions.

Status badges at the top of this README reflect the current state of our CI pipelines.

Development

Edgar-SEC uses standard Python packaging tools:

  • Poetry: For dependency management and package building
  • pytest: For testing
  • Sphinx: For documentation generation

To set up the development environment:

# Install Poetry
curl -sSL https://install.python-poetry.org | python3 -

# Clone the repository
git clone https://github.com/nikhilxsunder/edgar-sec.git
cd edgar-sec

# Install dependencies
poetry install

# Run tests
poetry run pytest

Testing

The project uses pytest as its testing framework. Tests are located in the tests/ directory.

To run the complete test suite:

poetry run pytest

For running tests with coverage reports:

poetry run pytest --cov=edgar_sec tests/

To run a specific test file:

poetry run pytest tests/specific_module_test.py

Test Coverage

We aim to maintain a minimum of 80% code coverage across the codebase. This includes:

  • Core functionality: 90%+ coverage
  • Edge cases and error handling: 80%+ coverage
  • Utility functions: 75%+ coverage

Continuous integration automatically runs tests on all pull requests and commits to the main branch.

Test Policy

Edgar-SEC requires tests for all new functionality. When contributing:

  • All new features must include appropriate tests
  • Bug fixes should include tests that verify the fix
  • Tests should be added to the automated test suite in the tests/ directory

Security

For information about reporting security vulnerabilities in Edgar-SEC, please see our Security Policy.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the GNU Affero General Public License v3.0 - see the LICENSE file for details.

Metadata

Release files for edgar-sec 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for edgar-sec 2.0.1
File Size Uploaded Provenance
edgar_sec-2.0.1.tar.gz 28.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for edgar-sec 2.0.1
File Interpreter ABI Platform
edgar_sec-2.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 58.9 kB

Release files / edgar_sec-2.0.1.tar.gz

Download URL edgar_sec-2.0.1.tar.gz
Size 28.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ed327d89d5b1fcca3b3ca44648ac137a23770b591cd5716a74813544c57f53f9
BLAKE2b-256 checksum
How to use checksums
ae53a4d756b402eacb8ff225fab6ddc342fe2fdf0d02d9066a72d2418ac0f187
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.1 CPython/3.9.23 Linux/6.11.0-1018-azure

Release files / edgar_sec-2.0.1-py3-none-any.whl

Download URL edgar_sec-2.0.1-py3-none-any.whl
Size 30.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
184e42e00cb0d016c4d863e4300b4dab73909285aeadc83fcef719bbad8b0fc9
BLAKE2b-256 checksum
How to use checksums
d40cd8c5534aa616de40306c93fa112786a56add080093705ef65dab19652411
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.1 CPython/3.9.23 Linux/6.11.0-1018-azure

Security for edgar-sec 2.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page