• Home
  • Most Popular
  • Submit
  • About Us
  • Contact Us

Softpile

Free Downloads

Categories
  • Home
  • Most Popular
  • Communications
  • Desktop
  • Games & Entertainment
  • Graphic Apps
  • Network & Internet
  • Security & Privacy
  • System Utilities
Alternative to itextsharp 2022.11.10347
IronPDF offers an itextsharp alternative for HTML to PDF conversion with C# code examples, documentation, and ...
VShell Server for Linux and Mac 4.8
VShell is a versatile and secure file transfer server that supports multiple protocols and is compatible ...
PDF Studio PDF Editor for Linux 2022
PDF Studio is a cost-effective PDF editor that delivers full compatibility with the PDF Standard. It's ...
VQ Probe for Linux 1.5
VQ Probe is a comprehensive software tool that enables objective and subjective video quality analysis. The ...
Resilient Server 2.3
This Debian GNU/Linux (Buster) based software has a customized partitioning scheme that enhances robustness against filesystem ...
Valentina Studio for Linux 9.6
Valentina Studio is a cross-platform GUI manager for Mac, Windows, and Linux. It allows users to ...
VPN Lifeguard for Linux 1.0.58
The software monitors VPN connection and automatically terminates apps during connection loss, re-establishes the connection and ...
G_Viewer 0.84
G_Viewer is a Linux software that serves as both a file system and photo/image viewer. It ...
Checksome File Hash Tool for Linux 1.1
This software allows for the generation and verification of file hashes. It is a quick and ...
KeyWrangler Password Manager for Linux 1.2
A password management software that is secure, offline and extensible. It offers military-grade encryption to protect ...
Home Linux dexml Download

dexml

November 11, 2009
Python software that maps objects to XML is incredibly easy to use.
Version 0.2.0
License BSD License
Platform Linux
Supported Languages English
Homepage pyenchant.sourceforge.net
Developed by Ryan Kelly
Dexml is a fantastic Object-XML mapping software for Python. In today’s world, XML is an essential part of our modern life, and it is good at what it does. However, XML is not user-friendly and can be difficult to work with. Most of the time, XML just gets in the way and prevents you from getting actual work done. Dexml solves this problem by mapping between XML tags and Python objects as cleanly as possible.

Inspired by Django’s ORM, with dexml, you write straightforward class definitions that define the expected structure of your XML document. This software takes the obvious mapping between XML tags and Python objects and captures it in an easy-to-understand manner.

With Dexml, you can parse an XML document into an object easily. For instance, if you have a Person class, you could easily parse an XML document into this object as shown below:

>>> import dexml
>>> from dexml import fields
>>> class Person(dexml.Model):
... name = fields.String()
... age = fields.Integer(tagname='age')
>>> p = Person.parse("< Person name='Foo McBar' >< age >42< /age >< /Person >")
>>> p.name
u'Foo McBar'
>>> p.age
42

You can also convert an object into an XML document. Here's an example:

>>> p = Person(name="Handsome B. Wonderful",age=36)
>>> p.render()
'< ?xml version="1.0" ? >< Person name="Handsome B. Wonderful" >< age >36< /age >< /Person >'

Dexml comes with error handling abilities. For example, if you try to parse a malformed document, it will raise a ParseError. Here's an example:

>>> p = Person.parse("< Person >< age >92< /age >< /Person >")
>>> Traceback (most recent call last):
... ParseError: required field not found: 'name'

You can also nest Model definitions, making it more interesting. Here's an example of how to define a Group class that nests the Person model:

>>> class Group(dexml.Model):
... name = fields.String(attrname="name")
... members = fields.List(Person)
...
>>> g = Group(name="Monty Python")
>>> g.members.append(Person(name="John Cleese",age=69))
>>> g.members.append(Person(name="Terry Jones",age=67))
>>> g.render(fragment=True)
'< Group name="Monty Python" >< Person name="John Cleese" >< age >69< /Person >< Person name="Terry Jones" >< age >67< /age >< /Person>< /Group >'

Lastly, Dexml also has support for XML namespaces, default field values, case-insensitive parsing as well as many other fantastic features. For more details on the classes, check out the documentation on the following classes:

- Model – the base class for objects that map into XML
- Field – the base class for individual model fields
- Meta – meta-information about how to parse/render a model.
What's New

Version 0.2.0: N/A

Free Download 12K
374
  • Share on:

Most Popular

  1. Quicksilver Forums 1.4.2
    154
  2. Dvgrab 3.4
    102
  3. DynVPN 1.0
    89
  4. CherryTV 0.1
    81
  5. SlideMap 1.2.2
    80
  6. porm r2
    73
  7. Clewarecontrol 0.8
    72
  8. Java Games 1.0
    72
  9. Swiftfox 3.0b5pre-2
    71
  10. fuseftp 0.8
    71

Related Downloads

FantasyBetting
This software enables website owners to incorporate the excitement of gambling without ...
fileq
Fileq is a software that automatically moves files from a folder to ...
DarkRoomCompact
DarkRoom theme by Wimer and O'Griofa, now in a compact version.
h3oPass 4 Clipperz CE
h3oPass is a password management software available as an eyeOS app. It ...
django-dojoserializer
Django-dojoserializer is a plugin that enables the serialization of Django model instances ...
MySQL Savior
MySQL Savior is a time-saving script that automates MySQL database backups through ...
Grayscale PHP Firewall
Grayscale PHP Firewall is an access control software that can be used ...
GtkSort
GtkSort is a program that sorts text and binary files on disk ...
pyshaper
Pyshaper is an adaptable bandwidth manager for Linux with a straightforward interface, ...
MurrinaLightGraphite
Murrina Light Graphite is a software theme that provides a sleek and ...
Copyright © 1999-2025 Softpile Free Downloads
  • Most Popular
  • Submit
  • About Us
  • Contact Us
  • Privacy Policy
  • Disclaimer
  • Terms of Use

Can we use your data to tailor ads for you?

Our partners will collect data and use cookies for ad personalization and measurement.

By choosing "I agree", closing this pop-up or clicking on any element on the page, you agree to the use of cookies to help us provide you with a better user experience.

Learn how Softpile and our partners collect and use data.

You can change your choice at any time in our privacy center.

Cookie Settings

Our website stores four types of cookies. At any time you can choose which cookies you accept and which you refuse. You can read more about what cookies are and what types of cookies we store in our Cookie Policy.

are necessary for technical reasons. Without them, this website may not function properly.

are necessary for specific functionality on the website. Without them, some features may be disabled.

allow us to analyse website use and to improve the visitor's experience.

allow us to personalise your experience and to send you relevant content and offers, on this website and other websites.