Comments (3)
@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, doingunflatten(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.
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 asTrue False None null
recent i use way is : before loads usedata.replace("True",' "True" ')
, i met some some icant slove, wen thekey ,vlaue
also 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.
@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)
- Missing dependency on pyyaml HOT 3
- keyattr dynamic or AttributeError HOT 5
- INI support for case sensitive keys HOT 6
- `from_ini()` returns a `str` instead of a `dict` HOT 21
- Support defining how input data is loaded (filepath, url or data-string) HOT 3
- Assigning benedict element to itself clears the element HOT 2
- Minimalize dependencies and define scope HOT 1
- Move some requirements to a new `parse` extra requirement.
- Exception when comparing with Protocol classes HOT 7
- Yaml serializer produces inconsistent results HOT 5
- Add `from_html` method. HOT 2
- iterating benedict_dictionary.items(), value is not benedict_type HOT 2
- Union with assignment operator produces inconsistent results compared to `dict`. HOT 2
- README Index links don't work on PyPI, only GitHub's markdown renderer HOT 2
- Bug: Passing `data_only=True` into `from_xls()` returns excel formulas instead of cell data values HOT 5
- RecursionError while initializing from existing dict HOT 3
- Optionally allow `keypath_separator` in input dict keys (`unflatten`). HOT 6
- Benedict with Realtime Sync accross Processes HOT 7
- utility method clean does not work for nested dicts HOT 3
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 python-benedict.