Convert SGML text to dictionary.
Project description
sgml2dict
Convert SGML text to dictionary.
API
Initiate
import sgml2dict
convert(text)
parameter
- text: SGML text
return: dict
import sgml2dict
result = sgml2dict.convert("<hello world/></hello>")
Example
import json
import sgml2dict
text = "<hello world/></hello>"
data = sgml2dict.convert(text)
print("Dictionary view:", data)
print("JSON view:", json.dumps(data))
Return:
Dictionary view: {'name': 'hello', 'attributes': {'world': True}}
JSON view: {"name": "hello", "attributes": {"world": true}}
Support
https://gitlab.com/dhbmarcos/sgml2dict
License
- MIT License
- Copyright (c) 2023 D. H. B. Marcos. All rights reserved.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sgml2dict-0.0.5.tar.gz
(3.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sgml2dict-0.0.5.tar.gz.
File metadata
- Download URL: sgml2dict-0.0.5.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af9b42e5c1b9f0a163cdf1a12196fe3e483b93319a45a16624cef2d9d9373bf6
|
|
| MD5 |
5f2db81278a1febd42a8d6e668341aff
|
|
| BLAKE2b-256 |
0990aed9bb713e0fe1208dce9dec8d7b958bb192b58b264fbfe871af44f0e3e6
|
File details
Details for the file sgml2dict-0.0.5-py3-none-any.whl.
File metadata
- Download URL: sgml2dict-0.0.5-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fac1d06eb8f860be0f860d98dc3a24aebc3ace5d0e940dcead0d7df95b1f8c05
|
|
| MD5 |
798a5c50abb882a7380c6ac14ceefc04
|
|
| BLAKE2b-256 |
f5ba8440ab74e5827fcba1609b0c70bfec09f023010fabfd9c2f60d2b9797792
|