From d36759cfcd125932dd0fb18536f5d8d3fb47f8e8 Mon Sep 17 00:00:00 2001 From: vinit kumar Date: Sun, 7 Jul 2013 03:55:19 +0530 Subject: [PATCH] adding the module with examples --- History.md | 5 +++ dist/json2xml-0.1-py2.7.egg | Bin 0 -> 1497 bytes docs/docs.md | 5 +++ examples/example.py | 35 ++++++++++++++++ json2xml.egg-info/PKG-INFO | 29 +++++++++++++ json2xml.egg-info/SOURCES.txt | 6 +++ json2xml.egg-info/dependency_links.txt | 1 + json2xml.egg-info/requires.txt | 1 + json2xml.egg-info/top_level.txt | 1 + json2xml/__init__.py | 1 + json2xml/__init__.pyc | Bin 0 -> 176 bytes json2xml/json2xml.py | 18 ++++++++ json2xml/json2xml.pyc | Bin 0 -> 1000 bytes readme.md | 19 +++++++++ setup.py | 55 +++++++++++++++++++++++++ 15 files changed, 176 insertions(+) create mode 100644 History.md create mode 100644 dist/json2xml-0.1-py2.7.egg create mode 100644 docs/docs.md create mode 100644 examples/example.py create mode 100644 json2xml.egg-info/PKG-INFO create mode 100644 json2xml.egg-info/SOURCES.txt create mode 100644 json2xml.egg-info/dependency_links.txt create mode 100644 json2xml.egg-info/requires.txt create mode 100644 json2xml.egg-info/top_level.txt create mode 100644 json2xml/__init__.py create mode 100644 json2xml/__init__.pyc create mode 100644 json2xml/json2xml.py create mode 100644 json2xml/json2xml.pyc diff --git a/History.md b/History.md new file mode 100644 index 0000000..d73eee0 --- /dev/null +++ b/History.md @@ -0,0 +1,5 @@ + +n.n.n / 2013-07-07 +================== + + * added gitignore, readme and setup.py diff --git a/dist/json2xml-0.1-py2.7.egg b/dist/json2xml-0.1-py2.7.egg new file mode 100644 index 0000000000000000000000000000000000000000..62b7ee99b07bf54b6b8453b3e27cab74c94e4358 GIT binary patch literal 1497 zcmWIWW@Zs#U|`^2@Rxq>^!bKuwj+=i1jJlG?BN+4;vW>Lmz(nV)MaKT)>>9&X6NKs z=3<4Q2b+#E#KdrMMR9d%YOd7edO1^d=F7^Tt}Cs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0 +1,18 @@ +#! /usr/bin/env python + +import simplejson, urllib, dict2xml +from BeautifulSoup import BeautifulStoneSoup + +class Json2xml(object): + + def __init__(self, url): + self.url = url + + def json2xml(self): + data = simplejson.load(urllib.urlopen(self.url)) + if data: + xmldata = dict2xml.dict2xml(data) + xml = BeautifulStoneSoup(xmldata) + return xml + + diff --git a/json2xml/json2xml.pyc b/json2xml/json2xml.pyc new file mode 100644 index 0000000000000000000000000000000000000000..49612f9565598c00031df3e88bf0d07255faf97d GIT binary patch literal 1000 zcmb_a!EV$r5FIDkr7ct-j&S9W6OlL~gsQ@c!=gIkKrU9Acts*7j@AwWX?rTaz`ylB z`T=y_bhkb9NTYc2V$Y1S@$ImKP4C6}bUMM)_5ngey%t%=92B4s@Qtqdw6QM510%OsG#mxzFfQ;k{r5iZ&+{7t}9+F_}Qi+1}Kr+&n-Asn=?$o~vg{`0RWg>%kf$I*l28J3Ic>LKr81&q>gKo~4Gfur6SO xWpbE`%Nn;^!$*C{A!6hE%gy&%Tolj!Ic|>hd0c8@$A?=3KH@-x;v4lMxdCmN(=h-5 literal 0 HcmV?d00001 diff --git a/readme.md b/readme.md index e69de29..e91d341 100644 --- a/readme.md +++ b/readme.md @@ -0,0 +1,19 @@ +##About + +This is a simple python module to conver json data to xml data. + + +### How to install + +``` +pip install json2xml +``` + +###How to use + +Check out the example given in examples directory. + + +###Bugs, features + +Create an issue in the repository diff --git a/setup.py b/setup.py index e69de29..5589fc6 100644 --- a/setup.py +++ b/setup.py @@ -0,0 +1,55 @@ +#! /usr/bin/env python + +import os +import sys + +try: + from setuptools import setup +except ImportError: + from distutils.core import setup + +import json2xml + + + +def publish(): + """Publish to PyPi""" + os.system("python setup.py sdist upload") + +if sys.argv[-1] == "publish": + publish() + sys.exit() + +required = ['dict2xml'] + +setup( + name='json2xml', + version=json2xml.__version__, + description='Python Command-line Application Tools', + long_description=open('README.md').read() + '\n\n' + + open('HISTORY.md').read(), + author='Vinit Kumar', + author_email='vinit.kumar@changer.nl', + url='https://github.com/vinitcool76/json2xml', + data_files=[ + 'README.md', + 'HISTORY.md', + ], + install_requires=required, + license='MIT', + classifiers=( +# 'Development Status :: 5 - Production/Stable', + 'Environment :: Console', + 'Intended Audience :: Developers', + 'Natural Language :: English', + 'License :: OSI Approved :: ISC License (ISCL)', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.1', + 'Programming Language :: Python :: 3.2', + 'Topic :: Terminals :: Terminal Emulators/X Terminals', + ), +)