Skip to content

Convert SGML text to dictionary.

License

Notifications You must be signed in to change notification settings

dhbmarcos/sgml2dict

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Convert SGML text to dictionary.

Resources

License

Stars

Watchers

Forks

Packages

No packages published