Skip to main content

A package to parse SEC XBRL

Project description

SEC XBRL

A python package to parse sec xbrl. Supports the datamule project.

Intended to be fast & lightweight for SEC inline XBRL.

Other XBRL Packages may be better for your use-case:

Installation

pip install secxbrl

Example

from secxbrl import parse_inline_xbrl

# load data
path = '../samples/000095017022000796/tsla-20211231.htm'
with open(path,'rb') as f:
    content = f.read()

# parse data
ix = parse_inline_xbrl(content)
with open('test.txt','w', encoding='utf-8') as f:
    f.writelines([str(item)+'\n\n' for item in ix])

# get all EarningsPerShareBasic
basic = [{'val':item['_val'],'date':item['_context']['context_period_enddate']} for item in ix if item['_attributes']['name']=='us-gaap:EarningsPerShareBasic']
print(basic)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

secxbrl-0.0.3.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

secxbrl-0.0.3-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file secxbrl-0.0.3.tar.gz.

File metadata

  • Download URL: secxbrl-0.0.3.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for secxbrl-0.0.3.tar.gz
Algorithm Hash digest
SHA256 85c8bffa5b1726ea46573724d0503aaf08f16761520de217d154d65ab859e77f
MD5 d39a5a3baaa8767eee137da720579d5c
BLAKE2b-256 5574a171de21bd430a1929b17c8ca4d2c14f1f0359f1a26acd86350d18689549

See more details on using hashes here.

File details

Details for the file secxbrl-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: secxbrl-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 2.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for secxbrl-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 143603b99c9d00ed9bbbe12c8f45bb351a94fb385d7b3d13ac34e4d55b3895c3
MD5 90173a654502202c81d5c13af7cdf30e
BLAKE2b-256 eb8c1c153ba34ab052292989107b2683d1d3d47ce10b040905718a5526d448da

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page