Spaces:
Configuration error
Configuration error
Download clients/python/financialfilings.py from AnthropicallyHuggingFaces/ai-platform-toolbox: direct link, hf CLI and curl.
- Browser
- Download file 1.18 kB
-
https://huggingface.co/spaces/AnthropicallyHuggingFaces/ai-platform-toolbox/resolve/main/clients/python/financialfilings.py
- Command line
-
hf download hf://spaces/AnthropicallyHuggingFaces/ai-platform-toolbox/clients/python/financialfilings.py
-
curl -L -o financialfilings.py https://huggingface.co/spaces/AnthropicallyHuggingFaces/ai-platform-toolbox/resolve/main/clients/python/financialfilings.py
1.18 kB
| """FinancialFilings client - api.financialreports.eu (OpenAPI 3.1).""" | |
| import os | |
| import requests | |
| BASE = os.getenv("FINANCIALFILINGS_API_BASE", "https://api.financialreports.eu") | |
| KEY = os.getenv("FINANCIALFILINGS_API_KEY") | |
| def _h(): | |
| headers = {"Accept": "application/json"} | |
| if KEY: | |
| headers["Authorization"] = f"Bearer {KEY}" | |
| return headers | |
| def list_filings(**params): | |
| return requests.get(f"{BASE}/filings/", headers=_h(), params=params, timeout=60).json() | |
| def get_filing(filing_id: str): | |
| return requests.get(f"{BASE}/filings/{filing_id}/", headers=_h(), timeout=60).json() | |
| def get_filing_markdown(filing_id: str): | |
| return requests.get(f"{BASE}/filings/{filing_id}/markdown/", headers=_h(), timeout=60).json() | |
| def list_companies(**params): | |
| return requests.get(f"{BASE}/companies/", headers=_h(), params=params, timeout=60).json() | |
| def get_company(company_id: str): | |
| return requests.get(f"{BASE}/companies/{company_id}/", headers=_h(), timeout=60).json() | |
| def get_company_financials(company_id: str, **params): | |
| return requests.get(f"{BASE}/companies/{company_id}/financials/", headers=_h(), params=params, timeout=60).json() | |