Skip to content

Commit a37fdb6

Browse files
committed
feat: the workbook download and the entity request changes
Regenerated against the robosystems API after v1.24.4: WORKBOOK on the report download format; entity_type as a fixed list, uri and fiscal_year_end off the entity requests, and pattern checks on lei, cik and address_country.
1 parent 4ff7025 commit a37fdb6

16 files changed

Lines changed: 236 additions & 157 deletions

‎robosystems_client/clients/graph_client.py‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,14 @@ class GraphMetadata:
4848

4949
@dataclass
5050
class InitialEntityData:
51-
"""Initial entity data for graph creation"""
51+
"""Initial entity data for graph creation.
52+
53+
``uri`` is the entity's website and is optional: the entity's own URI is
54+
assigned by RoboSystems.
55+
"""
5256

5357
name: str
54-
uri: str
58+
uri: Optional[str] = None
5559
category: Optional[str] = None
5660
sic: Optional[str] = None
5761
sic_description: Optional[str] = None
@@ -186,10 +190,9 @@ def create_graph_and_wait(
186190

187191
initial_entity_dict = None
188192
if initial_entity:
189-
initial_entity_dict = {
190-
"name": initial_entity.name,
191-
"uri": initial_entity.uri,
192-
}
193+
initial_entity_dict = {"name": initial_entity.name}
194+
if initial_entity.uri:
195+
initial_entity_dict["uri"] = initial_entity.uri
193196
if initial_entity.category:
194197
initial_entity_dict["category"] = initial_entity.category
195198
if initial_entity.sic:

‎robosystems_client/clients/ledger_client.py‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,7 @@
797797
"holon-jsonld": "HOLON_JSONLD",
798798
"holon-jsonld-lineage": "HOLON_JSONLD_LINEAGE",
799799
"databook": "DATABOOK",
800+
"workbook": "WORKBOOK",
800801
"xbrl-2.1": "XBRL_2_1",
801802
"tavi": "TAVI",
802803
}
@@ -3835,8 +3836,8 @@ def download_report_bundle(
38353836
GraphQL ``reportDownloadUrl`` field (the REST download route was
38363837
retired). Every flavor resolves to a short-lived presigned S3 URL —
38373838
the holon is stamped at publish time; the Tavi model, the XBRL, the
3838-
DataBook and the holon with lineage are materialized + cached on first
3839-
request. The client follows the URL and pulls the bytes.
3839+
DataBook, the workbook and the holon with lineage are materialized +
3840+
cached on first request. The client follows the URL and pulls the bytes.
38403841
38413842
Args:
38423843
graph_id: Graph identifier owning the Report.
@@ -3850,9 +3851,12 @@ def download_report_bundle(
38503851
for this graph's own members), or ``"databook"`` (the holon as
38513852
a Markdown document a person reads: each value links to its fact
38523853
in the holon, which it names as its source; to the holon what
3853-
inline XBRL is to XBRL). The enum names ``"TAVI"`` /
3854-
``"HOLON_JSONLD"`` / ``"HOLON_JSONLD_LINEAGE"`` / ``"DATABOOK"`` /
3855-
``"XBRL_2_1"`` are also accepted.
3854+
inline XBRL is to XBRL), or ``"workbook"`` (the holon as an
3855+
Excel file: a sheet per section, each line's breakdowns beneath
3856+
it, every number the reported fact and no formulas). The enum
3857+
names ``"TAVI"`` / ``"HOLON_JSONLD"`` / ``"HOLON_JSONLD_LINEAGE"``
3858+
/ ``"DATABOOK"`` / ``"WORKBOOK"`` / ``"XBRL_2_1"`` are also
3859+
accepted.
38563860
to: Optional file path to write the bytes to. When set, the
38573861
returned ``ReportBundleDownload.path`` points at the
38583862
written file.
@@ -3901,6 +3905,7 @@ def download_report_bundle(
39013905
"HOLON_JSONLD": "holon.jsonld",
39023906
"HOLON_JSONLD_LINEAGE": "lineage.holon.jsonld",
39033907
"DATABOOK": "databook.md",
3908+
"WORKBOOK": "xlsx",
39043909
}.get(gql_format, "tavi.json")
39053910
filename = (
39063911
_parse_filename(artifact.headers.get("content-disposition", ""))

‎robosystems_client/graphql/generated/enums.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ class ReportDownloadFormat(str, Enum):
1111
HOLON_JSONLD = "HOLON_JSONLD"
1212
HOLON_JSONLD_LINEAGE = "HOLON_JSONLD_LINEAGE"
1313
DATABOOK = "DATABOOK"
14+
WORKBOOK = "WORKBOOK"
1415
XBRL_2_1 = "XBRL_2_1"
1516
TAVI = "TAVI"

‎robosystems_client/graphql/schema.graphql‎

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -780,13 +780,14 @@ type Query {
780780
The only way to download a report's bundle. Every format resolves to a
781781
short-lived presigned S3 URL which the client follows directly — the
782782
field returns the URL, never the bytes. The holon is stamped at
783-
publish time; the Tavi, the XBRL, the DataBook and the holon with lineage
784-
are materialized and cached on first request. `DATABOOK` is the report as
785-
Markdown a person reads, written from the holon and pointing back at it. `HOLON_JSONLD_LINEAGE` carries
786-
the books behind the report's frozen figures, so it is for this graph's
787-
members only: a report shared in from another graph raises
788-
`REPORT_BUNDLE_NOT_AVAILABLE` for it. `expiresIn`
789-
is the URL's lifetime in seconds, bounded 60-3600.
783+
publish time; the Tavi, the XBRL, the DataBook, the workbook and the holon
784+
with lineage are materialized and cached on first request. `DATABOOK` is
785+
the report as Markdown a person reads, written from the holon and pointing
786+
back at it. `WORKBOOK` is the report as an Excel file, a sheet per section.
787+
`HOLON_JSONLD_LINEAGE` carries the books behind the report's frozen
788+
figures, so it is for this graph's members only: a report shared in from
789+
another graph raises `REPORT_BUNDLE_NOT_AVAILABLE` for it. `expiresIn` is
790+
the URL's lifetime in seconds, bounded 60-3600.
790791
791792
Returns null when the report doesn't exist; raises
792793
`REPORT_BUNDLE_NOT_AVAILABLE` when it exists but has no published
@@ -1770,7 +1771,9 @@ type LedgerEntity {
17701771
"""Full registered legal name (when different from `name`)."""
17711772
legalName: String
17721773

1773-
"""Canonical URL / external identifier."""
1774+
"""
1775+
The entity's URI, assigned by RoboSystems: `https://robosystems.ai/entities#<id>`.
1776+
"""
17741777
uri: String
17751778

17761779
"""SEC CIK (Central Index Key)."""
@@ -1794,7 +1797,9 @@ type LedgerEntity {
17941797
"""US state or country of incorporation."""
17951798
stateOfIncorporation: String
17961799

1797-
"""Fiscal year-end as MM-DD (e.g. '12-31', '06-30')."""
1800+
"""
1801+
Fiscal year-end as MM-DD, from the entity's fiscal calendar; null before the calendar is set up. Change it through the calendar.
1802+
"""
17981803
fiscalYearEnd: String
17991804

18001805
"""Tax ID (EIN / SSN)."""
@@ -1808,7 +1813,9 @@ type LedgerEntity {
18081813
"""
18091814
industry: String
18101815

1811-
"""Legal form (e.g. 'corporation', 'llc', 'lp')."""
1816+
"""
1817+
Legal form: `corporation`, `llc`, `partnership`, `sole_proprietorship` or `non_profit`. An entity set before the list may hold other text.
1818+
"""
18121819
entityType: String
18131820

18141821
"""
@@ -4582,7 +4589,7 @@ Presigned-URL response for a published Report's serialization bundle.
45824589
45834590
Every flavor resolves to a short-lived presigned URL pointing at the
45844591
bundle in S3 — the holon is stamped at publish time; the Tavi, the
4585-
XBRL 2.1 and the DataBook are materialized on first download and cached by
4592+
XBRL 2.1, the DataBook and the workbook are materialized on first download and cached by
45864593
`generationCount`.
45874594
The client follows `downloadUrl` to fetch the artifact directly
45884595
from S3 (the API never streams the bytes). Mirrors the
@@ -4616,6 +4623,7 @@ enum ReportDownloadFormat {
46164623
HOLON_JSONLD
46174624
HOLON_JSONLD_LINEAGE
46184625
DATABOOK
4626+
WORKBOOK
46194627
XBRL_2_1
46204628
TAVI
46214629
}

‎robosystems_client/models/__init__.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
CreateEntityRequestConsolidationMethodType0,
116116
)
117117
from .create_entity_request_entity_role_type_0 import CreateEntityRequestEntityRoleType0
118+
from .create_entity_request_entity_type_type_0 import CreateEntityRequestEntityTypeType0
118119
from .create_event_block_request import CreateEventBlockRequest
119120
from .create_event_block_request_event_action_type_0 import (
120121
CreateEventBlockRequestEventActionType0,
@@ -372,7 +373,11 @@
372373
from .ingest_report_request import IngestReportRequest
373374
from .ingest_report_response import IngestReportResponse
374375
from .initial_entity_data import InitialEntityData
376+
from .initial_entity_data_entity_type_type_0 import InitialEntityDataEntityTypeType0
375377
from .initialize_chart_of_accounts_request import InitializeChartOfAccountsRequest
378+
from .initialize_chart_of_accounts_request_entity_type_type_0 import (
379+
InitializeChartOfAccountsRequestEntityTypeType0,
380+
)
376381
from .initialize_chart_of_accounts_request_template import (
377382
InitializeChartOfAccountsRequestTemplate,
378383
)
@@ -1217,6 +1222,7 @@
12171222
UpdateEntityRequestConsolidationMethodType0,
12181223
)
12191224
from .update_entity_request_entity_role_type_0 import UpdateEntityRequestEntityRoleType0
1225+
from .update_entity_request_entity_type_type_0 import UpdateEntityRequestEntityTypeType0
12201226
from .update_event_block_request import UpdateEventBlockRequest
12211227
from .update_event_block_request_event_action_type_0 import (
12221228
UpdateEventBlockRequestEventActionType0,
@@ -1389,6 +1395,7 @@
13891395
"CreateEntityRequest",
13901396
"CreateEntityRequestConsolidationMethodType0",
13911397
"CreateEntityRequestEntityRoleType0",
1398+
"CreateEntityRequestEntityTypeType0",
13921399
"CreateEventBlockRequest",
13931400
"CreateEventBlockRequestEventActionType0",
13941401
"CreateEventBlockRequestEventCategory",
@@ -1590,7 +1597,9 @@
15901597
"IngestReportRequest",
15911598
"IngestReportResponse",
15921599
"InitialEntityData",
1600+
"InitialEntityDataEntityTypeType0",
15931601
"InitializeChartOfAccountsRequest",
1602+
"InitializeChartOfAccountsRequestEntityTypeType0",
15941603
"InitializeChartOfAccountsRequestTemplate",
15951604
"InitializeChartOfAccountsResponse",
15961605
"InitializeChartOfAccountsResponseTemplate",
@@ -2105,6 +2114,7 @@
21052114
"UpdateEntityRequest",
21062115
"UpdateEntityRequestConsolidationMethodType0",
21072116
"UpdateEntityRequestEntityRoleType0",
2117+
"UpdateEntityRequestEntityTypeType0",
21082118
"UpdateEventBlockRequest",
21092119
"UpdateEventBlockRequestEventActionType0",
21102120
"UpdateEventBlockRequestMetadataPatch",

0 commit comments

Comments
 (0)