Skip to main content

Bug in dum.xml

Project description

With the dum module you can easily map data from structured files to a set of python classes. The current version can be used with json, csv or xlm formats, more are expected to come.

Parsing and projecting

The main idea is that your code is designed with objects that share more or less the same organization than the data in the original file. With a few directives, it must then be possible to directly project the data parsed from the file to the class model of your application.

For sample a minimal (all the display methods are still to write…) Atom application could look like

class Author:
    class dum:
        name =""
        email=""

class Link:
    class dum:
        rel=""
        href=""

class Entry:
    class dum:
        title = ""
        author = [Author]
        link = [Link]
        updated = dateutil.parser.parse

class Atom:
    class dum:
        title =""
        subtitle= ""
        entry = [Entry]
        link = [Link]
        updated = dateutil.parser.parse

atom = dum.xml(Atom, open("myrss"))

Requirements

The library has been tested for Python 3.4 but should work with any Python 3 version. There is no external dependencies.

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

dum-0.2.tar.gz (16.6 kB view details)

Uploaded Source

File details

Details for the file dum-0.2.tar.gz.

File metadata

  • Download URL: dum-0.2.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dum-0.2.tar.gz
Algorithm Hash digest
SHA256 3cdee3419ac1a29c02e2478842478a0a551f0d2fe79da50f413fbfe5194f2f71
MD5 0e64587fc1e82fe564db60507e1e0907
BLAKE2b-256 cd92d510be3b28cc459065f15b5b4f183262244fde8ab68d578675a409ff5bd9

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