Skip to main content

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 There is no external dependencies.

Release files for dum 0.4

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

Source distribution (sdist)

Source distribution for dum 0.4
File Size Uploaded
dum-0.4.tar.gz 20.2 kB Details

Release files / dum-0.4.tar.gz

Download URL dum-0.4.tar.gz
Size 20.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e6a3b0d08653471da0a5a5225dc2c38f89a4d2dd3bd0040f1d3fbe4c7e9a926e
BLAKE2b-256 checksum
How to use checksums
7796538fcc4623c12d4d5880dd055a1c9aea7694de08d34824b69bb722587132
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.4 This release

1 release file

0.3

1 release file

0.2

1 release file

0.1

1 release file

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