Skip to main content

xdwarf

Mining XML to tabular data, FAAAAAAST

PyPI version Python version License PyPI Downloads

Install

pip install xdwarf

The library is an wrapping on rust_dwarf, a rust based mining tool.

Mining

# finding in glob pattern, project name, use all - 2 CPUs
dwarf = Dwarf.from_glob("../test/data/*.xml", "PMC",-2)

Define the mining detail as xpath query pattern, chaining multistage mining is well supported.

dwarf.find_one('article-meta > article-id[pub-id-type=pmid]' , "pmid")
dwarf.find_one("abstract", "abstract").find_many("p", "paragraph")

# mining stage can be chained to longer detials
reference = dwarf.find_one("ref-list", "ref_list").find_many("ref","reference")
reference.find_one("pub-id[pub-id-type=pmid]", "ref_id")
reference.find_one("pub-id[pub-id-type=doi]", "doi")
ref_name = reference.find_many("name", "ref_name")
ref_name.find_one("surname", "ref_surname")
dwarf.set_necessary("pmid")
dwarf.create_children()

Mining start

result = dwarf()

See result

result.child_df().head(2)

See child result

result['ref_list'].child_df().head()

Metadata

Release files for xdwarf 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xdwarf 0.1.0
File Size Uploaded
xdwarf-0.1.0.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xdwarf 0.1.0
File Interpreter ABI Platform
xdwarf-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.9 kB

Release files / xdwarf-0.1.0.tar.gz

Download URL xdwarf-0.1.0.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
fa640061be87bba9e3fde8270b2ef266927ee0f1d437177834b2efc5822a9818
BLAKE2b-256 checksum
How to use checksums
83738f2519f6e77c4b01cc1b6f68bd39102896359468d93ea687873c0486f8ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.4

Release files / xdwarf-0.1.0-py3-none-any.whl

Download URL xdwarf-0.1.0-py3-none-any.whl
Size 16.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff133af7e271f6ff9b188d2bbbc77604997338ff0fe036ebbe807de6addf0f44
BLAKE2b-256 checksum
How to use checksums
b096af1021f53c9c75906264ffcbed2b44e94082f61651c71184d14ffc1636e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.4

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page