Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
vinit kumar
committed
Jul 6, 2013
1 parent
d815ca1
commit d36759c
Showing
15 changed files
with
176 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
n.n.n / 2013-07-07 | ||
================== | ||
|
||
* added gitignore, readme and setup.py |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#Docs | ||
|
||
Docs will be updated as this module goes further development.The current form | ||
is pretty self explanatory. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#! /usr/bin/env python | ||
|
||
BASE_URL = 'http://maps.googleapis.com/maps/api/geocode/json' | ||
|
||
import sys | ||
import os | ||
import urllib | ||
|
||
|
||
sys.path.insert(0, os.path.abspath('..')) | ||
|
||
from json2xml import json2xml | ||
|
||
|
||
def geocode(address, sensor, **geo_args): | ||
geo_args.update({ | ||
'address': address, | ||
'sensor': sensor | ||
}) | ||
|
||
|
||
def main(): | ||
geocode(address="pune", sensor="false") | ||
geo_args = {'sensor': 'false', 'address': 'pune'} | ||
url = BASE_URL + '?' + urllib.urlencode(geo_args) | ||
data = json2xml.Json2xml(url) | ||
print data.json2xml() | ||
|
||
|
||
if __name__ == "__main__": | ||
main() | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Metadata-Version: 1.1 | ||
Name: json2xml | ||
Version: 0.1 | ||
Summary: Python Command-line Application Tools | ||
Home-page: https://github.com/vinitcool76/json2xml | ||
Author: Vinit Kumar | ||
Author-email: vinit.kumar@changer.nl | ||
License: MIT | ||
Description: | ||
|
||
|
||
n.n.n / 2013-07-07 | ||
================== | ||
|
||
* added gitignore, readme and setup.py | ||
|
||
Platform: UNKNOWN | ||
Classifier: Environment :: Console | ||
Classifier: Intended Audience :: Developers | ||
Classifier: Natural Language :: English | ||
Classifier: License :: OSI Approved :: ISC License (ISCL) | ||
Classifier: Programming Language :: Python | ||
Classifier: Programming Language :: Python :: 2 | ||
Classifier: Programming Language :: Python :: 2.6 | ||
Classifier: Programming Language :: Python :: 2.7 | ||
Classifier: Programming Language :: Python :: 3 | ||
Classifier: Programming Language :: Python :: 3.1 | ||
Classifier: Programming Language :: Python :: 3.2 | ||
Classifier: Topic :: Terminals :: Terminal Emulators/X Terminals |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
setup.py | ||
json2xml.egg-info/PKG-INFO | ||
json2xml.egg-info/SOURCES.txt | ||
json2xml.egg-info/dependency_links.txt | ||
json2xml.egg-info/requires.txt | ||
json2xml.egg-info/top_level.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dict2xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__version__ = 0.1 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,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 | ||
|
||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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', | ||
), | ||
) |