Skip to main content

Christopher H. Todd's Python Library For Interacting With JSON Objects and Files

The ctodd-python-lib-json project is responsible for writing and reading JSON files and objects. will handle encoding Python objects into JSON.

Table of Contents

Dependencies

Python Packages

  • simplejson>=3.16.0

Libraries

json_reading_helpers.py

This library is used to aid in the task of reading .json files

Functions:

def read_json_file_into_memory(json_file):
    """
    Purpose:
        Read properly formatted JSON file into memory.
    Args:
        json_file (String): Filename for JSON file to load (including path)
    Returns:
        json_object (Dictonary): Dictonary representation JSON Object
    Examples:
        >>> json_file = 'some/path/to/file.json'
        >>> json_object = read_json_file_into_memory(json_file)
        >>> print(json_object)
        >>> {
        >>>     'key': 'value'
        >>> }
    """

json_writing_helpers.py

This library is used to aid in the task of reading .json files

Functions:

def write_json_into_file(json_object, json_file):
    """
    Purpose:
        Load Dictionary into JSON File
    Args:
        json_object (Dictionary): Dictionary to be stored in .json format
        json_file (String): Filename for JSON file to store (including path)
    Returns:
        N/A
    Examples:
        >>> json_file = 'some/path/to/file.json'
        >>> json_object = {
        >>>     'key': 'value'
        >>> }
        >>> write_json_into_file(json_file, json_object)
    """

Example Scripts

Example executable Python scripts/modules for testing and interacting with the library. These show example use-cases for the libraries and can be used as templates for developing with the libraries or to use as one-off development efforts.

N/A

Notes

  • Relies on f-string notation, which is limited to Python3.6. A refactor to remove these could allow for development with Python3.0.x through 3.5.x

TODO

  • Unittest framework in place, but lacking tests

Download files

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

Source Distribution

ctodd-python-lib-json-1.0.2.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ctodd_python_lib_json-1.0.2-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file ctodd-python-lib-json-1.0.2.tar.gz.

File metadata

  • Download URL: ctodd-python-lib-json-1.0.2.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.9.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5

File hashes

Hashes for ctodd-python-lib-json-1.0.2.tar.gz
Algorithm Hash digest
SHA256 3834f9cc277722c54492690cb5d7acc4647fa8ae6a55833554edac5917ed6c7f
MD5 90f9810c6dd4751b933230bd1cc9767f
BLAKE2b-256 b48e785bc7da694999292c8b392fe578932caa2c192e665d1c38e5dac1c5e82e

See more details on using hashes here.

File details

Details for the file ctodd_python_lib_json-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: ctodd_python_lib_json-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.9.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5

File hashes

Hashes for ctodd_python_lib_json-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 94797f523671951cdba374aad8e56ae17f7a81886ef9a23fab78511892f6abb4
MD5 2b2c26c8fc195ace7adf6a8d846d4e45
BLAKE2b-256 f5bd79376eef5475ad044901bc1ea4926f6e6a37d5e7fc3f12ce89fdc33ba44b

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page