Giter Site home page Giter Site logo

simplejson's Introduction

simplejson

A clone of Python's simplejson package built to demonstrate and develop the language tools I've created here. For those unfamiliar with simplejson, it is a python utility, now included with the language, used to encode and decode JSON data.

Currently the tool depends upon simplejson to dump objects once parsed and created, as I'm less interested in that task and it is unrelated to the language tools. However, I will likely remove all depedencies upon simplejson eventually.

Usage

Currently, the main loading and dumping methods from simplejson are supported in simplified form:

load

Tokenizes and parses a JSON file from a stream implementing the TextIOBase interface. Returns an object representing the JSON data, just as simplejson does.

json.load(input_stream: StringIO)

loads

Functions identically to load, but uses a string rather than a stream to retrieve data from.

json.loads(input_str: str)

dump

Stringifies a JSON serializable object and writes the result to the provided stream. Currently uses simplejson.

json.dump(json_object: Object, stream: TextIOBase)

dumps

Functions identically to dump, but returns the string directly rather than writing to a stream. Also depends on simplejson.

json.dumps(json_object: Object)

Limitations

  • Only ASCII characters are supported
  • Escaped characters in strings are supported, but do no behave exactly like simplejson for the time being

simplejson's People

Contributors

nuriamari avatar

Watchers

 avatar

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.