xbrlens

    XBRLens parses XBRL filings, normalizes dimensional facts, and validates calculation relationships.

    xbrl
    financial-reporting
    taxonomy
    validation
    Download zip
    Version
    0.1.6
    License
    Apache-2.0
    Last updated
    12 hours ago
    Downloads
    21

    No dependencies

    #XBRLens

    XBRLens is a MoonBit-native XBRL 2.1 parsing and validation engine. It is intended for financial filing ingestion, taxonomy-aware fact normalization, XBRL Dimensions handling and calculation relationship checks.

    #Features

    • Bounded, namespace-aware XML parser with DTD/entity rejection
    • XBRL contexts, periods, entities, units and facts
    • Exact arbitrary-precision decimal arithmetic
    • Taxonomy schema parsing for concepts, imports and role types
    • Offline taxonomy catalog and import resolution
    • Label, presentation and calculation linkbases
    • XBRL Dimensions 1.0 explicit and typed members
    • Weighted calculation validation
    • Duplicate, conflict and integrity diagnostics
    • JSON and CSV fact export
    • CLI workflows and inspectable security audits
    • wasm, wasm-gc and JavaScript test coverage

    #Install

    moon add ggbond44439/xbrlens@0.1.6

    The current Mooncakes release is 0.1.6. The library requires MoonBit moonc >= 0.10.16 and has no native runtime dependency.

    #Usage

    let instance = match @xbrlens.parse_instance_xml(source, @xbrlens.XbrlLimits::strict()) {
    Ok(value) => value
    Err(err) => abort(err.to_string())
    }

    let facts_json = match @xbrlens.export_json(instance) {
    Ok(value) => value
    Err(err) => abort(err.to_string())
    }

    The source argument is an XBRL instance XML string. The parser rejects unsafe declarations, external entities, invalid control characters, malformed namespaces and inputs exceeding configured limits.

    #CLI

    moon run cmd/main -- inspect '<instance-xml>' moon run cmd/main -- facts '<instance-xml>' moon run cmd/main -- facts --csv '<instance-xml>' moon run cmd/main -- validate '<instance-xml>' moon run cmd/main -- calc '<instance-xml>' '<taxonomy-xml>' '<linkbase-xml>' moon run cmd/main -- diff '<left-instance-xml>' '<right-instance-xml>'

    #Examples and fixtures

    The representative fixture in fixtures/sample/ contains an instance, taxonomy and calculation linkbase covering duration/instant contexts, a monetary unit, an explicit dimension and a weighted calculation.

    moon run examples/smoke moon run cmd/main -- calc "$(cat fixtures/sample/instance.xml)" "$(cat fixtures/sample/taxonomy.xsd)" "$(cat fixtures/sample/calculation.xml)"

    Run independent XML-parser differential checking and the repeatable CLI benchmark:

    python scripts/differential_check.py python scripts/benchmark.py --iterations 3

    #Verification

    moon check --target all moon test --target wasm moon test --target wasm-gc moon test --target js moon fmt --check

    #Security

    Parsing is bounded by configurable source, XML depth, node, attribute, text, fact and linkbase-arc limits. DTDs and external entities are rejected, as are invalid XML control characters and raw ]]> text. Use audit_instance_source to obtain a bounded input audit summary.

    #License

    Apache-2.0

    ArcUse

    pub(all) enum ArcUse {
    Optional
    Prohibited
    Unspecified
    } derive(Eq,
    Debug
    )

    ArcUse::equal

    fn ArcUse::equal(ArcUse, ArcUse) -> Bool

    ArcUse::not_equal

    fn ArcUse::not_equal(x : ArcUse, y : ArcUse) -> Bool

    ArcUse::to_repr

    CalculationCheck

    pub(all) struct CalculationCheck {
    role_uri : String
    parent : QName
    context_ref : String
    expected : Decimal
    actual : Decimal
    matched : Bool
    child_count : Int
    } derive(Eq,
    Debug
    )

    CalculationCheck::equal

    CalculationCheck::not_equal

    fn CalculationCheck::not_equal(x : CalculationCheck, y : CalculationCheck) -> Bool

    CalculationGroup

    pub(all) struct CalculationGroup {
    role_uri : String
    parent : QName
    relations : Array[CalculationRelation]
    } derive(Eq,
    Debug
    )

    CalculationGroup::equal

    CalculationGroup::not_equal

    fn CalculationGroup::not_equal(x : CalculationGroup, y : CalculationGroup) -> Bool

    pub(all) struct CalculationLink {
    role_uri : String
    locators : Array[LinkLocator]
    arcs : Array[LinkArc]
    offset : Int
    } derive(Eq,
    Debug
    )

    CalculationLink::equal

    CalculationLink::not_equal

    fn CalculationLink::not_equal(x : CalculationLink, y : CalculationLink) -> Bool

    CalculationRelation

    pub(all) struct CalculationRelation {
    link_role_uri : String
    parent : QName
    child : QName
    weight : Decimal
    order : Decimal?
    priority : Int
    offset : Int
    } derive(Eq,
    Debug
    )

    CalculationRelation::equal

    CalculationRelation::not_equal

    CalculationReport

    pub(all) struct CalculationReport {
    checks : Array[CalculationCheck]
    } derive(Eq,
    Debug
    )

    CalculationReport::equal

    CalculationReport::is_valid

    fn CalculationReport::is_valid(self : CalculationReport) -> Bool

    CalculationReport::mismatches

    CalculationReport::not_equal

    fn CalculationReport::not_equal(x : CalculationReport, y : CalculationReport) -> Bool

    CliCommand

    pub(all) enum CliCommand {
    Help
    Version
    Inspect
    Facts
    Validate
    Calc
    Diff
    } derive(Eq,
    Debug
    )

    CliCommand::equal

    fn CliCommand::equal(CliCommand, CliCommand) -> Bool

    CliCommand::not_equal

    fn CliCommand::not_equal(x : CliCommand, y : CliCommand) -> Bool

    CliError

    pub(all) enum CliError {
    UnknownCommand(String)
    UnknownOption(String)
    MissingArgument(String)
    } derive(Eq,
    Debug
    )

    impl Show for CliError

    CliError::equal

    fn CliError::equal(CliError, CliError) -> Bool

    CliError::not_equal

    fn CliError::not_equal(x : CliError, y : CliError) -> Bool

    CliError::output

    fn CliError::output(self : CliError, logger : &Logger) -> Unit

    CliError::to_repr

    CliError::to_string

    fn CliError::to_string(self : CliError) -> String

    CliInvocation

    pub(all) struct CliInvocation {
    command : CliCommand
    args : Array[String]
    json : Bool
    csv : Bool
    help : Bool
    } derive(Eq,
    Debug
    )

    CliInvocation::equal

    CliInvocation::not_equal

    fn CliInvocation::not_equal(x : CliInvocation, y : CliInvocation) -> Bool

    CliResult

    pub(all) struct CliResult {
    exit_code : Int
    stdout : String
    stderr : String
    } derive(Eq,
    Debug
    )

    CliResult::equal

    fn CliResult::equal(CliResult, CliResult) -> Bool

    CliResult::failure

    fn CliResult::failure(code : Int, stderr : String) -> CliResult

    CliResult::not_equal

    fn CliResult::not_equal(x : CliResult, y : CliResult) -> Bool

    CliResult::success

    fn CliResult::success(stdout : String) -> CliResult

    ConceptBalance

    pub(all) enum ConceptBalance {
    Debit
    Credit
    Unspecified
    } derive(Eq,
    Debug
    )

    ConceptBalance::equal

    ConceptBalance::not_equal

    fn ConceptBalance::not_equal(x : ConceptBalance, y : ConceptBalance) -> Bool

    ConceptKind

    pub(all) enum ConceptKind {
    Item
    Tuple
    } derive(Eq,
    Debug
    )

    ConceptKind::equal

    fn ConceptKind::equal(ConceptKind, ConceptKind) -> Bool

    ConceptKind::not_equal

    fn ConceptKind::not_equal(x : ConceptKind, y : ConceptKind) -> Bool

    ConceptLabel

    pub(all) struct ConceptLabel {
    concept : QName
    link_role_uri : String
    label_role_uri : String
    language : String?
    text : String
    priority : Int
    offset : Int
    } derive(Eq,
    Debug
    )

    ConceptLabel::equal

    ConceptLabel::not_equal

    fn ConceptLabel::not_equal(x : ConceptLabel, y : ConceptLabel) -> Bool

    ConceptPeriodType

    pub(all) enum ConceptPeriodType {
    Instant
    Duration
    Unspecified
    } derive(Eq,
    Debug
    )

    ConceptPeriodType::equal

    ConceptPeriodType::not_equal

    fn ConceptPeriodType::not_equal(x : ConceptPeriodType, y : ConceptPeriodType) -> Bool

    Decimal

    pub(all) struct Decimal {
    coefficient :
    BigInt

    scale : Int
    } derive(Eq,
    Debug
    )

    Decimal::add

    fn Decimal::add(self : Decimal, other : Decimal, offset : Int) -> Result[Decimal, XbrlError]

    Decimal::compare

    fn Decimal::compare(self : Decimal, other : Decimal) -> Int

    Decimal::equal

    fn Decimal::equal(Decimal, Decimal) -> Bool

    Decimal::is_zero

    fn Decimal::is_zero(self : Decimal) -> Bool

    Decimal::mul

    fn Decimal::mul(self : Decimal, other : Decimal, offset : Int) -> Result[Decimal, XbrlError]

    Decimal::neg

    fn Decimal::neg(self : Decimal) -> Decimal

    Decimal::normalize

    fn Decimal::normalize(self : Decimal) -> Decimal

    Decimal::not_equal

    fn Decimal::not_equal(x : Decimal, y : Decimal) -> Bool

    Decimal::parse

    fn Decimal::parse(value : StringView) -> Result[Decimal, XbrlError]

    Decimal::sub

    fn Decimal::sub(self : Decimal, other : Decimal, offset : Int) -> Result[Decimal, XbrlError]

    Decimal::to_canonical_string

    fn Decimal::to_canonical_string(self : Decimal) -> String

    Decimal::to_repr

    Decimal::to_scaled_integer

    fn Decimal::to_scaled_integer(self : Decimal, scale : Int) -> Result[
    BigInt
    , XbrlError]

    Decimal::zero

    fn Decimal::zero() -> Decimal

    DimensionMember

    pub(all) enum DimensionMember {
    Explicit(QName, QName)
    Typed(QName, QName, String)
    } derive(Eq,
    Debug
    )

    DimensionMember::dimension

    fn DimensionMember::dimension(self : DimensionMember) -> QName

    DimensionMember::equal

    DimensionMember::not_equal

    fn DimensionMember::not_equal(x : DimensionMember, y : DimensionMember) -> Bool

    FactDiagnostic

    pub(all) struct FactDiagnostic {
    kind : FactDiagnosticKind
    severity : FactDiagnosticSeverity
    concept : QName
    context_ref : String
    unit_ref : String?
    fact_ids : Array[String]
    message : String
    offset : Int
    } derive(Eq,
    Debug
    )

    FactDiagnostic::equal

    FactDiagnostic::not_equal

    fn FactDiagnostic::not_equal(x : FactDiagnostic, y : FactDiagnostic) -> Bool

    FactDiagnosticKind

    pub(all) enum FactDiagnosticKind {
    ExactDuplicate
    ConflictingDuplicate
    NilConflict
    MultipleUnits
    DecimalsPrecisionConflict
    InvalidDecimals
    InvalidPrecision
    } derive(Eq,
    Debug
    )

    FactDiagnosticKind::equal

    FactDiagnosticKind::not_equal

    FactDiagnosticSeverity

    pub(all) enum FactDiagnosticSeverity {
    Error
    Warning
    } derive(Eq,
    Debug
    )

    FactDiagnosticSeverity::equal

    FactDiagnosticSeverity::not_equal

    FactExportRow

    pub(all) struct FactExportRow {
    fact_id : String?
    concept : String
    namespace_uri : String
    local_name : String
    context_ref : String
    entity_scheme : String
    entity_identifier : String
    period_type : String
    instant : String?
    start_date : String?
    end_date : String?
    unit_ref : String?
    unit : String?
    value : String
    canonical_value : String?
    nil : Bool
    decimals : String?
    precision : String?
    language : String?
    dimensions_json : String
    } derive(Eq,
    Debug
    )

    FactExportRow::equal

    FactExportRow::not_equal

    fn FactExportRow::not_equal(x : FactExportRow, y : FactExportRow) -> Bool

    FactIntegrityReport

    pub(all) struct FactIntegrityReport {
    diagnostics : Array[FactDiagnostic]
    } derive(Eq,
    Debug
    )

    FactIntegrityReport::equal

    FactIntegrityReport::error_count

    fn FactIntegrityReport::error_count(self : FactIntegrityReport) -> Int

    FactIntegrityReport::has_errors

    fn FactIntegrityReport::has_errors(self : FactIntegrityReport) -> Bool

    FactIntegrityReport::not_equal

    FactIntegrityReport::warning_count

    fn FactIntegrityReport::warning_count(self : FactIntegrityReport) -> Int

    pub(all) struct LabelLink {
    role_uri : String
    locators : Array[LinkLocator]
    labels : Array[LabelResource]
    arcs : Array[LinkArc]
    offset : Int
    } derive(Eq,
    Debug
    )

    LabelLink::equal

    fn LabelLink::equal(LabelLink, LabelLink) -> Bool

    LabelLink::not_equal

    fn LabelLink::not_equal(x : LabelLink, y : LabelLink) -> Bool

    LabelResource

    pub(all) struct LabelResource {
    label : String
    role_uri : String
    language : String?
    text : String
    offset : Int
    } derive(Eq,
    Debug
    )

    LabelResource::equal

    LabelResource::not_equal

    fn LabelResource::not_equal(x : LabelResource, y : LabelResource) -> Bool

    LinkArc

    pub(all) struct LinkArc {
    from_label : String
    to_label : String
    arcrole : String
    order : Decimal?
    weight : Decimal?
    preferred_label : QName?
    arc_use : ArcUse
    priority : Int
    offset : Int
    } derive(Eq,
    Debug
    )

    LinkArc::equal

    fn LinkArc::equal(LinkArc, LinkArc) -> Bool

    LinkArc::not_equal

    fn LinkArc::not_equal(x : LinkArc, y : LinkArc) -> Bool

    LinkArc::to_repr

    LinkLocator

    pub(all) struct LinkLocator {
    label : String
    href : String
    offset : Int
    } derive(Eq,
    Debug
    )

    LinkLocator::equal

    fn LinkLocator::equal(LinkLocator, LinkLocator) -> Bool

    LinkLocator::not_equal

    fn LinkLocator::not_equal(x : LinkLocator, y : LinkLocator) -> Bool

    NamespaceBinding

    pub(all) struct NamespaceBinding {
    prefix : String
    uri : String
    } derive(Eq,
    Debug
    )

    NamespaceBinding::equal

    NamespaceBinding::new

    fn NamespaceBinding::new(prefix : String, uri : String) -> NamespaceBinding

    NamespaceBinding::not_equal

    fn NamespaceBinding::not_equal(x : NamespaceBinding, y : NamespaceBinding) -> Bool

    pub(all) struct PresentationLink {
    role_uri : String
    locators : Array[LinkLocator]
    arcs : Array[LinkArc]
    offset : Int
    } derive(Eq,
    Debug
    )

    PresentationLink::equal

    PresentationLink::not_equal

    fn PresentationLink::not_equal(x : PresentationLink, y : PresentationLink) -> Bool

    PresentationRelation

    pub(all) struct PresentationRelation {
    link_role_uri : String
    parent : QName
    child : QName
    order : Decimal?
    preferred_label : QName?
    priority : Int
    offset : Int
    } derive(Eq,
    Debug
    )

    PresentationRelation::equal

    PresentationRelation::not_equal

    QName

    pub(all) struct QName {
    namespace_uri : String
    local_name : String
    } derive(Eq,
    Debug
    )

    Expanded XML qualified name. The empty namespace is retained for no-namespace documents and unprefixed attributes.

    QName::equal

    fn QName::equal(QName, QName) -> Bool

    QName::expanded

    fn QName::expanded(self : QName) -> String

    QName::local_part

    fn QName::local_part(self : QName) -> String

    QName::matches

    fn QName::matches(self : QName, namespace_uri : String, local_name : String) -> Bool

    QName::namespace_uri

    fn QName::namespace_uri(self : QName) -> String

    QName::new

    fn QName::new(namespace_uri : String, local_name : String) -> Result[QName, XbrlError]

    QName::not_equal

    fn QName::not_equal(x : QName, y : QName) -> Bool

    QName::to_repr

    ResolvedTaxonomy

    pub(all) struct ResolvedTaxonomy {
    root_location : String
    schemas : Array[ResolvedTaxonomySchema]
    } derive(Eq,
    Debug
    )

    ResolvedTaxonomy::concept

    fn ResolvedTaxonomy::concept(self : ResolvedTaxonomy, namespace_uri : String, local_name : String) -> XbrlConcept?

    ResolvedTaxonomy::equal

    ResolvedTaxonomy::not_equal

    fn ResolvedTaxonomy::not_equal(x : ResolvedTaxonomy, y : ResolvedTaxonomy) -> Bool

    ResolvedTaxonomy::schema

    fn ResolvedTaxonomy::schema(self : ResolvedTaxonomy, location : String) -> ResolvedTaxonomySchema?

    ResolvedTaxonomySchema

    pub(all) struct ResolvedTaxonomySchema {
    location : String
    schema : XbrlSchema
    source : String
    } derive(Eq,
    Debug
    )

    ResolvedTaxonomySchema::equal

    ResolvedTaxonomySchema::not_equal

    RoleType

    pub(all) struct RoleType {
    id : String
    role_uri : String
    definition : String?
    used_on : Array[QName]
    offset : Int
    } derive(Eq,
    Debug
    )

    RoleType::equal

    fn RoleType::equal(RoleType, RoleType) -> Bool

    RoleType::not_equal

    fn RoleType::not_equal(x : RoleType, y : RoleType) -> Bool

    RoleType::to_repr

    SecurityAudit

    pub(all) struct SecurityAudit {
    source_bytes : Int
    xml_nodes : Int
    contexts : Int
    units : Int
    facts : Int
    } derive(Eq,
    Debug
    )

    SecurityAudit::equal

    SecurityAudit::not_equal

    fn SecurityAudit::not_equal(x : SecurityAudit, y : SecurityAudit) -> Bool

    TaxonomyCatalog

    pub(all) struct TaxonomyCatalog {
    entries : Array[TaxonomyCatalogEntry]
    } derive(Eq,
    Debug
    )

    TaxonomyCatalog::add

    fn TaxonomyCatalog::add(self : TaxonomyCatalog, location : String, namespace_uri : String, source : StringView) -> Result[Unit, XbrlError]

    TaxonomyCatalog::entry

    fn TaxonomyCatalog::entry(self : TaxonomyCatalog, location : String) -> TaxonomyCatalogEntry?

    TaxonomyCatalog::equal

    TaxonomyCatalog::new

    TaxonomyCatalog::not_equal

    fn TaxonomyCatalog::not_equal(x : TaxonomyCatalog, y : TaxonomyCatalog) -> Bool

    TaxonomyCatalog::resolve

    fn TaxonomyCatalog::resolve(self : TaxonomyCatalog, root_location : String, limits : XbrlLimits) -> Result[ResolvedTaxonomy, XbrlError]

    TaxonomyCatalogEntry

    pub(all) struct TaxonomyCatalogEntry {
    location : String
    namespace_uri : String
    source : String
    } derive(Eq,
    Debug
    )

    TaxonomyCatalogEntry::equal

    TaxonomyCatalogEntry::not_equal

    TaxonomyImport

    pub(all) struct TaxonomyImport {
    namespace_uri : String
    schema_location : String?
    offset : Int
    } derive(Eq,
    Debug
    )

    TaxonomyImport::equal

    TaxonomyImport::not_equal

    fn TaxonomyImport::not_equal(x : TaxonomyImport, y : TaxonomyImport) -> Bool

    XbrlConcept

    pub(all) struct XbrlConcept {
    name : QName
    id : String?
    type_name : QName
    substitution_group : QName
    kind : ConceptKind
    period_type : ConceptPeriodType
    balance : ConceptBalance
    is_abstract : Bool
    nillable : Bool
    offset : Int
    } derive(Eq,
    Debug
    )

    XbrlConcept::equal

    fn XbrlConcept::equal(XbrlConcept, XbrlConcept) -> Bool

    XbrlConcept::not_equal

    fn XbrlConcept::not_equal(x : XbrlConcept, y : XbrlConcept) -> Bool

    XbrlContext

    pub(all) struct XbrlContext {
    id : String
    entity_scheme : String
    entity_identifier : String
    period : XbrlPeriod
    segment : XmlNode?
    scenario : XmlNode?
    dimensions : Array[DimensionMember]
    offset : Int
    } derive(Eq,
    Debug
    )

    XbrlContext::dimension

    fn XbrlContext::dimension(self : XbrlContext, dimension : QName) -> DimensionMember?

    XbrlContext::equal

    fn XbrlContext::equal(XbrlContext, XbrlContext) -> Bool

    XbrlContext::not_equal

    fn XbrlContext::not_equal(x : XbrlContext, y : XbrlContext) -> Bool

    XbrlError

    pub(all) enum XbrlError {
    InvalidLimit(String, Int)
    LimitExceeded(String, Int, Int)
    InvalidQName(String, Int)
    MissingNamespace(String, Int)
    XmlSyntax(String, Int)
    UnsafeXml(String, Int)
    InvalidDecimal(String, Int)
    InvalidContext(String, Int)
    InvalidUnit(String, Int)
    InvalidTaxonomy(String, Int)
    InvalidLinkbase(String, Int)
    MissingConcept(String)
    UnresolvedReference(String)
    InvalidDimension(String, Int)
    DuplicateFact(String, Int)
    CalculationMismatch(String, String, String)
    InvalidFact(String, Int)
    UnsupportedFeature(String)
    Io(String)
    } derive(Eq,
    Debug
    )

    impl Show for XbrlError

    XbrlError::equal

    fn XbrlError::equal(XbrlError, XbrlError) -> Bool

    XbrlError::not_equal

    fn XbrlError::not_equal(x : XbrlError, y : XbrlError) -> Bool

    XbrlError::output

    fn XbrlError::output(self : XbrlError, logger : &Logger) -> Unit

    XbrlError::to_string

    fn XbrlError::to_string(self : XbrlError) -> String

    XbrlFact

    pub(all) struct XbrlFact {
    id : String?
    concept : QName
    context_ref : String
    unit_ref : String?
    decimals : String?
    precision : String?
    language : String?
    value : String
    nil : Bool
    offset : Int
    } derive(Eq,
    Debug
    )

    XbrlFact::equal

    fn XbrlFact::equal(XbrlFact, XbrlFact) -> Bool

    XbrlFact::not_equal

    fn XbrlFact::not_equal(x : XbrlFact, y : XbrlFact) -> Bool

    XbrlFact::to_repr

    XbrlInstance

    pub(all) struct XbrlInstance {
    schema_refs : Array[String]
    contexts : Array[XbrlContext]
    units : Array[XbrlUnitDefinition]
    facts : Array[XbrlFact]
    } derive(Eq,
    Debug
    )

    XbrlInstance::context

    fn XbrlInstance::context(self : XbrlInstance, id : String) -> XbrlContext?

    XbrlInstance::equal

    XbrlInstance::fact_integrity

    fn XbrlInstance::fact_integrity(self : XbrlInstance) -> FactIntegrityReport

    XbrlInstance::facts_for_concept

    fn XbrlInstance::facts_for_concept(self : XbrlInstance, concept : QName) -> Array[XbrlFact]

    XbrlInstance::facts_for_context

    fn XbrlInstance::facts_for_context(self : XbrlInstance, id : String) -> Array[XbrlFact]

    XbrlInstance::not_equal

    fn XbrlInstance::not_equal(x : XbrlInstance, y : XbrlInstance) -> Bool

    XbrlInstance::unit

    fn XbrlInstance::unit(self : XbrlInstance, id : String) -> XbrlUnitDefinition?

    XbrlLimits

    pub(all) struct XbrlLimits {
    max_source_bytes : Int
    max_xml_depth : Int
    max_xml_nodes : Int
    max_attributes_per_element : Int
    max_text_bytes : Int
    max_facts : Int
    max_taxonomy_documents : Int
    max_linkbase_arcs : Int
    } derive(Eq,
    Debug
    )

    XbrlLimits::check_attributes

    fn XbrlLimits::check_attributes(self : XbrlLimits, actual : Int) -> Result[Unit, XbrlError]

    XbrlLimits::check_depth

    fn XbrlLimits::check_depth(self : XbrlLimits, actual : Int) -> Result[Unit, XbrlError]

    XbrlLimits::check_facts

    fn XbrlLimits::check_facts(self : XbrlLimits, actual : Int) -> Result[Unit, XbrlError]

    XbrlLimits::check_linkbase_arcs

    fn XbrlLimits::check_linkbase_arcs(self : XbrlLimits, actual : Int) -> Result[Unit, XbrlError]

    XbrlLimits::check_nodes

    fn XbrlLimits::check_nodes(self : XbrlLimits, actual : Int) -> Result[Unit, XbrlError]

    XbrlLimits::check_source

    fn XbrlLimits::check_source(self : XbrlLimits, actual : Int) -> Result[Unit, XbrlError]

    XbrlLimits::check_taxonomy_documents

    fn XbrlLimits::check_taxonomy_documents(self : XbrlLimits, actual : Int) -> Result[Unit, XbrlError]

    XbrlLimits::check_text

    fn XbrlLimits::check_text(self : XbrlLimits, actual : Int) -> Result[Unit, XbrlError]

    XbrlLimits::default

    fn XbrlLimits::default() -> XbrlLimits

    XbrlLimits::equal

    fn XbrlLimits::equal(XbrlLimits, XbrlLimits) -> Bool

    XbrlLimits::not_equal

    fn XbrlLimits::not_equal(x : XbrlLimits, y : XbrlLimits) -> Bool

    XbrlLimits::strict

    fn XbrlLimits::strict() -> XbrlLimits

    XbrlLimits::validate

    fn XbrlLimits::validate(self : XbrlLimits) -> Result[Unit, XbrlError]

    XbrlLinkbase

    pub(all) struct XbrlLinkbase {
    label_links : Array[LabelLink]
    presentation_links : Array[PresentationLink]
    calculation_links : Array[CalculationLink]
    } derive(Eq,
    Debug
    )

    XbrlLinkbase::calculation_groups

    fn XbrlLinkbase::calculation_groups(self : XbrlLinkbase, taxonomy : ResolvedTaxonomy) -> Result[Array[CalculationGroup], XbrlError]

    XbrlLinkbase::calculation_relations

    fn XbrlLinkbase::calculation_relations(self : XbrlLinkbase, taxonomy : ResolvedTaxonomy) -> Result[Array[CalculationRelation], XbrlError]

    XbrlLinkbase::check_calculations

    fn XbrlLinkbase::check_calculations(self : XbrlLinkbase, taxonomy : ResolvedTaxonomy, instance : XbrlInstance) -> Result[CalculationReport, XbrlError]

    XbrlLinkbase::equal

    XbrlLinkbase::labels

    XbrlLinkbase::not_equal

    fn XbrlLinkbase::not_equal(x : XbrlLinkbase, y : XbrlLinkbase) -> Bool

    XbrlLinkbase::presentation_relations

    fn XbrlLinkbase::presentation_relations(self : XbrlLinkbase, taxonomy : ResolvedTaxonomy) -> Result[Array[PresentationRelation], XbrlError]

    XbrlPeriod

    pub(all) enum XbrlPeriod {
    Instant(String)
    Duration(String, String)
    } derive(Eq,
    Debug
    )

    XbrlPeriod::equal

    fn XbrlPeriod::equal(XbrlPeriod, XbrlPeriod) -> Bool

    XbrlPeriod::not_equal

    fn XbrlPeriod::not_equal(x : XbrlPeriod, y : XbrlPeriod) -> Bool

    XbrlSchema

    pub(all) struct XbrlSchema {
    target_namespace : String
    imports : Array[TaxonomyImport]
    concepts : Array[XbrlConcept]
    role_types : Array[RoleType]
    offset : Int
    } derive(Eq,
    Debug
    )

    XbrlSchema::concept

    fn XbrlSchema::concept(self : XbrlSchema, namespace_uri : String, local_name : String) -> XbrlConcept?

    XbrlSchema::equal

    fn XbrlSchema::equal(XbrlSchema, XbrlSchema) -> Bool

    XbrlSchema::not_equal

    fn XbrlSchema::not_equal(x : XbrlSchema, y : XbrlSchema) -> Bool

    XbrlUnit

    pub(all) enum XbrlUnit {
    Simple(QName)
    Divide(Array[QName], Array[QName])
    } derive(Eq,
    Debug
    )

    XbrlUnit::equal

    fn XbrlUnit::equal(XbrlUnit, XbrlUnit) -> Bool

    XbrlUnit::not_equal

    fn XbrlUnit::not_equal(x : XbrlUnit, y : XbrlUnit) -> Bool

    XbrlUnit::to_repr

    XbrlUnitDefinition

    pub(all) struct XbrlUnitDefinition {
    id : String
    unit : XbrlUnit
    offset : Int
    } derive(Eq,
    Debug
    )

    XbrlUnitDefinition::equal

    XbrlUnitDefinition::not_equal

    XmlAttribute

    pub(all) struct XmlAttribute {
    name : QName
    value : String
    offset : Int
    } derive(Eq,
    Debug
    )

    XmlAttribute::equal

    XmlAttribute::not_equal

    fn XmlAttribute::not_equal(x : XmlAttribute, y : XmlAttribute) -> Bool

    XmlDocument

    pub(all) struct XmlDocument {
    root : XmlNode
    } derive(Eq,
    Debug
    )

    XmlDocument::equal

    fn XmlDocument::equal(XmlDocument, XmlDocument) -> Bool

    XmlDocument::not_equal

    fn XmlDocument::not_equal(x : XmlDocument, y : XmlDocument) -> Bool

    XmlNode

    pub(all) struct XmlNode {
    name : QName
    attributes : Array[XmlAttribute]
    namespaces : Array[NamespaceBinding]
    children : Array[XmlNode]
    text : String
    offset : Int
    } derive(Eq,
    Debug
    )

    XmlNode::attribute

    fn XmlNode::attribute(self : XmlNode, namespace_uri : String, local_name : String) -> String?

    XmlNode::attribute_by_local

    fn XmlNode::attribute_by_local(self : XmlNode, local_name : String) -> String?

    XmlNode::child

    fn XmlNode::child(self : XmlNode, namespace_uri : String, local_name : String) -> XmlNode?

    XmlNode::children_named

    fn XmlNode::children_named(self : XmlNode, namespace_uri : String, local_name : String) -> Array[XmlNode]

    XmlNode::equal

    fn XmlNode::equal(XmlNode, XmlNode) -> Bool

    XmlNode::not_equal

    fn XmlNode::not_equal(x : XmlNode, y : XmlNode) -> Bool

    XmlNode::to_repr

    audit_instance_source

    fn audit_instance_source(source : StringView, limits : XbrlLimits) -> Result[SecurityAudit, XbrlError]

    check_calculations

    fn check_calculations(linkbase : XbrlLinkbase, taxonomy : ResolvedTaxonomy, instance : XbrlInstance) -> Result[CalculationReport, XbrlError]

    check_fact_integrity

    fn check_fact_integrity(instance : XbrlInstance) -> FactIntegrityReport

    cli_help_text

    fn cli_help_text() -> String

    export_csv

    fn export_csv(instance : XbrlInstance) -> Result[String, XbrlError]

    export_json

    fn export_json(instance : XbrlInstance) -> Result[String, XbrlError]

    export_rows

    fn export_rows(instance : XbrlInstance) -> Result[Array[FactExportRow], XbrlError]

    parse_context_dimensions

    fn parse_context_dimensions(segment : XmlNode?, scenario : XmlNode?) -> Result[Array[DimensionMember], XbrlError]

    parse_instance

    fn parse_instance(document : XmlDocument, limits : XbrlLimits) -> Result[XbrlInstance, XbrlError]

    parse_instance_xml

    fn parse_instance_xml(source : StringView, limits : XbrlLimits) -> Result[XbrlInstance, XbrlError]

    parse_invocation

    fn parse_invocation(args : ArrayView[String]) -> Result[CliInvocation, CliError]

    parse_linkbase

    fn parse_linkbase(document : XmlDocument, limits : XbrlLimits) -> Result[XbrlLinkbase, XbrlError]

    parse_linkbase_xml

    fn parse_linkbase_xml(source : StringView, limits : XbrlLimits) -> Result[XbrlLinkbase, XbrlError]

    parse_taxonomy

    fn parse_taxonomy(document : XmlDocument) -> Result[XbrlSchema, XbrlError]

    parse_taxonomy_xml

    fn parse_taxonomy_xml(source : StringView, limits : XbrlLimits) -> Result[XbrlSchema, XbrlError]

    parse_xml

    fn parse_xml(source : StringView, limits : XbrlLimits) -> Result[XmlDocument, XbrlError]

    resolve_qname

    fn resolve_qname(lexical : StringView, bindings : Array[NamespaceBinding], use_default_namespace : Bool) -> Result[QName, XbrlError]

    Resolves prefix:local against a namespace stack encoded as ordered bindings. Later bindings shadow earlier ones. The default namespace applies only to elements, which is why the caller chooses whether to use it.

    run

    fn run(args : ArrayView[String]) -> CliResult

    version

    fn version() -> String