Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Reason given by maintainers: Deprecated & moved to FiJson

JsonDF [Json parser for DataFrane usage]

This package is a package for converting nested Json/Dictionaries/Lists for DataFrame usage

Download

for latest release

pip install JsonDF==1.0.3

Normal Usage

and to use it :

from JsonDf.Data import Data

data = Data(prefix="your_prefered_prefix_default_is_root", data=YourJson)

data.childs() #for processing the childs of the Json/Dict/List
print(data.rows) #organized dictionary with the data !! Not for DataFrame usage
data.flatten() #for flattening the result for DataFram usage
print(data.rows_flatten) #flatten the data for DataFrame usage

Json type usage

In Json type you have the ability to parse Json/Dict in the sameway it parsed in JQuery, in addition to the ability to make objects automatically from json/dict

create Json

to use it :

from Json.utils.Json import Json

some_json = {
  'keys' : {
    "another_key": "some_value",  
    },
}

json = Json(json=some_json, name=any_name)
json.objectify()
print(json)
print(json.keys)
print(json.keys.another_key)

insert and update values in Json

you can add values inside the Json as you want, use the insert method

json.insert(name='name', value='value')

keep in mind that you add in the base level, which mean that if you have two Jsons inside each other, and you want to add in the secod Json, you need to access it first to add in it. I'll try to fix this problem later.

NOTE : you can update values in Json by using the same insert method if the name is already exist.

delete values totally

you can totally delete keys and its values from the Json using the delete method, in this case the name and its value will be deleted

json = Json(name='json_name', json={'key': 'value'})
json.delete('key')
print(json')

#  output :
#  {}
#  empty because the 'key' key and it's values is deleted

you've to know that when you delete a key, it's deleted the Json object it self not from the original template it has started with, so if the edits was made in the json was new and was made by JsonDf, deleting it will delete it with no coming back.

dumping values from keys

you can dump values from keys and make the key equals to empty value depends on its type, by using the dump() method

json = Json(name='json_name', json={'key': 'value'})
json.dump('key')
print(json')

#  output :
#  {'key': ''}
#  empty because the 'key' key and it's values is deleted

the type of the value is determined with the same type that it was with in the Json Object, to change it you've to update it with the insert() method after the objectify() other wise it will still with the same type.

feel free to contribute in this project.

cheers.

Metadata

Release files for JsonDF 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for JsonDF 1.1.1
File Size Uploaded
jsondf-1.1.1.tar.gz 4.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for JsonDF 1.1.1
File Interpreter ABI Platform
jsondf-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.5 kB

Release files / jsondf-1.1.1.tar.gz

Download URL jsondf-1.1.1.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3f406ea7f94688107bbdb36e107d4994a34ecdec658e9dbc1af788882db3b0b3
BLAKE2b-256 checksum
How to use checksums
52f3922d06a5553f98a212fd0d5b2be1c998b5a52c73880c84bc2cc00c558df1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Release files / jsondf-1.1.1-py3-none-any.whl

Download URL jsondf-1.1.1-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c80f39afbfa49d3a7613593ac72aa34b909b7ed7489c7ee58393b8fa8b14a8c5
BLAKE2b-256 checksum
How to use checksums
60afcc8dfe671b1e44514cf77436add86dae4298a03966f874330111f30af3f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page