-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from ekaats/further-features
Further features
- Loading branch information
Showing
13 changed files
with
406 additions
and
264 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[metadata] | ||
name = xpyth_31_parser | ||
version = 0.0.7 | ||
name = xpyth_parser | ||
version = 0.0.9 | ||
author = Erwin Kaats | ||
author_email = [email protected] | ||
description = An XPath 3.1 Parser | ||
|
@@ -19,6 +19,7 @@ package_dir = | |
packages = find: | ||
python_requires = >=3.6 | ||
install_requires = | ||
lxml | ||
pyparsing | ||
isodate | ||
|
||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
def identifier(*args, **kwargs): | ||
""" | ||
Gets the identifier of one or more XBRL facts | ||
:param self: | ||
:return: | ||
""" | ||
# https://specifications.xbrl.org/registries/functions-registry-1.0/80132%20xfi.identifier/80132%20xfi.identifier%20function.html | ||
for arg in args[0]: | ||
context_ref = arg.get("contextRef") | ||
q = kwargs['query'] | ||
context = q.xpath(f"/xbrli:xbrl/xbrli:context[@id='{context_ref}']/xbrli:entity/xbrli:identifier", namespaces=q.nsmap) | ||
return context[0].text | ||
|
||
function_list = {"xfi:identifier": identifier} |
Oops, something went wrong.