boarddata 4.1.2__tar.gz → 4.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {boarddata-4.1.2 → boarddata-4.2.1}/PKG-INFO +1 -1
- {boarddata-4.1.2 → boarddata-4.2.1}/__init__.py +1 -1
- {boarddata-4.1.2 → boarddata-4.2.1}/_companies.py +44 -1
- {boarddata-4.1.2 → boarddata-4.2.1}/boarddata.egg-info/PKG-INFO +1 -1
- {boarddata-4.1.2 → boarddata-4.2.1}/pyproject.toml +1 -1
- {boarddata-4.1.2 → boarddata-4.2.1}/types/companies.py +9 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/types/core.py +8 -3
- {boarddata-4.1.2 → boarddata-4.2.1}/CLAUDE.md +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/README.md +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/_assemblies.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/_auditors.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/_base.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/_comex.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/_criteria.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/_directors.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/_documents.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/_esg.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/_indexes.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/_persons.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/_sentinel.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/_utilities.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/boarddata.egg-info/SOURCES.txt +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/boarddata.egg-info/dependency_links.txt +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/boarddata.egg-info/requires.txt +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/boarddata.egg-info/top_level.txt +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/cache.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/client.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/errors.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/py.typed +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/setup.cfg +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/tests/__init__.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/tests/conftest.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/tests/test_assemblies.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/tests/test_auditors.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/tests/test_base.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/tests/test_build_payload.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/tests/test_cache.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/tests/test_comex.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/tests/test_companies.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/tests/test_config.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/tests/test_criteria.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/tests/test_directors.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/tests/test_documents.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/tests/test_esg.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/tests/test_indexes.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/tests/test_persons.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/tests/test_sentinel.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/tests/test_utilities.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/types/__init__.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/types/assemblies.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/types/auditors.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/types/comex.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/types/criteria.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/types/directors.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/types/documents.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/types/esg.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/types/indexes.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/types/persons.py +0 -0
- {boarddata-4.1.2 → boarddata-4.2.1}/types/sentinel.py +0 -0
|
@@ -5,7 +5,12 @@ from __future__ import annotations
|
|
|
5
5
|
import logging
|
|
6
6
|
from typing import Any
|
|
7
7
|
|
|
8
|
-
from .types.companies import
|
|
8
|
+
from .types.companies import (
|
|
9
|
+
CompanyDetail,
|
|
10
|
+
CompanyListItem,
|
|
11
|
+
CompanyResolveResult,
|
|
12
|
+
TemporalAttributePayload,
|
|
13
|
+
)
|
|
9
14
|
from .types.core import AddressPayload, FieldSourcePayload, PaginatedResponse, UpsertResult
|
|
10
15
|
|
|
11
16
|
logger = logging.getLogger("boarddata")
|
|
@@ -253,6 +258,44 @@ class CompanyMixin:
|
|
|
253
258
|
results = resp.get("results", []) if isinstance(resp, dict) else resp
|
|
254
259
|
return results[0] if results else None
|
|
255
260
|
|
|
261
|
+
def resolve_company(
|
|
262
|
+
self,
|
|
263
|
+
*,
|
|
264
|
+
ticker: str | None = None,
|
|
265
|
+
isin: str | None = None,
|
|
266
|
+
) -> CompanyResolveResult | None:
|
|
267
|
+
"""Resolve a company by ticker and/or ISIN.
|
|
268
|
+
|
|
269
|
+
Cascading resolution: DB → OpenFIGI → Perplexity.
|
|
270
|
+
At least one of ticker or isin is required.
|
|
271
|
+
|
|
272
|
+
Args:
|
|
273
|
+
ticker: Stock ticker symbol (e.g. ``"TTE"``).
|
|
274
|
+
isin: ISIN identifier (e.g. ``"FR0000120271"``).
|
|
275
|
+
|
|
276
|
+
Returns:
|
|
277
|
+
CompanyResolveResult if found, or ``None`` if not found.
|
|
278
|
+
|
|
279
|
+
Raises:
|
|
280
|
+
BoardDataError: On non-2xx API response (except 404).
|
|
281
|
+
ValueError: If neither ticker nor isin is provided.
|
|
282
|
+
"""
|
|
283
|
+
if not ticker and not isin:
|
|
284
|
+
raise ValueError("Provide at least one of: ticker, isin")
|
|
285
|
+
|
|
286
|
+
from .errors import BoardDataError
|
|
287
|
+
|
|
288
|
+
try:
|
|
289
|
+
return self._get( # type: ignore[attr-defined]
|
|
290
|
+
"companies/resolve/",
|
|
291
|
+
ticker=ticker,
|
|
292
|
+
isin=isin,
|
|
293
|
+
)
|
|
294
|
+
except BoardDataError as exc:
|
|
295
|
+
if exc.status_code == 404:
|
|
296
|
+
return None
|
|
297
|
+
raise
|
|
298
|
+
|
|
256
299
|
def upsert_company(
|
|
257
300
|
self,
|
|
258
301
|
isin: str,
|
|
@@ -68,6 +68,15 @@ class UpdateCompanyPayload(TypedDict, total=False):
|
|
|
68
68
|
field_sources: list[FieldSourcePayload]
|
|
69
69
|
|
|
70
70
|
|
|
71
|
+
class CompanyResolveResult(TypedDict):
|
|
72
|
+
id: str
|
|
73
|
+
name: str
|
|
74
|
+
isin: str
|
|
75
|
+
ticker: str
|
|
76
|
+
country: str
|
|
77
|
+
logo: str
|
|
78
|
+
|
|
79
|
+
|
|
71
80
|
class CompanyListItem(TypedDict):
|
|
72
81
|
id: str
|
|
73
82
|
name: str
|
|
@@ -10,6 +10,7 @@ except ImportError:
|
|
|
10
10
|
|
|
11
11
|
# -- Shared input types --
|
|
12
12
|
|
|
13
|
+
|
|
13
14
|
class AddressPayload(TypedDict, total=False):
|
|
14
15
|
country: str
|
|
15
16
|
country_code: str
|
|
@@ -29,9 +30,11 @@ class FieldSourcePayload(TypedDict):
|
|
|
29
30
|
|
|
30
31
|
# -- Shared response types --
|
|
31
32
|
|
|
33
|
+
|
|
32
34
|
class PaginatedResponse(TypedDict):
|
|
33
35
|
"""Non-generic paginated response. results is list[Any] at the type level.
|
|
34
36
|
Generic TypedDict requires Python 3.13; we target 3.12+."""
|
|
37
|
+
|
|
35
38
|
count: int
|
|
36
39
|
next: str | None
|
|
37
40
|
previous: str | None
|
|
@@ -54,7 +57,8 @@ class FieldSourceItem(TypedDict):
|
|
|
54
57
|
document_id: str | None
|
|
55
58
|
document_title: str
|
|
56
59
|
document_type: str
|
|
57
|
-
|
|
60
|
+
document_fiscal_year: int | None
|
|
61
|
+
document_publication_date: str | None
|
|
58
62
|
page_number: int | None
|
|
59
63
|
confidence: str
|
|
60
64
|
extracted_value: str
|
|
@@ -80,6 +84,7 @@ class SearchResult(TypedDict):
|
|
|
80
84
|
|
|
81
85
|
class UpsertResult(TypedDict):
|
|
82
86
|
"""Standardised return type for all upsert methods."""
|
|
83
|
-
|
|
84
|
-
|
|
87
|
+
|
|
88
|
+
action: str # "created" or "updated"
|
|
89
|
+
id: str # UUID of the created/updated entity
|
|
85
90
|
data: dict[str, Any] # Full entity detail dict
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|