ferc_xbrl_extractor.arelle_interface ==================================== .. py:module:: ferc_xbrl_extractor.arelle_interface .. autoapi-nested-parse:: Abstract away interface to Arelle XBRL Library. Classes ------- .. autoapisummary:: ferc_xbrl_extractor.arelle_interface.References ferc_xbrl_extractor.arelle_interface.Calculation ferc_xbrl_extractor.arelle_interface.Metadata Functions --------- .. autoapisummary:: ferc_xbrl_extractor.arelle_interface._taxonomy_view ferc_xbrl_extractor.arelle_interface.load_taxonomy ferc_xbrl_extractor.arelle_interface.load_taxonomy_from_archive Module Contents --------------- .. py:function:: _taxonomy_view(taxonomy_source: str | arelle.FileSource.FileSource, max_retries: int = 7) Actually use Arelle to get a taxonomy and its relationships. .. py:function:: load_taxonomy(path: pathlib.Path) Load XBRL taxonomy, and parse relationships. :param path: URL or local path pointing to an XBRL taxonomy. .. py:function:: load_taxonomy_from_archive(taxonomy_archive: io.BytesIO, entry_point: pathlib.Path) Load an XBRL taxonomy from a zipfile archive. :param taxonomy_archive: In memory taxonomy archive. :param entry_point: Relative path to taxonomy entry point within archive. .. py:class:: References(/, **data: Any) Bases: :py:obj:`pydantic.BaseModel` Pydantic model that defines XBRL references. FERC uses XBRL references to link Concepts defined in its taxonomy to the physical paper form. These are included in the output metadata and can be useful for linking between XBRL and DBF data. This model is not a generic representation of XBRL references, but specific to those used by FERC. .. py:attribute:: account :type: str :value: None .. py:attribute:: form_location :type: list[dict[str, str]] :value: None .. py:class:: Calculation(/, **data: Any) Bases: :py:obj:`pydantic.BaseModel` Pydantic model that defines XBRL calculations. XBRL calculation relationships are also included in the metadata. Calculations are a validation tool used to define relationships between facts using some mathematical formula. For example, a calculation relationship might denote that one fact is equal to the sum of 2 or more other facts, and this relationship can be used to validate a filing. .. py:attribute:: name :type: str .. py:attribute:: weight :type: float .. py:class:: Metadata(/, **data: Any) Bases: :py:obj:`pydantic.BaseModel` Pydantic model that defines metadata extracted from XBRL taxonomies. Taxonomies contain various metedata which are useful for interpreting XBRL filings. The metadata fields being extracted here include references, calculations, and balances. .. py:attribute:: name :type: str .. py:attribute:: references :type: References .. py:attribute:: calculations :type: list[Calculation] .. py:attribute:: balance :type: Literal['credit', 'debit'] | None :value: None .. py:method:: from_concept(concept: arelle.ModelDtsObject.ModelConcept) -> Metadata :classmethod: Get metadata for a single XBRL Concept. This function will create a Metadata object with metadata extracted for a single Concept. :param concept: Concept to extract metadata from.