Skip to main content

Official Python SDK for Financial Reports API

Project description

Financial Reports Python SDK

Official Python SDK for the Financial Reports API. Access European financial filings and company data programmatically.

Installation

pip install financial-reports

Quick Start

import asyncio
from financial_reports import FinancialReportsClient

async def main():
    # Initialize client with API key
    client = FinancialReportsClient(api_key="your-api-key")
    
    try:
        # Get filings for a specific company
        filings = await client.list_filings(company_isin="FR0000073298")
        print(f"Found {filings['count']} filings")
        
        # Get German companies
        companies = await client.list_companies(countries="de")
        print(f"Found {companies['count']} German companies")
        
        # Use utility functions
        sap_isin = await client.get_primary_isin_by_name("SAP")
        print(f"SAP ISIN: {sap_isin}")
        
    finally:
        await client.close()

# Run the async function
asyncio.run(main())

Features

  • Full async/await support using aiohttp
  • Complete coverage of API endpoints:
    • Filings (list, get)
    • Companies (list, get)
    • Filing Types (list, get)
    • Sources (list, get)
    • Sectors (list, get)
    • Industry Groups (list, get)
    • Industries (list, get)
    • Sub-Industries (list, get)
  • Utility functions for company lookup
  • Built-in pagination handling
  • Proper error handling
  • Type hints for better IDE integration

Authentication

The client requires an API key that can be provided in two ways:

  1. Environment variable:
export FINANCIAL_REPORTS_API_KEY="your-api-key"
  1. Direct initialization:
client = FinancialReportsClient(api_key="your-api-key")

API Reference

Filings

# List filings with filters
filings = await client.list_filings(
    company_isin="FR0000073298",
    countries="de",
    language="en",
    added_to_platform_from="2024-01-01",
    page=1,
    page_size=50
)

# Get specific filing
filing = await client.get_filing(filing_id=123)

Companies

# List companies with filters
companies = await client.list_companies(
    countries="de",
    sector=45,  # Technology
    page=1,
    page_size=50
)

# Get specific company
company = await client.get_company(company_id=456)

# Utility functions
isin = await client.get_primary_isin_by_name("SAP")
ticker = await client.get_ticker_by_name("SAP")

Industries & Sectors

# List all sectors
sectors = await client.list_sectors()

# Get industry groups in a sector
groups = await client.list_industry_groups()

# Get specific industry
industry = await client.get_industry(industry_id=789)

Error Handling

The client includes built-in error handling for common scenarios:

try:
    filings = await client.list_filings()
except ValueError as e:
    if "Invalid API key" in str(e):
        print("Authentication failed")
    elif "Insufficient permissions" in str(e):
        print("API key doesn't have required permissions")
    else:
        print(f"API error: {e}")

Development

  1. Clone the repository:
git clone https://github.com/financial-reports/financial-reports-python.git
cd financial-reports-python
  1. Create virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install in development mode:
pip install -e .

License

MIT License. See LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

financial_reports-0.1.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

financial_reports-0.1.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file financial_reports-0.1.0.tar.gz.

File metadata

  • Download URL: financial_reports-0.1.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.11

File hashes

Hashes for financial_reports-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2ef1cbd4fe6974beef48469e7e87b736f1bc56aeb60dd57da58eb9271890c2a1
MD5 18e00ef8ef3a98cbe58520c3d7c42f74
BLAKE2b-256 5a3591593cb10583908024909bdc82e2b5a3ab0fd48f28555f765df741d106c1

See more details on using hashes here.

File details

Details for the file financial_reports-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for financial_reports-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0ea08716fe0ae8e5e558658ebc71a5d8ebd8aeabeb3a266f6cc366fd08faca9f
MD5 ef6f94b8038b4f078275ca8d65ba8633
BLAKE2b-256 73d02e83fb51194485260caec5a41d40975ead5b8bded5e4fd608a5dae476316

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page