Skip to main content

A JSON helper for Python

Project description

Jthon

This is a utility to make working with JSON files easier.

Installation

pip install jthon

Usage

import jthon
file = jthon.load('test_file')
urls = file.find('url', limit=2)
print(f"Number of results limited to [{len(urls)}]: {', '.join(str(url) for url in urls)}")
title = file.get('data').get('children')[1].get('data').get('title')
print(title)
file['data']['dist'] = 25
file.save(sort_keys=None)

More examples can be found in the examples folder

Requirements

python3 >

Authors

License

This project is licensed under MIT - see the LICENSE file for details

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for jthon, version 1.0.1a0
Filename, size File type Python version Upload date Hashes
Filename, size jthon-1.0.1a0-py3-none-any.whl (5.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size jthon-1.0.1a0.tar.gz (19.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page