อ่าน XBRL ไฟล์ผ่าน Python
การอ่านรายงานทางการเงินในรูปแบบ XBRL โดยไม่ต้องติดตั้ง Microsoft Office หรือซอฟต์แวร์อื่นๆ
วิธีอ่าน XBRL Files
ทำตามขั้นตอนในข้อมูลโค้ดหรือปรับปรุงตามที่แอปพลิเคชันของคุณต้องการสำหรับการอ่านไฟล์ภาษาการรายงานทางธุรกิจที่ขยายได้ XBRL ตรวจสอบให้แน่ใจว่ามีข้อกำหนดในการอ่านในใบสมัครของคุณ
- สร้างอินสแตนซ์คลาส XbrlDocument1. ส่งชื่อไฟล์ XBRL ที่ถูกต้องเป็นพารามิเตอร์1. หากต้องการทราบรายละเอียดภายในของไฟล์ ให้ใช้คลาสที่เกี่ยวข้อง เช่น SchemaRefCollection, Context, Unit
ข้อกำหนดในการอ่าน
ในการดำเนินการอ่านเอกสาร XBRL ตรวจสอบให้แน่ใจว่าคุณมีข้อกำหนดเบื้องต้นดังต่อไปนี้
- ระบบปฏิบัติการที่ใช้ Microsoft Windows หรือ Linux- Python 3.5 หรือใหม่กว่า- Aspose.Finance สำหรับ Python ที่อ้างอิงในโครงการของคุณ
Python รหัสสำหรับอ่าน XBRL ไฟล์
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document = XbrlDocument(os.path.join(sourceDir, "IdScopeContextPeriodStartAfterEnd.xml")) | |
xbrlInstances = document.xbrl_instances | |
xbrlInstance = xbrlInstances[0] | |
facts = xbrlInstance.facts | |
schemaRefs = xbrlInstance.schema_refs | |
contexts = xbrlInstance.contexts | |
units = xbrlInstance.units |
ตัวเลือกการอ่านอื่นๆ
iXBRL (Inline Extensible Business Reporting Language)