boarddata 6.4.1__tar.gz → 6.4.2__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-6.4.1 → boarddata-6.4.2}/PKG-INFO +1 -1
- {boarddata-6.4.1 → boarddata-6.4.2}/__init__.py +1 -1
- {boarddata-6.4.1 → boarddata-6.4.2}/_esg.py +66 -1
- {boarddata-6.4.1 → boarddata-6.4.2}/boarddata.egg-info/PKG-INFO +1 -1
- {boarddata-6.4.1 → boarddata-6.4.2}/pyproject.toml +1 -1
- {boarddata-6.4.1 → boarddata-6.4.2}/tests/test_esg.py +26 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/CLAUDE.md +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/README.md +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/_assemblies.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/_auditors.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/_base.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/_comex.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/_companies.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/_criteria.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/_directors.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/_documents.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/_indexes.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/_persons.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/_sentinel.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/_utilities.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/boarddata.egg-info/SOURCES.txt +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/boarddata.egg-info/dependency_links.txt +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/boarddata.egg-info/requires.txt +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/boarddata.egg-info/top_level.txt +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/cache.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/client.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/errors.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/py.typed +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/setup.cfg +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/tests/__init__.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/tests/conftest.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/tests/test_assemblies.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/tests/test_auditors.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/tests/test_base.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/tests/test_build_payload.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/tests/test_cache.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/tests/test_comex.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/tests/test_companies.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/tests/test_config.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/tests/test_criteria.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/tests/test_directors.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/tests/test_documents.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/tests/test_exports.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/tests/test_indexes.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/tests/test_persons.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/tests/test_sentinel.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/tests/test_utilities.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/types/__init__.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/types/assemblies.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/types/auditors.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/types/comex.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/types/companies.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/types/core.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/types/criteria.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/types/directors.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/types/documents.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/types/esg.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/types/indexes.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/types/persons.py +0 -0
- {boarddata-6.4.1 → boarddata-6.4.2}/types/sentinel.py +0 -0
|
@@ -4,7 +4,7 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
from typing import Any
|
|
6
6
|
|
|
7
|
-
from .types.core import FieldSourcePayload, PaginatedResponse
|
|
7
|
+
from .types.core import FieldSourcePayload, PaginatedResponse, UpsertResult
|
|
8
8
|
from .types.esg import (
|
|
9
9
|
ESGBenchmarkExportItem,
|
|
10
10
|
ESGBenchmarkStats,
|
|
@@ -397,3 +397,68 @@ class ESGMixin:
|
|
|
397
397
|
BoardDataError: On non-2xx API response.
|
|
398
398
|
"""
|
|
399
399
|
return self._get("companies/benchmark/stats/", **params) # type: ignore[attr-defined,return-value]
|
|
400
|
+
|
|
401
|
+
# ------------------------------------------------------------------
|
|
402
|
+
# EU Taxonomy
|
|
403
|
+
# ------------------------------------------------------------------
|
|
404
|
+
|
|
405
|
+
def upsert_taxonomy(
|
|
406
|
+
self,
|
|
407
|
+
*,
|
|
408
|
+
company: str,
|
|
409
|
+
report_year: int,
|
|
410
|
+
company_type: str,
|
|
411
|
+
metrics: dict[str, Any] | None = None,
|
|
412
|
+
sector_specific: dict[str, Any] | None = None,
|
|
413
|
+
by_objective: list[dict[str, Any]] | None = None,
|
|
414
|
+
field_sources: list[FieldSourcePayload] | None = None,
|
|
415
|
+
validation_status: str = "unknown",
|
|
416
|
+
validation_warnings: list[str] | None = None,
|
|
417
|
+
validation_errors: list[str] | None = None,
|
|
418
|
+
meta: dict[str, Any] | None = None,
|
|
419
|
+
annex_xii: dict[str, Any] | None = None,
|
|
420
|
+
) -> UpsertResult:
|
|
421
|
+
"""Upsert a company's EU-Taxonomy disclosure (server upserts by company+report_year).
|
|
422
|
+
|
|
423
|
+
The backend route is ``POST /api/taxonomy-reports/``. It upserts by
|
|
424
|
+
``(company, report_year)``: returns HTTP 200 on update and HTTP 201 on create.
|
|
425
|
+
Envelope field names map 1:1 to the v3.8 ``composed.json`` schema.
|
|
426
|
+
|
|
427
|
+
Args:
|
|
428
|
+
company: Company UUID.
|
|
429
|
+
report_year: Fiscal year the disclosure covers (e.g. ``2024``).
|
|
430
|
+
company_type: Reporting entity type. One of ``"INDUSTRIAL"``,
|
|
431
|
+
``"BANK"``, ``"INSURANCE"``, ``"ASSET_MANAGER"``.
|
|
432
|
+
metrics: Top-level KPI metrics dict (v3.8 schema).
|
|
433
|
+
sector_specific: Sector-specific metrics dict (v3.8 schema).
|
|
434
|
+
by_objective: Per-objective breakdown list (v3.8 schema).
|
|
435
|
+
field_sources: Field source entries for traceability.
|
|
436
|
+
validation_status: Pipeline validation outcome
|
|
437
|
+
(e.g. ``"valid"``, ``"warning"``, ``"error"``, ``"unknown"``).
|
|
438
|
+
validation_warnings: Non-blocking validation messages.
|
|
439
|
+
validation_errors: Blocking validation messages.
|
|
440
|
+
meta: Arbitrary pipeline metadata (extraction run ID, model, etc.).
|
|
441
|
+
annex_xii: Annex XII disclosure block (v3.8 addition).
|
|
442
|
+
|
|
443
|
+
Returns:
|
|
444
|
+
``UpsertResult`` with ``id`` (UUID), ``action`` (``"created"`` or
|
|
445
|
+
``"updated"``), and optional ``flag``.
|
|
446
|
+
|
|
447
|
+
Raises:
|
|
448
|
+
BoardDataError: On non-2xx API response.
|
|
449
|
+
"""
|
|
450
|
+
payload: dict[str, Any] = {
|
|
451
|
+
"company": company,
|
|
452
|
+
"report_year": report_year,
|
|
453
|
+
"company_type": company_type,
|
|
454
|
+
"metrics": metrics or {},
|
|
455
|
+
"sector_specific": sector_specific or {},
|
|
456
|
+
"by_objective": by_objective or [],
|
|
457
|
+
"field_sources": field_sources or [],
|
|
458
|
+
"validation_status": validation_status,
|
|
459
|
+
"validation_warnings": validation_warnings or [],
|
|
460
|
+
"validation_errors": validation_errors or [],
|
|
461
|
+
"meta": meta or {},
|
|
462
|
+
"annex_xii": annex_xii or {},
|
|
463
|
+
}
|
|
464
|
+
return self._post("taxonomy-reports/", payload) # type: ignore[attr-defined]
|
|
@@ -74,3 +74,29 @@ class TestGetEsgBenchmarkStats:
|
|
|
74
74
|
}
|
|
75
75
|
assert result["total_iros"] == 23
|
|
76
76
|
assert result["count"] == 42
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
class TestUpsertTaxonomy:
|
|
80
|
+
def test_upsert_taxonomy_posts_envelope(self):
|
|
81
|
+
c = make_client()
|
|
82
|
+
c._request.return_value = {
|
|
83
|
+
"id": "tax-uuid-1234",
|
|
84
|
+
"action": "created",
|
|
85
|
+
}
|
|
86
|
+
c.upsert_taxonomy(
|
|
87
|
+
company="comp-uuid-abcd",
|
|
88
|
+
report_year=2025,
|
|
89
|
+
company_type="BANK",
|
|
90
|
+
annex_xii={"is_disclosed": True},
|
|
91
|
+
)
|
|
92
|
+
args, kwargs = c._request.call_args
|
|
93
|
+
assert args == ("POST", "taxonomy-reports/")
|
|
94
|
+
payload = kwargs["json"]
|
|
95
|
+
assert payload["company"] == "comp-uuid-abcd"
|
|
96
|
+
assert payload["report_year"] == 2025
|
|
97
|
+
assert payload["company_type"] == "BANK"
|
|
98
|
+
assert payload["annex_xii"] == {"is_disclosed": True}
|
|
99
|
+
# defaults are populated
|
|
100
|
+
assert payload["metrics"] == {}
|
|
101
|
+
assert payload["by_objective"] == []
|
|
102
|
+
assert payload["validation_status"] == "unknown"
|
|
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
|
|
File without changes
|
|
File without changes
|