Skip to content

joeychilson/xbrl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xbrl

A simple parser for XBRL files.

Usage

func main() {
	file, err := os.Open("msft.xml")
	if err != nil {
		log.Fatal(err)
	}
	defer file.Close()

	var xbrl xbrl.XBRL
	if err := xml.NewDecoder(file).Decode(&xbrl); err != nil {
		log.Fatal(err)
	}

	fmt.Println("Facts:", len(xbrl.Facts))
}

Example fact from parsed XBRL

{
  "context": {
    "entity": "0000789019",
    "segments": [
      {
        "dimension": "DerivativeInstrumentRisk",
        "member": "InterestRateContract"
      },
      {
        "dimension": "DerivativeInstrumentsGainLossByHedgingRelationship",
        "member": "FairValueHedging"
      },
      {
        "dimension": "IncomeStatementLocation",
        "member": "NonoperatingIncomeExpense"
      }
    ],
    "period": {
      "startDate": "2023-10-01",
      "endDate": "2023-12-31"
    }
  },
  "concept": "ChangeInUnrealizedGainLossOnHedgedItemInFairValueHedge1",
  "value": -34000000,
  "decimals": "-6",
  "unit": "USD"
},

About

A simple XBRL parser in Go.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages