Comments (8)
Hi @abgrac & @angelo-di-marzio
Thanks for reporting this bug. The bug wasn't in the code but in the pypi released code that was outdated and didn't had the wrapper
in the constructor.
Well, I have a good news. I did a major refactor & cleaned up the code. This is also a breaking change and you will need to update the code sample using this library. Please look at the readme https://github.com/vinitkumar/json2xml#usage or at the docs
https://json2xml.readthedocs.io/
If you follow the readme/docs, everything should just work.
In order to upgrade run this:
pip install --upgrade json2xml
Or to install the latest version
pip install json2xml==3.0.0
from json2xml.
@abgrac @angelo-di-marzio Closing this as the issue is fixed. Please update the plugin and follow the docs and it should just work for you.
from json2xml.
@abgrac Thanks for reporting the bug.
Well, if you look at the example in the readme. use wrapper and indent
You can look at how to use wrapper and indent with the Json2xml. I do not have a windows so haven't tested it out on windows but it should in theory just work like anything else. There is nothing special thing done in this code.
The implementation is right there in the code itself. https://github.com/vinitkumar/json2xml/blob/master/src/json2xml.py#L88
Also, could you please report couple of things:
- version of json2xml?
from json2xml.
Any updates? @abgrac
from json2xml.
Hello, I have the same issue. TypeError: init() got an unexpected keyword argument 'wrapper'
I can't manage to make it work. I've followed your instructions on use wrapper and indent
I'm using json2xml version 2.2.1 on Debian
I'm here if you need more informations
from json2xml.
@angelo-di-marzio Could you please share these things:
- Python Version
- Full crash log?
- How can I reproduce the bug? Share the code that you used?
- Did you install the json2xml from
pip
or did you clone the repo?
from json2xml.
@angelo-di-marzio Alright, I am able to reproduce the bug now.
from json2xml.
I installed it from pip. I'm using Python 3.7.
The full log is "TypeError: init() got an unexpected keyword argument 'wrapper'"
Here is the code :
`
annotation_list = version["annotation_list"]
data = Json2xml.fromstring(json.dumps(annotation_list)).data
data_object = Json2xml(data, wrapper="custom", indent=4)
annotations_xml=data_object.json2xml()
file = open(path, "w+")
file.write(annotations_xml)
file.close()
return file
`
from json2xml.
Related Issues (20)
- dicttoxml adds 'b...' HOT 4
- setting the xmlns value HOT 6
- setting xsi location HOT 3
- Logging should be disabled by default HOT 4
- Convert a dict with list to json without <list> elements HOT 1
- Wrap list items in their parent element HOT 1
- Ampersand not parsed correctly when attrs are present HOT 1
- List items as tags with arguments HOT 9
- Crash in one test when switching to pytest HOT 1
- dicttoxml: recursive array broken since json2xml 3.19.0 HOT 1
- some unit tests do not fail in test_dict2xml.py but should
- Security issues reported by dlint
- Lower requirements constraints HOT 6
- List items with attributes HOT 10
- not well-formed (invalid token) with custom attrs if attr value has a " character HOT 3
- Movie online database compatibility HOT 1
- validated json fails conversion HOT 4
- @attrs keyword does not work at the root level HOT 1
- Preserve certain text from being escaped HOT 2
- Deprecate setup.py and move to standard based tools
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from json2xml.