Code Monkey home page Code Monkey logo

Comments (3)

fabiocaccamo avatar fabiocaccamo commented on June 12, 2024

@NOBB2333 thank you for this suggestion. I'm open to add support this feature if it matches all the requirements below:

  • this feature should be optional and backward-compatible, the idea thing is to support a new argument option for using it, eg. deep=True
  • list items should be flattened like mydict.mylist[0].mysublist[0] and so on ...
  • list items must not be concatenated by any separator, this seems to be really a personal/project-specific need.
  • the unflatten method must be updated too, doing unflatten(flatten(dict)) should return the initial dict.
  • add a couple of test cases to avoid regressions

Do you want to work on a Pull Request? That would be great!

from python-benedict.

NOBB2333 avatar NOBB2333 commented on June 12, 2024

I think your suggestion is very good,i still got some question:

  • deep=True is ok
  • mydict.mylist[0].mysublist[0] infact pandas using is this , why not use this because make data structured more difficult to use , ofcourse one of my request is use to export xlsx, it be very long and cant read;
  • i haven't understand this ,if use last require mydict.mylist[0].mysublist[0] ,quite is need't
  • unflatten has not make that yet, and recent i got some problem with parse, i want some help
  • test cases when all complect will add

abount send Problem clarification

why i choose using "\n" to connect the list objct ,infact is not connect ,just like i say, use mydict.mylist[0].mysublist[0] wen a list is too long is not good to use , my sloution is wen list is the lase level object , child object is pure dict object , the meaning they a the same ,example:
company have 50 employee, if use ing this , parse and using also will be easy, mydict.mylist[0].mysublist[0] willbe vety long , if not the lase level , won't use this connect ,

problem

i want get help

  • because i using json.loads i find some of them will parse by object, sunch as True False None null
    recent i use way is : before loads use data.replace("True",' "True" ') , i met some some icant slove, wen thekey ,vlauealso have a word contains the one of them , parse will be error , example :
    {"keu ":"the result is a True value"}
    have several day didin't slove, so when "\n".join( list ) always got error , xxxxobject can connect with str , i try to got some inspiration from here

after that, the may relly is Niche demand ,this is my project info:
the reason is this , when using other service , always return a json, this json is not fromat,
example with https://openapi.qcc.com/dataApi/213 a search company info website:
i add one list object in json_data['Result']['PartnerList']['KeyNo'] make it more real,
in the ___Json结果展开解析.txt-> dict json_data ChangeList got 4 result , but json_data['Result']['PartnerList']['KeyNo'] got 2 ,
if need save the data, save all json to DB, or parse again , so t use parse last level list to connect by "\n"

and so on, i'm enjoy with Pull Request ,

from python-benedict.

fabiocaccamo avatar fabiocaccamo commented on June 12, 2024

@NOBB2333 I'm sorry, but I can't understand well what you mean, could you try using Google Translate or a similar service please?

from python-benedict.

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.