Grobid2Json
Extract the code to parse grobid xml into json from the s2orc-doc2json project and package it as a pypi package.
✨ Features
- Process the XML files parsed by Grobid into JSON format.
📦 Installation
pip install grobid2json
🤯 Usage
from bs4 import BeautifulSoup
from grobid2json import convert_xml_to_json
file_path = "test.xml"
with open(file_path, "rb") as f:
xml_data = f.read()
soup = BeautifulSoup(xml_data, "xml")
paper_id = file_path.split("/")[-1].split(".")[0]
paper = convert_xml_to_json(soup, paper_id, "")
json_data = paper.as_json()
print(json_data)
🔗 Links
Credits
- s2orc-doc2json - https://github.com/allenai/s2orc-doc2json
📝 License
This project is Apache License 2.0 licensed.
Metadata
Release files for grobid2json 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| grobid2json-0.0.1.tar.gz | 17.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| grobid2json-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.4 kB
Release files / grobid2json-0.0.1.tar.gz
| Download URL | grobid2json-0.0.1.tar.gz |
|---|---|
| Size | 17.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
792395dcc5b082f863e2f6963eac9ad1b82d2b242c00d294cb830d6f97dae4d4
|
|
BLAKE2b-256 checksum How to use checksums |
ebc4231af5f5a85571b0f1bdadf1669c03459bade846f955528acc295095fe50
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.18
|
Release files / grobid2json-0.0.1-py3-none-any.whl
| Download URL | grobid2json-0.0.1-py3-none-any.whl |
|---|---|
| Size | 17.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b7d22662676ec5d96b2ae0d342db524b42bd871bca3198b71e538af90e1c9690
|
|
BLAKE2b-256 checksum How to use checksums |
5dcb76e62203e00694819fc961e23e826e58c175ada9432586da7fb1b02f2ef0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.18
|