forked from quandyfactory/dicttoxml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
44 lines (36 loc) · 1.91 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
from distutils.core import setup
version = '1.3.1'
setup(
name = 'dicttoxml',
version = version,
description = 'Converts a Python dictionary or other native data type into a valid XML string. ',
long_description = """Supports item (`int`, `float`, `bool`, `str`, `unicode`, `datetime`, `none`) and collection (`list`, `set`, `tuple` and `dict`, as well as iterable and dict-like objects) data types with arbitrary nesting for the collections. Items with a `datetime` type are converted to ISO format strings. Items with a `none` type become empty XML elements.
The root object passed into the `dicttoxml` function can be any of the supported data types.
To satisfy XML syntax, the method wraps all the dict keys/elements and values in a `<root> ... </root>` element. However, this can be disabled to create XML snippets.
For lists of items, if each item is also a collection data type (`lists`, `dict`), the elements of that item are wrapped in a generic `<item> ... </item>` element.
Each elements includes a `type` attribute with the data type. Note: `datetime` data types are converted into ISO format strings, and `unicode` and `datetime` data types get a `str` attribute.
Python -> XML
integer int
float float
string str
unicode str
datetime str
None null
boolean bool
list list
set list
tuple list
dict dict
Elements with an unsupported data type raise a TypeError exception.
""",
author = 'Ryan McGreal',
author_email = '[email protected]',
license = 'GNU General Public Licence, Version 2',
url = 'https://github.com/quandyfactory/dicttoxml',
py_modules = ['dicttoxml'],
download_url = 'https://github.com/quandyfactory/dicttoxml/blob/master/dist/dicttoxml-%s.tar.gz?raw=true' % (version),
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 3'
],
)