Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions robosystems_client/api/extensions_robo_ledger/build_fact_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,10 @@ def sync_detailed(
"""Build Fact Grid

Queries LadybugDB `Fact` nodes by element qnames or canonical concepts, with filters for periods,
entities, form, and fiscal context. Returns a deduplicated pivot table. Works on both roboledger
tenant graphs (post-materialization) and the SEC shared repository.
entities, form, and fiscal context. Returns deduplicated facts plus the aspects they span —
arranging them into a table is the consumer's job, since collapsing cells safely requires the full
aspect signature. Works on both roboledger tenant graphs (post-materialization) and the SEC shared
repository.

**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
Expand Down Expand Up @@ -154,8 +156,10 @@ def sync(
"""Build Fact Grid

Queries LadybugDB `Fact` nodes by element qnames or canonical concepts, with filters for periods,
entities, form, and fiscal context. Returns a deduplicated pivot table. Works on both roboledger
tenant graphs (post-materialization) and the SEC shared repository.
entities, form, and fiscal context. Returns deduplicated facts plus the aspects they span —
arranging them into a table is the consumer's job, since collapsing cells safely requires the full
aspect signature. Works on both roboledger tenant graphs (post-materialization) and the SEC shared
repository.

**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
Expand Down Expand Up @@ -191,8 +195,10 @@ async def asyncio_detailed(
"""Build Fact Grid

Queries LadybugDB `Fact` nodes by element qnames or canonical concepts, with filters for periods,
entities, form, and fiscal context. Returns a deduplicated pivot table. Works on both roboledger
tenant graphs (post-materialization) and the SEC shared repository.
entities, form, and fiscal context. Returns deduplicated facts plus the aspects they span —
arranging them into a table is the consumer's job, since collapsing cells safely requires the full
aspect signature. Works on both roboledger tenant graphs (post-materialization) and the SEC shared
repository.

**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
Expand Down Expand Up @@ -231,8 +237,10 @@ async def asyncio(
"""Build Fact Grid

Queries LadybugDB `Fact` nodes by element qnames or canonical concepts, with filters for periods,
entities, form, and fiscal context. Returns a deduplicated pivot table. Works on both roboledger
tenant graphs (post-materialization) and the SEC shared repository.
entities, form, and fiscal context. Returns deduplicated facts plus the aspects they span —
arranging them into a table is the consumer's job, since collapsing cells safely requires the full
aspect signature. Works on both roboledger tenant graphs (post-materialization) and the SEC shared
repository.

**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
Expand Down
16 changes: 10 additions & 6 deletions robosystems_client/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,15 @@
DetailedTransactionsResponseDateRange,
)
from .detailed_transactions_response_summary import DetailedTransactionsResponseSummary
from .dimension import Dimension
from .dimension_type import DimensionType
from .document_detail_response import DocumentDetailResponse
from .document_list_item import DocumentListItem
from .document_list_response import DocumentListResponse
from .document_section import DocumentSection
from .download_quota import DownloadQuota
from .element_lite import ElementLite
from .element_summary import ElementSummary
from .element_update_patch import ElementUpdatePatch
from .element_update_patch_metadata_type_0 import ElementUpdatePatchMetadataType0
from .email_verification_request import EmailVerificationRequest
Expand Down Expand Up @@ -220,6 +223,7 @@
)
from .external_connection_config import ExternalConnectionConfig
from .fact_lite import FactLite
from .fact_record import FactRecord
from .fact_set_lite import FactSetLite
from .fact_set_lite_provenance_type_0 import FactSetLiteProvenanceType0
from .file_info import FileInfo
Expand Down Expand Up @@ -830,13 +834,11 @@
from .verification_result_lite import VerificationResultLite
from .verification_summary import VerificationSummary
from .view_axis_config import ViewAxisConfig
from .view_axis_config_element_labels_type_0 import ViewAxisConfigElementLabelsType0
from .view_axis_config_member_labels_type_0 import ViewAxisConfigMemberLabelsType0
from .view_config import ViewConfig
from .view_metadata import ViewMetadata
from .view_projections import ViewProjections
from .view_response import ViewResponse
from .view_response_presentations import ViewResponsePresentations
from .view_response_summary_type_0 import ViewResponseSummaryType0

__all__ = (
"AccountInfo",
Expand Down Expand Up @@ -990,12 +992,15 @@
"DetailedTransactionsResponse",
"DetailedTransactionsResponseDateRange",
"DetailedTransactionsResponseSummary",
"Dimension",
"DimensionType",
"DocumentDetailResponse",
"DocumentListItem",
"DocumentListResponse",
"DocumentSection",
"DownloadQuota",
"ElementLite",
"ElementSummary",
"ElementUpdatePatch",
"ElementUpdatePatchMetadataType0",
"EmailVerificationRequest",
Expand All @@ -1021,6 +1026,7 @@
"ExecuteEventBlockResponseQbErrorType0",
"ExternalConnectionConfig",
"FactLite",
"FactRecord",
"FactSetLite",
"FactSetLiteProvenanceType0",
"FileInfo",
Expand Down Expand Up @@ -1425,11 +1431,9 @@
"VerificationResultLite",
"VerificationSummary",
"ViewAxisConfig",
"ViewAxisConfigElementLabelsType0",
"ViewAxisConfigMemberLabelsType0",
"ViewConfig",
"ViewMetadata",
"ViewProjections",
"ViewResponse",
"ViewResponsePresentations",
"ViewResponseSummaryType0",
)
10 changes: 10 additions & 0 deletions robosystems_client/models/create_view_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class CreateViewRequest:
fiscal_period (None | str | Unset): Filter by fiscal period (e.g., 'FY', 'Q1', 'Q2', 'Q3')
period_type (None | str | Unset): Filter by period type: 'annual', 'quarterly', or 'instant'
include_summary (bool | Unset): Include summary statistics per element Default: False.
limit (int | Unset): Maximum facts to return. Applied after deduplication and sorting, so truncation keeps the
most recent periods. Check `metadata.truncated` to see whether more facts matched. Default: 250.
view_config (ViewConfig | Unset):
"""

Expand All @@ -43,6 +45,7 @@ class CreateViewRequest:
fiscal_period: None | str | Unset = UNSET
period_type: None | str | Unset = UNSET
include_summary: bool | Unset = False
limit: int | Unset = 250
view_config: ViewConfig | Unset = UNSET
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)

Expand Down Expand Up @@ -95,6 +98,8 @@ def to_dict(self) -> dict[str, Any]:

include_summary = self.include_summary

limit = self.limit

view_config: dict[str, Any] | Unset = UNSET
if not isinstance(self.view_config, Unset):
view_config = self.view_config.to_dict()
Expand Down Expand Up @@ -122,6 +127,8 @@ def to_dict(self) -> dict[str, Any]:
field_dict["period_type"] = period_type
if include_summary is not UNSET:
field_dict["include_summary"] = include_summary
if limit is not UNSET:
field_dict["limit"] = limit
if view_config is not UNSET:
field_dict["view_config"] = view_config

Expand Down Expand Up @@ -187,6 +194,8 @@ def _parse_period_type(data: object) -> None | str | Unset:

include_summary = d.pop("include_summary", UNSET)

limit = d.pop("limit", UNSET)

_view_config = d.pop("view_config", UNSET)
view_config: ViewConfig | Unset
if isinstance(_view_config, Unset):
Expand All @@ -205,6 +214,7 @@ def _parse_period_type(data: object) -> None | str | Unset:
fiscal_period=fiscal_period,
period_type=period_type,
include_summary=include_summary,
limit=limit,
view_config=view_config,
)

Expand Down
83 changes: 83 additions & 0 deletions robosystems_client/models/dimension.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
from __future__ import annotations

from collections.abc import Mapping
from typing import Any, TypeVar, cast

from attrs import define as _attrs_define
from attrs import field as _attrs_field

from ..models.dimension_type import DimensionType
from ..types import UNSET, Unset

T = TypeVar("T", bound="Dimension")


@_attrs_define
class Dimension:
"""
Attributes:
name (str): Dimension name (e.g., 'Element', 'Period')
type_ (DimensionType):
members (list[str] | Unset): List of dimension members
"""

name: str
type_: DimensionType
members: list[str] | Unset = UNSET
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)

def to_dict(self) -> dict[str, Any]:
name = self.name

type_ = self.type_.value

members: list[str] | Unset = UNSET
if not isinstance(self.members, Unset):
members = self.members

field_dict: dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update(
{
"name": name,
"type": type_,
}
)
if members is not UNSET:
field_dict["members"] = members

return field_dict

@classmethod
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
d = dict(src_dict)
name = d.pop("name")

type_ = DimensionType(d.pop("type"))

members = cast(list[str], d.pop("members", UNSET))

dimension = cls(
name=name,
type_=type_,
members=members,
)

dimension.additional_properties = d
return dimension

@property
def additional_keys(self) -> list[str]:
return list(self.additional_properties.keys())

def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]

def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value

def __delitem__(self, key: str) -> None:
del self.additional_properties[key]

def __contains__(self, key: str) -> bool:
return key in self.additional_properties
10 changes: 10 additions & 0 deletions robosystems_client/models/dimension_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from enum import Enum


class DimensionType(str, Enum):
ELEMENT = "element"
ENTITY = "entity"
PERIOD = "period"

def __str__(self) -> str:
return str(self.value)
93 changes: 93 additions & 0 deletions robosystems_client/models/element_summary.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
from __future__ import annotations

from collections.abc import Mapping
from typing import Any, TypeVar

from attrs import define as _attrs_define
from attrs import field as _attrs_field

T = TypeVar("T", bound="ElementSummary")


@_attrs_define
class ElementSummary:
"""
Attributes:
count (int): Number of facts for this element
total (float): Sum of values across the returned facts
average (float): Mean value across the returned facts
min_ (float): Minimum value across the returned facts
max_ (float): Maximum value across the returned facts
"""

count: int
total: float
average: float
min_: float
max_: float
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)

def to_dict(self) -> dict[str, Any]:
count = self.count

total = self.total

average = self.average

min_ = self.min_

max_ = self.max_

field_dict: dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update(
{
"count": count,
"total": total,
"average": average,
"min": min_,
"max": max_,
}
)

return field_dict

@classmethod
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
d = dict(src_dict)
count = d.pop("count")

total = d.pop("total")

average = d.pop("average")

min_ = d.pop("min")

max_ = d.pop("max")

element_summary = cls(
count=count,
total=total,
average=average,
min_=min_,
max_=max_,
)

element_summary.additional_properties = d
return element_summary

@property
def additional_keys(self) -> list[str]:
return list(self.additional_properties.keys())

def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]

def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value

def __delitem__(self, key: str) -> None:
del self.additional_properties[key]

def __contains__(self, key: str) -> bool:
return key in self.additional_properties
Loading