Skip to main content

xml2dictionary

xml2dictionary is a package that converts any xml to json (dict)

Requirements

  1. Python 3.8
  2. Pipenv

Installation

pip install xml2dictionary

Usage

Example

from xml2dictionary import xml2dictionary
with open('tests/sample.xml', 'r') as f:
    m = f.read()

result = xml2dictionary(m)

OrderedDict([('breakfast_menu', OrderedDict([('food', [OrderedDict([('name', 'Belgian Waffles'), ('price', '$5.95'), ('description', 'Two of our famous Belgian Waffles with plenty of real maple syrup'), ('calories', '650')]), OrderedDict([('name', 'Strawberry Belgian Waffles'), ('price', '$7.95'), ('description', 'Light Belgian waffles covered with strawberries and whipped cream'), ('calories', '900')]), OrderedDict([('name', 'Berry-Berry Belgian Waffles'), ('price', '$8.95'), ('description', 'Light Belgian waffles covered with an assortment of fresh berries and whipped cream'), ('calories', '900')]), OrderedDict([('name', 'French Toast'), ('price', '$4.50'), ('description', 'Thick slices made from our homemade sourdough bread'), ('calories', '600')]), OrderedDict([('name', 'Homestyle Breakfast'), ('price', '$6.95'), ('description', 'Two eggs, bacon or sausage, toast, and our ever-popular hash browns'), ('calories', '950')])])]))])

Functions

parse - parses xml string to dictionary
clear_signs - clears parsed xml from props with `sign` , shifts `shift` , escapes `scape`
json_to_xml - converts json to xml
xml2json - uses parse & clear_signs

Metadata

Release files for xml2dictionary 0.0.2

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

Source distribution (sdist)

Source distribution for xml2dictionary 0.0.2
File Size Uploaded Provenance Actions
xml2dictionary-0.0.2.tar.gz 4.7 kB Without provenance Details for xml2dictionary-0.0.2.tar.gz

Built distribution (wheel)

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

Total release size: 7.5 kB

Release files / xml2dictionary-0.0.2.tar.gz

Download URL xml2dictionary-0.0.2.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a166d9b2410e50d7fde792ac5ae36b18570c7e6e681abd1b9579ef2825cbbbb5
BLAKE2b-256 checksum
How to use checksums
a7795e00583bafe2e5965857b9316060b9369677107b6e7b8a6038d5e5ef1301
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

Release files / xml2dictionary-0.0.2-py3-none-any.whl

Download URL xml2dictionary-0.0.2-py3-none-any.whl
Size 2.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9c45bf80235a4de3ff375aba862beaf9ec4961ce03ff684b1cfb0cbd6782a11e
BLAKE2b-256 checksum
How to use checksums
6cd4b0dc7db1e50281823f7be9294b5bf15d76c594a6062cf929ec5c4c12d402
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

Security for xml2dictionary 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

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