Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
xbrl-parser
Advanced tools
Readme
XBRL parser and utility for parsing XBRL files.
The library was created specifically for parsing XBRL annual reports for Danish companies to extract income statement and balance data from the (slightly different) taxonomies used for annual reports and consolidate them in the same JSON-like format.
It has very limited support for US-GAAP taxonomy as well.
npm install --save xbrl-parser
Given a string containing an XBRL XML file, it will be parsed into a "raw" XBRL format which can be passed on to other parsers. The only parser supported right now is the Danish annual report parser.
import { parseXbrlFile } from 'xbrl-parser';
const xbrl = parseXbrlFile(myFileString);
console.log(xbrl);
import { CvrParser, parseAnnualReport } from 'xbrl-parser';
const report = parseAnnualReport(xmlString, new CvrParser());
console.log(report);
The CvrParser
is named like that since it parses information fetched from the Danish national registry cvr.dk. There is also a USGAAPParser
for for parsing XBRL for the US-GAAP taxonomy.
The code contains some comments for specific cases that have been discovered along the way. Some of the more interesting ones:
Usually, the xbrl instance root element is <xbrli:xbrl>
.
The standard also mentions this here: https://specifications.xbrl.org/xbrl-essentials.html
However, in the wild, other namespaces (or no namespaces) have been observed (like <xbrl>
), which may or may not be valid.
In order to make the output more consistent, there are two options:
This library uses the second choice, such that parsed XBRL documents use xbrli:
as namespace prefix for XBRL-specific fields.
The taxonomies for Danish annual reports is documented here (in Danish).
For this taxonomy, namespace renaming also happens for some annual reports, and this library tries to correct it.
Taxonomies for US-GAAP are available here.
The taxonomy is currenty mapped from only publicly traded companies which might have different reporting structure than SMEs.
In other words: Use with caution :D
FAQs
Module for parsing XBRL files for specific market taxonomies
The npm package xbrl-parser receives a total of 161 weekly downloads. As such, xbrl-parser popularity was classified as not popular.
We found that xbrl-parser demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.