Skip to main content

Convert python dictionary into a xml equivalent format

Project description

Convert python dictionary into a xml equivalent output

Usage of Pydicttoxml

d = {
  'student': {
      'name': 'Shera',
      'age': 25,
      'address': {
          'pin': 500082,
          'city': 'Hyderabad',
          'state': 'telangana',
          'country': 'India'
      }
   }
}

from pydicttoxml import dict2xml
xml = dict2xml(d, root_tag_name="data")

Output

<?xml version="1.0" encoding="UTF-8"?>
<data>
  <student>
    <name>Shera</name>
    <age>25</age>
    <address>
      <pin>500082</pin>
      <city>Hyderabad</city>
      <state>telangana</state>
      <country>India</country>
    </address>
  </student>
</data>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydicttoxml-1.0.1.tar.gz (2.6 kB view details)

Uploaded Source

File details

Details for the file pydicttoxml-1.0.1.tar.gz.

File metadata

  • Download URL: pydicttoxml-1.0.1.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pydicttoxml-1.0.1.tar.gz
Algorithm Hash digest
SHA256 cf9cf77ecaa43d2b8d78e3bc3b2001744b78823917dfbdac61a60278d2d9571f
MD5 9f2425020ca6f03f5ba640921890b309
BLAKE2b-256 71be4910ef5bd18700f5d0f34291b26a4e00df015dbc8092fa39e6fa469026a2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page