Skip to content
首页 » 博客 » 在 Python 中将 XBRL 转换为 Excel

在 Python 中将 XBRL 转换为 Excel

  • by
  • Uncategorized

在财务数据领域,可扩展商业报告语言 (XBRL) 已成为数字报告的黄金标准。公司、监管机构和投资者使用 XBRL 来简化关键财务信息的共享和分析。在某些情况下,我们可能需要将 XBRL 转换为更易于访问的格式,例如 Excel。在这篇博文中,我们将学习如何在 Python 中将 XBRL 转换为 Excel。让我们开始吧!本文涵盖以下主题:Python XBRL 到 Excel 转换器在 Python 中将 XBRL 转换为 Excel 获取免费许可证XBRL 到 Excel 在线转换器 Excel 中的 XBRL 格式 – 学习资源Python XBRL 到 Excel 转换器#为了将 XBRL 转换为 Excel,我们将使用 Aspose.Finance for Python 库。它允许创建 XBRL 实例、解析、验证和转换 XBRL 或 iXBRL 文件。请在控制台中使用以下 pip 命令下载软件包或从 PyPI 安装 API:pip install aspose-finance
copyConvert XBRL to Excel in Python#使用 Finance Python 库将 XBRL 转换为 Excel 非常简单。只需加载 XBRL 文件并将其以 XLSX 格式保存在所需位置即可。请按照以下步骤在 Python 中将 XBRL 转换为 Excel。使用 XbrlDocument 类加载 XBRL 文件。创建 SaveOptions 类的实例并将 SaveFormat 设置为 XLSX。调用 save() 方法将文档保存为 Excel 格式。以下代码示例显示如何在 Python 中将 XBRL 转换为 Excel。将 XBRL 转换为 Excel – 获取免费许可证#您可以获得免费的临时许可证来使用 Aspose.Finance 库。您可以不受任何限制地评估和探索其功能。XBRL 到 Excel 在线转换器#您可以使用我们使用 Aspose.Finance 开发的高质量且免费的 XBRL 到 Excel 转换器在线将 Excel 中的 XBRL 文件转换库.*,*::之前,*::之后{box-sizing:border-box}h1,h2,h3,h4,h5,p{margin-bottom:.8em;margin-top:.8em}li{margin-bottom:.8em}a{}a:hover{}.panelContainer{width:150%}.csColor{background:#5d8000}.parametersblock h3,.parametersblock .h3{background:silver;font-size:13px;font-weight:700;padding:10px;border-radius:10px 10px 0 0;margin:0}@media screen 和 (max-width:768px){.parametersblock h3,.parametersblock .h3{text-align:center}}.parametersBox{颜色:#f8f8f2!important;background-color:#2b2b2b!important}.parametersBox #fileInput{字体大小:0;宽度:1px;高度:1px}.parametersBox .description{text-align:left;margin:auto;padding:10px 10px 10px 20px;box-sizing:border-box}.parametersBox .description span.position{display:inline-block;margin-left:25px}.parametersBox .action{text-align:right;margin:auto;padding:10px 20px 10px 10px}.parametersBox .action.output-format{padding-left:5px}.row{–bs-gutter-x:1.5rem;–bs-gutter-y:0;display:flex;flex-wrap:wrap;margin-top :calc(var(–bs-gutter-y)*-1);右边距:calc(var(–bs-gutter-x)*-.5);左边距:calc(var(–bs-gutter-x)*-.5)}.col-4{ flex:none;width:25%;padding-left:10px!important}.pt-3{padding-top:1rem!important;margin-left:0;margin-right:0}.pb-3{padding-bottom:1rem!important;margin-left:0;margin-right:0}.fileInput{opacity:0;position:absolute;z-index:-1}.parametersBox #fileInput{font-size:0;width:1px;height:1px}.actionButton{height:45px;width:150px;background:#8fd14f;color:#fff;padding:10px 15px;font-size:16px;font-weight:400;outline:0!important;border:1pxsolid #5c5c5c!重要;显示:内联块;边距底部:0;文本对齐:中心;空白:nowrap;垂直对齐:中间;触摸操作:操作;光标:指针;行高:1.42857143;用户选择:无;文本装饰:无;过渡:不透明度 .2s easy-in}.actionButton:hover{opacity:.8;text-decoration:none;color:#fff}.backgroundBlue{background:#2d9bf0}label.fileInputLabel{word-break:break-word;height:initial;white-space:initial}.disabled{pointer-ev ents:none;cursor:default;opacity:.6}select:disabled{opacity:1}button:not(:disabled),[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled){cursor:pointer}a#runCodeButtonMobil e.actionButton.disabled,a#runCodeButton.actionButton.disabled{opacity:.9;background-color:#5e7e3e}.codeBox{color:#f8f8f2!important;background-color:#2b2b2b!important;margin-bottom:0!important;padding-left: 15px;行高:初始}pre,代码,kbd,samp{font-family:var(–bs-font-monospace);方向:ltr;unicode-bidi:bidi-override}pre{显示:块;margin-top:0;margin-bottom:1rem;溢出:auto;font-size:.875em}pre代码{font-size:inherit;color:inherit;word-break:normal}@media屏幕和(max-width:768px){.codeBox{padding-left:0}}.rowLine{border-top:1pxsolid银色}.only-in-mobile-block,.only-in-mobile-flex,.only-in-small-desktop-block,.only-in-small-desktop-flex{display:none}.clipboard{float:right;touch-a操作:操作;光标:指针}.leftboard{float:left;触摸操作:操作;光标:指针}.clipboard:hover{颜色:#468c02;填充:#468c02}.clipboard .bi-clipboard{width:20px;height:20px}.clipboard a{position:relative;user-select:none;text-decoration:none;color:#0f0f0f;touch-action:manipulation;cursor:pointer;font-weight:700}.clipboard a:hover{color:#468c02}@media 屏幕和(max-width:768px){.clipboard{float:none}}@媒体屏幕和 (max-width:992px){.only-in-small-desktop-block{display:block}.hide-in-small-desktop-block{display:none}.only-in-small-desktop-flex{display:flex}.hide-in-small-desktop-flex{display:none}}@media 屏幕和(max-width:768px){.only-in-mobile-block{display:block}.hide-in-mobile-block{display:none}.only-in-mobile-flex{display:flex}.hide-in-mobile-flex{display:none}.langbox{min-width:50%}}@media 屏幕和 (max-width:768px){.codeblock h3,.codeblock .h3{text-align:center;line-height:0}}@媒体屏幕和 (max-width:768px){.only-in-mobile-block{display:block}.hide-in-mobile-block{display:none}.only-in-mobile-flex{display:flex}.hide-in-mobile-flex{display:none}.langbox{min-width:50%}}@媒体屏幕和(max-width:992px){.panelContainer{width:95%;margin-left:auto;margin-right:auto}}@media screen 和 (max-width:768px){.panelContainer{width:100%;margin-left:auto;margin-right:auto}}function updateFilename(){var e=document.getElementById(“fileInput”);e.files.length>0&&(document.getElementById(“showInputFileName”).innerText=e.files[0].name,document.getElementById(“inputFilename”).innerText='”‘+e.fil es[0].name+'”‘,document.getElementById(“outputFilename”).innerText='”‘+e.files[0].name.split(“.”).slice(0,-1).join(“.”)+”.”+document.getElementById(“selectOutputFormat”).value+'”‘)}函数copyCode(){var n,t=document.getElementById(“snippet”);if(navigator.clipboard&&window.isSecureContext)return navigator.clipboard.writeText(t.innerText);let e=document.createElement(“textarea”);e.value=t.innerText,e.style.position=”absolute”,e.style.opacity=0,e.style.left=”-999999px”,e.style.top=”-999999px”,document.body.appendChild(e),e.focus(),e.select();try{let t=document.execCommand(“copy”);e.remove()}catch{document.removeChild(“textarea”)}n=document.getElementById(“appui”),n.scrollIntoView()}函数changeOutputFileInSnippet(e){var t=document.getElementById(“fileInput”);t.files.length>0?document.getElementById(“outputFilename”).innerText='”‘+t.files[0].n ame.split(“.”).slice(0,-1).join(“.”)+”.”+e+'”‘:document.getElementById(“outputFilename”).innerText='”输出.’+e+'”‘}函数runCode(){var e,n,s,o,t=document.getElementById(“fileInput”);t.files.length>0&&(n=new FormData,n.append(t.files[0].name,t.files[0]),e=new XMLHttpRequest,s=document.getElementById(“selectOutputFormat”).value,o=”https://api.products.aspose.app/cells/conversion/api/ConversionApi/Convert?outputType=”+s,e.open(“POST”,o,!0),e.onreadystatechange=function(){if(this.readyState==4&&this.status==200){var e=JSON.parse(this.responseText);href_url=”https://api.products.aspose.app/cells/conversion/api/Download/”+e.FolderName+”?file=”+e.FileName,documen t.getElementById(“runstatus”).style.display=”none”,window.location=href_url}},document.getElementById(“runstatus”).style.display=””,e.send(n))}免费XBRL 到 Excel 在线转换器输入文件
上传文件转换输出格式XLSXConvert|||  函数 loadOutFormatsSelect(){var e,n,o,t=”xlsx”.split(“;”),i=t.length,s=document.getElementById(“selectOutputFormat”);if(i>0){s.options.length=0;for(e=0;e<i;e++)n=document.createElement("option"),n.value=t[e],n.text=t [e].toUpperCase(),s.add(n)}o="xlsx",s.selectedIndex=t.indexOf(o),changeOutputFileInSnippet(o),document.getElementById("inputFilename").innerText='"input.xml"'}loadOutFormatsSelect()XBRL Excel 中的格式 – 学习资源#您可以了解有关创建 XBRL 文件并将其转换为支持的格式(如 Excel、PDF、HTML)的更多信息,并使用下面给出的资源探索该库的其他功能:Aspose.Finance 开发人员指南免费在线应用程序API 参考操作指南和文章结论#在本文中,我们学习了如何在 Python 中将 XBRL 转换为 Excel。将财务数据从 XBRL 文件导出到 Excel 是充分利用这一数据宝库的有效方法。分步指南和代码示例演示了使用我们的 Python 库执行 XBRL 到 XLSX 转换是多么容易。如有任何疑问,请在我们的免费支持论坛上联系我们。另请参阅#使用 Python 创建 XBRL 文件在 Python 中读取 XBRL 文件在 Python 中验证 XBRL 文档在 Python 中解析 XBRL

Leave a Reply

Your email address will not be published. Required fields are marked *