Skip to content

Instantly share code, notes, and snippets.

View jamesjarvis's full-sized avatar
✈️
Dreaming of the next flight...

James Jarvis jamesjarvis

✈️
Dreaming of the next flight...
View GitHub Profile
@jamesjarvis
jamesjarvis / keybase.md
Last active January 9, 2019 02:05
My public Keybase proof

Keybase proof

I hereby claim:

  • I am jamesjarvis on github.
  • I am jamesjarvis (https://keybase.io/jamesjarvis) on keybase.
  • I have a public key ASAnjvwPPwFWiQc1tF2eAHqjxfhOpB3ndzBk94iYk__DLAo

To claim this, I am signing this object:

@jamesjarvis
jamesjarvis / dict2xml.py
Last active October 30, 2018 01:12
Python Dictionary or JSON to XML converter.
def dict_to_xml(v, passed_tag=None) -> str:
'''Converts a python dictionary into xml output'''
open_tag = lambda tag: '<' + tag + '>'
close_tag = lambda tag: '</' + tag + '>'
create_tag = lambda key,v: open_tag(key) + str(v) + close_tag(key)
xml = ""
if type(v) is dict:
for key,vl in v.items():
if type(vl) is list: