Git Product home page Git Product logo

Comments (8)

vinitkumar avatar vinitkumar commented on June 1, 2024 2

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.

vinitkumar avatar vinitkumar commented on June 1, 2024 1

@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.

vinitkumar avatar vinitkumar commented on June 1, 2024

@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.

vinitkumar avatar vinitkumar commented on June 1, 2024

Any updates? @abgrac

from json2xml.

angelo-di-marzio avatar angelo-di-marzio commented on June 1, 2024

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.

vinitkumar avatar vinitkumar commented on June 1, 2024

@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.

vinitkumar avatar vinitkumar commented on June 1, 2024

@angelo-di-marzio Alright, I am able to reproduce the bug now.

from json2xml.

angelo-di-marzio avatar angelo-di-marzio commented on June 1, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.