json API Reference

Full documentation for json (2.0.9)

json.JSONDecodeError
Python Library Documentation: class JSONDecodeError in module json.decoder

class JSONDecodeError(builtins.ValueError)
 |  JSONDecodeError(msg, doc, pos)
 |
 |  Subclass of ValueError with the following additional properties:
 |
 |  msg: The unformatted error message
 |  doc: The JSON document being parsed
 |  pos: The start index of doc where parsing failed
 |  lineno: The line corresponding to pos
 |  colno: The column corresponding to pos
 |
 |  Method resolution order:
 |      JSONDecodeError
 |      builtins.ValueError
 |      builtins.Exception
 |      builtins.BaseException
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, msg, doc, pos)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __reduce__(self)
 |      Helper for pickle.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Static methods inherited from builtins.ValueError:
 |
 |  __new__(*args, **kwargs) class method of builtins.ValueError
 |      Create and return a new object.  See help(type) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from builtins.BaseException:
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __repr__(self, /)
 |      Return repr(self).
 |
 |  __setstate__(...)
 |
 |  __str__(self, /)
 |      Return str(self).
 |
 |  add_note(...)
 |      Exception.add_note(note) --
 |      add a note to the exception
 |
 |  with_traceback(...)
 |      Exception.with_traceback(tb) --
 |      set self.__traceback__ to tb and return self.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from builtins.BaseException:
 |
 |  __cause__
 |      exception cause
 |
 |  __context__
 |      exception context
 |
 |  __dict__
 |
 |  __suppress_context__
 |
 |  __traceback__
 |
 |  args
json.JSONDecoder
Python Library Documentation: class JSONDecoder in module json.decoder

class JSONDecoder(builtins.object)
 |  JSONDecoder(*, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, strict=True, object_pairs_hook=None)
 |
 |  Simple JSON <https://json.org> decoder
 |
 |  Performs the following translations in decoding by default:
 |
 |  +---------------+-------------------+
 |  | JSON          | Python            |
 |  +===============+===================+
 |  | object        | dict              |
 |  +---------------+-------------------+
 |  | array         | list              |
 |  +---------------+-------------------+
 |  | string        | str               |
 |  +---------------+-------------------+
 |  | number (int)  | int               |
 |  +---------------+-------------------+
 |  | number (real) | float             |
 |  +---------------+-------------------+
 |  | true          | True              |
 |  +---------------+-------------------+
 |  | false         | False             |
 |  +---------------+-------------------+
 |  | null          | None              |
 |  +---------------+-------------------+
 |
 |  It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as
 |  their corresponding ``float`` values, which is outside the JSON spec.
 |
 |  Methods defined here:
 |
 |  __init__(self, *, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, strict=True, object_pairs_hook=None)
 |      ``object_hook``, if specified, will be called with the result
 |      of every JSON object decoded and its return value will be used in
 |      place of the given ``dict``.  This can be used to provide custom
 |      deserializations (e.g. to support JSON-RPC class hinting).
 |
 |      ``object_pairs_hook``, if specified will be called with the result of
 |      every JSON object decoded with an ordered list of pairs.  The return
 |      value of ``object_pairs_hook`` will be used instead of the ``dict``.
 |      This feature can be used to implement custom decoders.
 |      If ``object_hook`` is also defined, the ``object_pairs_hook`` takes
 |      priority.
 |
 |      ``parse_float``, if specified, will be called with the string
 |      of every JSON float to be decoded. By default this is equivalent to
 |      float(num_str). This can be used to use another datatype or parser
 |      for JSON floats (e.g. decimal.Decimal).
 |
 |      ``parse_int``, if specified, will be called with the string
 |      of every JSON int to be decoded. By default this is equivalent to
 |      int(num_str). This can be used to use another datatype or parser
 |      for JSON integers (e.g. float).
 |
 |      ``parse_constant``, if specified, will be called with one of the
 |      following strings: -Infinity, Infinity, NaN.
 |      This can be used to raise an exception if invalid JSON numbers
 |      are encountered.
 |
 |      If ``strict`` is false (true is the default), then control
 |      characters will be allowed inside strings.  Control characters in
 |      this context are those with character codes in the 0-31 range,
 |      including ``'\t'`` (tab), ``'\n'``, ``'\r'`` and ``'\0'``.
 |
 |  decode(self, s, _w=<built-in method match of re.Pattern object at 0x000001CBC1539CB0>)
 |      Return the Python representation of ``s`` (a ``str`` instance
 |      containing a JSON document).
 |
 |  raw_decode(self, s, idx=0)
 |      Decode a JSON document from ``s`` (a ``str`` beginning with
 |      a JSON document) and return a 2-tuple of the Python
 |      representation and the index in ``s`` where the document ended.
 |
 |      This can be used to decode a JSON document from a string that may
 |      have extraneous data at the end.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
json.JSONEncoder
Python Library Documentation: class JSONEncoder in module json.encoder

class JSONEncoder(builtins.object)
 |  JSONEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)
 |
 |  Extensible JSON <https://json.org> encoder for Python data structures.
 |
 |  Supports the following objects and types by default:
 |
 |  +-------------------+---------------+
 |  | Python            | JSON          |
 |  +===================+===============+
 |  | dict              | object        |
 |  +-------------------+---------------+
 |  | list, tuple       | array         |
 |  +-------------------+---------------+
 |  | str               | string        |
 |  +-------------------+---------------+
 |  | int, float        | number        |
 |  +-------------------+---------------+
 |  | True              | true          |
 |  +-------------------+---------------+
 |  | False             | false         |
 |  +-------------------+---------------+
 |  | None              | null          |
 |  +-------------------+---------------+
 |
 |  To extend this to recognize other objects, subclass and implement a
 |  ``.default()`` method with another method that returns a serializable
 |  object for ``o`` if possible, otherwise it should call the superclass
 |  implementation (to raise ``TypeError``).
 |
 |  Methods defined here:
 |
 |  __init__(self, *, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)
 |      Constructor for JSONEncoder, with sensible defaults.
 |
 |      If skipkeys is false, then it is a TypeError to attempt
 |      encoding of keys that are not str, int, float or None.  If
 |      skipkeys is True, such items are simply skipped.
 |
 |      If ensure_ascii is true, the output is guaranteed to be str
 |      objects with all incoming non-ASCII characters escaped.  If
 |      ensure_ascii is false, the output can contain non-ASCII characters.
 |
 |      If check_circular is true, then lists, dicts, and custom encoded
 |      objects will be checked for circular references during encoding to
 |      prevent an infinite recursion (which would cause an RecursionError).
 |      Otherwise, no such check takes place.
 |
 |      If allow_nan is true, then NaN, Infinity, and -Infinity will be
 |      encoded as such.  This behavior is not JSON specification compliant,
 |      but is consistent with most JavaScript based encoders and decoders.
 |      Otherwise, it will be a ValueError to encode such floats.
 |
 |      If sort_keys is true, then the output of dictionaries will be
 |      sorted by key; this is useful for regression tests to ensure
 |      that JSON serializations can be compared on a day-to-day basis.
 |
 |      If indent is a non-negative integer, then JSON array
 |      elements and object members will be pretty-printed with that
 |      indent level.  An indent level of 0 will only insert newlines.
 |      None is the most compact representation.
 |
 |      If specified, separators should be an (item_separator, key_separator)
 |      tuple.  The default is (', ', ': ') if *indent* is ``None`` and
 |      (',', ': ') otherwise.  To get the most compact JSON representation,
 |      you should specify (',', ':') to eliminate whitespace.
 |
 |      If specified, default is a function that gets called for objects
 |      that can't otherwise be serialized.  It should return a JSON encodable
 |      version of the object or raise a ``TypeError``.
 |
 |  default(self, o)
 |      Implement this method in a subclass such that it returns
 |      a serializable object for ``o``, or calls the base implementation
 |      (to raise a ``TypeError``).
 |
 |      For example, to support arbitrary iterators, you could
 |      implement default like this::
 |
 |          def default(self, o):
 |              try:
 |                  iterable = iter(o)
 |              except TypeError:
 |                  pass
 |              else:
 |                  return list(iterable)
 |              # Let the base class default method raise the TypeError
 |              return super().default(o)
 |
 |  encode(self, o)
 |      Return a JSON string representation of a Python data structure.
 |
 |      >>> from json.encoder import JSONEncoder
 |      >>> JSONEncoder().encode({"foo": ["bar", "baz"]})
 |      '{"foo": ["bar", "baz"]}'
 |
 |  iterencode(self, o, _one_shot=False)
 |      Encode the given object and yield each string
 |      representation as available.
 |
 |      For example::
 |
 |          for chunk in JSONEncoder().iterencode(bigobject):
 |              mysocket.write(chunk)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  item_separator = ', '
 |
 |  key_separator = ': '
json.codecs
Python Library Documentation: module codecs

NAME
    codecs - codecs -- Python Codec Registry, API and helpers.

MODULE REFERENCE
    https://docs.python.org/3.12/library/codecs.html

    The following documentation is automatically generated from the Python
    source files.  It may be incomplete, incorrect or include features that
    are considered implementation detail and may vary between Python
    implementations.  When in doubt, consult the module reference at the
    location listed above.

DESCRIPTION

    Written by Marc-Andre Lemburg (mal@lemburg.com).

    (c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

CLASSES
    builtins.object
        Codec
            StreamReader
            StreamWriter
        IncrementalDecoder
        IncrementalEncoder
        StreamReaderWriter
        StreamRecoder
    builtins.tuple(builtins.object)
        CodecInfo

    class Codec(builtins.object)
     |  Defines the interface for stateless encoders/decoders.
     |
     |  The .encode()/.decode() methods may use different error
     |  handling schemes by providing the errors argument. These
     |  string values are predefined:
     |
     |   'strict' - raise a ValueError error (or a subclass)
     |   'ignore' - ignore the character and continue with the next
     |   'replace' - replace with a suitable replacement character;
     |              Python will use the official U+FFFD REPLACEMENT
     |              CHARACTER for the builtin Unicode codecs on
     |              decoding and '?' on encoding.
     |   'surrogateescape' - replace with private code points U+DCnn.
     |   'xmlcharrefreplace' - Replace with the appropriate XML
     |                         character reference (only for encoding).
     |   'backslashreplace'  - Replace with backslashed escape sequences.
     |   'namereplace'       - Replace with \N{...} escape sequences
     |                         (only for encoding).
     |
     |  The set of allowed values can be extended via register_error.
     |
     |  Methods defined here:
     |
     |  decode(self, input, errors='strict')
     |      Decodes the object input and returns a tuple (output
     |      object, length consumed).
     |
     |      input must be an object which provides the bf_getreadbuf
     |      buffer slot. Python strings, buffer objects and memory
     |      mapped files are examples of objects providing this slot.
     |
     |      errors defines the error handling to apply. It defaults to
     |      'strict' handling.
     |
     |      The method may not store state in the Codec instance. Use
     |      StreamReader for codecs which have to keep state in order to
     |      make decoding efficient.
     |
     |      The decoder must be able to handle zero length input and
     |      return an empty object of the output object type in this
     |      situation.
     |
     |  encode(self, input, errors='strict')
     |      Encodes the object input and returns a tuple (output
     |      object, length consumed).
     |
     |      errors defines the error handling to apply. It defaults to
     |      'strict' handling.
     |
     |      The method may not store state in the Codec instance. Use
     |      StreamWriter for codecs which have to keep state in order to
     |      make encoding efficient.
     |
     |      The encoder must be able to handle zero length input and
     |      return an empty object of the output object type in this
     |      situation.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class CodecInfo(builtins.tuple)
     |  CodecInfo(encode, decode, streamreader=None, streamwriter=None, incrementalencoder=None, incrementaldecoder=None, name=None, *, _is_text_encoding=None)
     |
     |  Codec details when looking up the codec registry
     |
     |  Method resolution order:
     |      CodecInfo
     |      builtins.tuple
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(cls, encode, decode, streamreader=None, streamwriter=None, incrementalencoder=None, incrementaldecoder=None, name=None, *, _is_text_encoding=None)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.tuple:
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __getnewargs__(self, /)
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  count(self, value, /)
     |      Return number of occurrences of value.
     |
     |  index(self, value, start=0, stop=9223372036854775807, /)
     |      Return first index of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.tuple:
     |
     |  __class_getitem__(...)
     |      See PEP 585

    class IncrementalDecoder(builtins.object)
     |  IncrementalDecoder(errors='strict')
     |
     |  An IncrementalDecoder decodes an input in multiple steps. The input can
     |  be passed piece by piece to the decode() method. The IncrementalDecoder
     |  remembers the state of the decoding process between calls to decode().
     |
     |  Methods defined here:
     |
     |  __init__(self, errors='strict')
     |      Create an IncrementalDecoder instance.
     |
     |      The IncrementalDecoder may use different error handling schemes by
     |      providing the errors keyword argument. See the module docstring
     |      for a list of possible values.
     |
     |  decode(self, input, final=False)
     |      Decode input and returns the resulting object.
     |
     |  getstate(self)
     |      Return the current state of the decoder.
     |
     |      This must be a (buffered_input, additional_state_info) tuple.
     |      buffered_input must be a bytes object containing bytes that
     |      were passed to decode() that have not yet been converted.
     |      additional_state_info must be a non-negative integer
     |      representing the state of the decoder WITHOUT yet having
     |      processed the contents of buffered_input.  In the initial state
     |      and after reset(), getstate() must return (b"", 0).
     |
     |  reset(self)
     |      Reset the decoder to the initial state.
     |
     |  setstate(self, state)
     |      Set the current state of the decoder.
     |
     |      state must have been returned by getstate().  The effect of
     |      setstate((b"", 0)) must be equivalent to reset().
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class IncrementalEncoder(builtins.object)
     |  IncrementalEncoder(errors='strict')
     |
     |  An IncrementalEncoder encodes an input in multiple steps. The input can
     |  be passed piece by piece to the encode() method. The IncrementalEncoder
     |  remembers the state of the encoding process between calls to encode().
     |
     |  Methods defined here:
     |
     |  __init__(self, errors='strict')
     |      Creates an IncrementalEncoder instance.
     |
     |      The IncrementalEncoder may use different error handling schemes by
     |      providing the errors keyword argument. See the module docstring
     |      for a list of possible values.
     |
     |  encode(self, input, final=False)
     |      Encodes input and returns the resulting object.
     |
     |  getstate(self)
     |      Return the current state of the encoder.
     |
     |  reset(self)
     |      Resets the encoder to the initial state.
     |
     |  setstate(self, state)
     |      Set the current state of the encoder. state must have been
     |      returned by getstate().
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class StreamReader(Codec)
     |  StreamReader(stream, errors='strict')
     |
     |  Method resolution order:
     |      StreamReader
     |      Codec
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __enter__(self)
     |
     |  __exit__(self, type, value, tb)
     |
     |  __getattr__(self, name, getattr=<built-in function getattr>)
     |      Inherit all other methods from the underlying stream.
     |
     |  __init__(self, stream, errors='strict')
     |      Creates a StreamReader instance.
     |
     |      stream must be a file-like object open for reading.
     |
     |      The StreamReader may use different error handling
     |      schemes by providing the errors keyword argument. These
     |      parameters are predefined:
     |
     |       'strict' - raise a ValueError (or a subclass)
     |       'ignore' - ignore the character and continue with the next
     |       'replace'- replace with a suitable replacement character
     |       'backslashreplace' - Replace with backslashed escape sequences;
     |
     |      The set of allowed parameter values can be extended via
     |      register_error.
     |
     |  __iter__(self)
     |
     |  __next__(self)
     |      Return the next decoded line from the input stream.
     |
     |  __reduce_ex__(self, proto)
     |      Helper for pickle.
     |
     |  decode(self, input, errors='strict')
     |      Decodes the object input and returns a tuple (output
     |      object, length consumed).
     |
     |      input must be an object which provides the bf_getreadbuf
     |      buffer slot. Python strings, buffer objects and memory
     |      mapped files are examples of objects providing this slot.
     |
     |      errors defines the error handling to apply. It defaults to
     |      'strict' handling.
     |
     |      The method may not store state in the Codec instance. Use
     |      StreamReader for codecs which have to keep state in order to
     |      make decoding efficient.
     |
     |      The decoder must be able to handle zero length input and
     |      return an empty object of the output object type in this
     |      situation.
     |
     |  read(self, size=-1, chars=-1, firstline=False)
     |      Decodes data from the stream self.stream and returns the
     |      resulting object.
     |
     |      chars indicates the number of decoded code points or bytes to
     |      return. read() will never return more data than requested,
     |      but it might return less, if there is not enough available.
     |
     |      size indicates the approximate maximum number of decoded
     |      bytes or code points to read for decoding. The decoder
     |      can modify this setting as appropriate. The default value
     |      -1 indicates to read and decode as much as possible.  size
     |      is intended to prevent having to decode huge files in one
     |      step.
     |
     |      If firstline is true, and a UnicodeDecodeError happens
     |      after the first line terminator in the input only the first line
     |      will be returned, the rest of the input will be kept until the
     |      next call to read().
     |
     |      The method should use a greedy read strategy, meaning that
     |      it should read as much data as is allowed within the
     |      definition of the encoding and the given size, e.g.  if
     |      optional encoding endings or state markers are available
     |      on the stream, these should be read too.
     |
     |  readline(self, size=None, keepends=True)
     |      Read one line from the input stream and return the
     |      decoded data.
     |
     |      size, if given, is passed as size argument to the
     |      read() method.
     |
     |  readlines(self, sizehint=None, keepends=True)
     |      Read all lines available on the input stream
     |      and return them as a list.
     |
     |      Line breaks are implemented using the codec's decoder
     |      method and are included in the list entries.
     |
     |      sizehint, if given, is ignored since there is no efficient
     |      way to finding the true end-of-line.
     |
     |  reset(self)
     |      Resets the codec buffers used for keeping internal state.
     |
     |      Note that no stream repositioning should take place.
     |      This method is primarily intended to be able to recover
     |      from decoding errors.
     |
     |  seek(self, offset, whence=0)
     |      Set the input stream's current position.
     |
     |      Resets the codec buffers used for keeping state.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  charbuffertype = <class 'str'>
     |      str(object='') -> str
     |      str(bytes_or_buffer[, encoding[, errors]]) -> str
     |
     |      Create a new string object from the given object. If encoding or
     |      errors is specified, then the object must expose a data buffer
     |      that will be decoded using the given encoding and error handler.
     |      Otherwise, returns the result of object.__str__() (if defined)
     |      or repr(object).
     |      encoding defaults to sys.getdefaultencoding().
     |      errors defaults to 'strict'.
     |
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Codec:
     |
     |  encode(self, input, errors='strict')
     |      Encodes the object input and returns a tuple (output
     |      object, length consumed).
     |
     |      errors defines the error handling to apply. It defaults to
     |      'strict' handling.
     |
     |      The method may not store state in the Codec instance. Use
     |      StreamWriter for codecs which have to keep state in order to
     |      make encoding efficient.
     |
     |      The encoder must be able to handle zero length input and
     |      return an empty object of the output object type in this
     |      situation.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from Codec:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class StreamReaderWriter(builtins.object)
     |  StreamReaderWriter(stream, Reader, Writer, errors='strict')
     |
     |  StreamReaderWriter instances allow wrapping streams which
     |  work in both read and write modes.
     |
     |  The design is such that one can use the factory functions
     |  returned by the codec.lookup() function to construct the
     |  instance.
     |
     |  Methods defined here:
     |
     |  __enter__(self)
     |
     |  __exit__(self, type, value, tb)
     |
     |  __getattr__(self, name, getattr=<built-in function getattr>)
     |      Inherit all other methods from the underlying stream.
     |
     |  __init__(self, stream, Reader, Writer, errors='strict')
     |      Creates a StreamReaderWriter instance.
     |
     |      stream must be a Stream-like object.
     |
     |      Reader, Writer must be factory functions or classes
     |      providing the StreamReader, StreamWriter interface resp.
     |
     |      Error handling is done in the same way as defined for the
     |      StreamWriter/Readers.
     |
     |  __iter__(self)
     |
     |  __next__(self)
     |      Return the next decoded line from the input stream.
     |
     |  __reduce_ex__(self, proto)
     |      Helper for pickle.
     |
     |  read(self, size=-1)
     |
     |  readline(self, size=None)
     |
     |  readlines(self, sizehint=None)
     |
     |  reset(self)
     |
     |  seek(self, offset, whence=0)
     |
     |  write(self, data)
     |
     |  writelines(self, list)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  encoding = 'unknown'

    class StreamRecoder(builtins.object)
     |  StreamRecoder(stream, encode, decode, Reader, Writer, errors='strict')
     |
     |  StreamRecoder instances translate data from one encoding to another.
     |
     |  They use the complete set of APIs returned by the
     |  codecs.lookup() function to implement their task.
     |
     |  Data written to the StreamRecoder is first decoded into an
     |  intermediate format (depending on the "decode" codec) and then
     |  written to the underlying stream using an instance of the provided
     |  Writer class.
     |
     |  In the other direction, data is read from the underlying stream using
     |  a Reader instance and then encoded and returned to the caller.
     |
     |  Methods defined here:
     |
     |  __enter__(self)
     |
     |  __exit__(self, type, value, tb)
     |
     |  __getattr__(self, name, getattr=<built-in function getattr>)
     |      Inherit all other methods from the underlying stream.
     |
     |  __init__(self, stream, encode, decode, Reader, Writer, errors='strict')
     |      Creates a StreamRecoder instance which implements a two-way
     |      conversion: encode and decode work on the frontend (the
     |      data visible to .read() and .write()) while Reader and Writer
     |      work on the backend (the data in stream).
     |
     |      You can use these objects to do transparent
     |      transcodings from e.g. latin-1 to utf-8 and back.
     |
     |      stream must be a file-like object.
     |
     |      encode and decode must adhere to the Codec interface; Reader and
     |      Writer must be factory functions or classes providing the
     |      StreamReader and StreamWriter interfaces resp.
     |
     |      Error handling is done in the same way as defined for the
     |      StreamWriter/Readers.
     |
     |  __iter__(self)
     |
     |  __next__(self)
     |      Return the next decoded line from the input stream.
     |
     |  __reduce_ex__(self, proto)
     |      Helper for pickle.
     |
     |  read(self, size=-1)
     |
     |  readline(self, size=None)
     |
     |  readlines(self, sizehint=None)
     |
     |  reset(self)
     |
     |  seek(self, offset, whence=0)
     |
     |  write(self, data)
     |
     |  writelines(self, list)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  data_encoding = 'unknown'
     |
     |  file_encoding = 'unknown'

    class StreamWriter(Codec)
     |  StreamWriter(stream, errors='strict')
     |
     |  Method resolution order:
     |      StreamWriter
     |      Codec
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __enter__(self)
     |
     |  __exit__(self, type, value, tb)
     |
     |  __getattr__(self, name, getattr=<built-in function getattr>)
     |      Inherit all other methods from the underlying stream.
     |
     |  __init__(self, stream, errors='strict')
     |      Creates a StreamWriter instance.
     |
     |      stream must be a file-like object open for writing.
     |
     |      The StreamWriter may use different error handling
     |      schemes by providing the errors keyword argument. These
     |      parameters are predefined:
     |
     |       'strict' - raise a ValueError (or a subclass)
     |       'ignore' - ignore the character and continue with the next
     |       'replace'- replace with a suitable replacement character
     |       'xmlcharrefreplace' - Replace with the appropriate XML
     |                             character reference.
     |       'backslashreplace'  - Replace with backslashed escape
     |                             sequences.
     |       'namereplace'       - Replace with \N{...} escape sequences.
     |
     |      The set of allowed parameter values can be extended via
     |      register_error.
     |
     |  __reduce_ex__(self, proto)
     |      Helper for pickle.
     |
     |  reset(self)
     |      Resets the codec buffers used for keeping internal state.
     |
     |      Calling this method should ensure that the data on the
     |      output is put into a clean state, that allows appending
     |      of new fresh data without having to rescan the whole
     |      stream to recover state.
     |
     |  seek(self, offset, whence=0)
     |
     |  write(self, object)
     |      Writes the object's contents encoded to self.stream.
     |
     |  writelines(self, list)
     |      Writes the concatenated list of strings to the stream
     |      using .write().
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Codec:
     |
     |  decode(self, input, errors='strict')
     |      Decodes the object input and returns a tuple (output
     |      object, length consumed).
     |
     |      input must be an object which provides the bf_getreadbuf
     |      buffer slot. Python strings, buffer objects and memory
     |      mapped files are examples of objects providing this slot.
     |
     |      errors defines the error handling to apply. It defaults to
     |      'strict' handling.
     |
     |      The method may not store state in the Codec instance. Use
     |      StreamReader for codecs which have to keep state in order to
     |      make decoding efficient.
     |
     |      The decoder must be able to handle zero length input and
     |      return an empty object of the output object type in this
     |      situation.
     |
     |  encode(self, input, errors='strict')
     |      Encodes the object input and returns a tuple (output
     |      object, length consumed).
     |
     |      errors defines the error handling to apply. It defaults to
     |      'strict' handling.
     |
     |      The method may not store state in the Codec instance. Use
     |      StreamWriter for codecs which have to keep state in order to
     |      make encoding efficient.
     |
     |      The encoder must be able to handle zero length input and
     |      return an empty object of the output object type in this
     |      situation.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from Codec:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    EncodedFile(file, data_encoding, file_encoding=None, errors='strict')
        Return a wrapped version of file which provides transparent
        encoding translation.

        Data written to the wrapped file is decoded according
        to the given data_encoding and then encoded to the underlying
        file using file_encoding. The intermediate data type
        will usually be Unicode but depends on the specified codecs.

        Bytes read from the file are decoded using file_encoding and then
        passed back to the caller encoded using data_encoding.

        If file_encoding is not given, it defaults to data_encoding.

        errors may be given to define the error handling. It defaults
        to 'strict' which causes ValueErrors to be raised in case an
        encoding error occurs.

        The returned wrapped file object provides two extra attributes
        .data_encoding and .file_encoding which reflect the given
        parameters of the same name. The attributes can be used for
        introspection by Python programs.

    backslashreplace_errors(...)
        Implements the 'backslashreplace' error handling, which replaces malformed data with a backslashed escape sequence.

    decode(obj, encoding='utf-8', errors='strict')
        Decodes obj using the codec registered for encoding.

        Default encoding is 'utf-8'.  errors may be given to set a
        different error handling scheme.  Default is 'strict' meaning that encoding
        errors raise a ValueError.  Other possible values are 'ignore', 'replace'
        and 'backslashreplace' as well as any other name registered with
        codecs.register_error that can handle ValueErrors.

    encode(obj, encoding='utf-8', errors='strict')
        Encodes obj using the codec registered for encoding.

        The default encoding is 'utf-8'.  errors may be given to set a
        different error handling scheme.  Default is 'strict' meaning that encoding
        errors raise a ValueError.  Other possible values are 'ignore', 'replace'
        and 'backslashreplace' as well as any other name registered with
        codecs.register_error that can handle ValueErrors.

    getdecoder(encoding)
        Lookup up the codec for the given encoding and return
        its decoder function.

        Raises a LookupError in case the encoding cannot be found.

    getencoder(encoding)
        Lookup up the codec for the given encoding and return
        its encoder function.

        Raises a LookupError in case the encoding cannot be found.

    getincrementaldecoder(encoding)
        Lookup up the codec for the given encoding and return
        its IncrementalDecoder class or factory function.

        Raises a LookupError in case the encoding cannot be found
        or the codecs doesn't provide an incremental decoder.

    getincrementalencoder(encoding)
        Lookup up the codec for the given encoding and return
        its IncrementalEncoder class or factory function.

        Raises a LookupError in case the encoding cannot be found
        or the codecs doesn't provide an incremental encoder.

    getreader(encoding)
        Lookup up the codec for the given encoding and return
        its StreamReader class or factory function.

        Raises a LookupError in case the encoding cannot be found.

    getwriter(encoding)
        Lookup up the codec for the given encoding and return
        its StreamWriter class or factory function.

        Raises a LookupError in case the encoding cannot be found.

    ignore_errors(...)
        Implements the 'ignore' error handling, which ignores malformed data and continues.

    iterdecode(iterator, encoding, errors='strict', **kwargs)
        Decoding iterator.

        Decodes the input strings from the iterator using an IncrementalDecoder.

        errors and kwargs are passed through to the IncrementalDecoder
        constructor.

    iterencode(iterator, encoding, errors='strict', **kwargs)
        Encoding iterator.

        Encodes the input strings from the iterator using an IncrementalEncoder.

        errors and kwargs are passed through to the IncrementalEncoder
        constructor.

    lookup(encoding, /)
        Looks up a codec tuple in the Python codec registry and returns a CodecInfo object.

    lookup_error(name, /)
        lookup_error(errors) -> handler

        Return the error handler for the specified error handling name or raise a
        LookupError, if no handler exists under this name.

    namereplace_errors(...)
        Implements the 'namereplace' error handling, which replaces an unencodable character with a \N{...} escape sequence.

    open(filename, mode='r', encoding=None, errors='strict', buffering=-1)
        Open an encoded file using the given mode and return
        a wrapped version providing transparent encoding/decoding.

        Note: The wrapped version will only accept the object format
        defined by the codecs, i.e. Unicode objects for most builtin
        codecs. Output is also codec dependent and will usually be
        Unicode as well.

        If encoding is not None, then the
        underlying encoded files are always opened in binary mode.
        The default file mode is 'r', meaning to open the file in read mode.

        encoding specifies the encoding which is to be used for the
        file.

        errors may be given to define the error handling. It defaults
        to 'strict' which causes ValueErrors to be raised in case an
        encoding error occurs.

        buffering has the same meaning as for the builtin open() API.
        It defaults to -1 which means that the default buffer size will
        be used.

        The returned wrapped file object provides an extra attribute
        .encoding which allows querying the used encoding. This
        attribute is only available if an encoding was specified as
        parameter.

    register(search_function, /)
        Register a codec search function.

        Search functions are expected to take one argument, the encoding name in
        all lower case letters, and either return None, or a tuple of functions
        (encoder, decoder, stream_reader, stream_writer) (or a CodecInfo object).

    register_error(errors, handler, /)
        Register the specified error handler under the name errors.

        handler must be a callable object, that will be called with an exception
        instance containing information about the location of the encoding/decoding
        error and must return a (replacement, new position) tuple.

    replace_errors(...)
        Implements the 'replace' error handling, which replaces malformed data with a replacement marker.

    strict_errors(...)
        Implements the 'strict' error handling, which raises a UnicodeError on coding errors.

    xmlcharrefreplace_errors(...)
        Implements the 'xmlcharrefreplace' error handling, which replaces an unencodable character with the appropriate XML character reference.

DATA
    BOM = b'\xff\xfe'
    BOM32_BE = b'\xfe\xff'
    BOM32_LE = b'\xff\xfe'
    BOM64_BE = b'\x00\x00\xfe\xff'
    BOM64_LE = b'\xff\xfe\x00\x00'
    BOM_BE = b'\xfe\xff'
    BOM_LE = b'\xff\xfe'
    BOM_UTF16 = b'\xff\xfe'
    BOM_UTF16_BE = b'\xfe\xff'
    BOM_UTF16_LE = b'\xff\xfe'
    BOM_UTF32 = b'\xff\xfe\x00\x00'
    BOM_UTF32_BE = b'\x00\x00\xfe\xff'
    BOM_UTF32_LE = b'\xff\xfe\x00\x00'
    BOM_UTF8 = b'\xef\xbb\xbf'
    __all__ = ['register', 'lookup', 'open', 'EncodedFile', 'BOM', 'BOM_BE...

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\codecs.py

json.decoder
Python Library Documentation: module json.decoder in json

NAME
    json.decoder - Implementation of JSONDecoder

MODULE REFERENCE
    https://docs.python.org/3.12/library/json.decoder.html

    The following documentation is automatically generated from the Python
    source files.  It may be incomplete, incorrect or include features that
    are considered implementation detail and may vary between Python
    implementations.  When in doubt, consult the module reference at the
    location listed above.

CLASSES
    builtins.ValueError(builtins.Exception)
        JSONDecodeError
    builtins.object
        JSONDecoder

    class JSONDecodeError(builtins.ValueError)
     |  JSONDecodeError(msg, doc, pos)
     |
     |  Subclass of ValueError with the following additional properties:
     |
     |  msg: The unformatted error message
     |  doc: The JSON document being parsed
     |  pos: The start index of doc where parsing failed
     |  lineno: The line corresponding to pos
     |  colno: The column corresponding to pos
     |
     |  Method resolution order:
     |      JSONDecodeError
     |      builtins.ValueError
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, msg, doc, pos)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __reduce__(self)
     |      Helper for pickle.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.ValueError:
     |
     |  __new__(*args, **kwargs) class method of builtins.ValueError
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

    class JSONDecoder(builtins.object)
     |  JSONDecoder(*, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, strict=True, object_pairs_hook=None)
     |
     |  Simple JSON <https://json.org> decoder
     |
     |  Performs the following translations in decoding by default:
     |
     |  +---------------+-------------------+
     |  | JSON          | Python            |
     |  +===============+===================+
     |  | object        | dict              |
     |  +---------------+-------------------+
     |  | array         | list              |
     |  +---------------+-------------------+
     |  | string        | str               |
     |  +---------------+-------------------+
     |  | number (int)  | int               |
     |  +---------------+-------------------+
     |  | number (real) | float             |
     |  +---------------+-------------------+
     |  | true          | True              |
     |  +---------------+-------------------+
     |  | false         | False             |
     |  +---------------+-------------------+
     |  | null          | None              |
     |  +---------------+-------------------+
     |
     |  It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as
     |  their corresponding ``float`` values, which is outside the JSON spec.
     |
     |  Methods defined here:
     |
     |  __init__(self, *, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, strict=True, object_pairs_hook=None)
     |      ``object_hook``, if specified, will be called with the result
     |      of every JSON object decoded and its return value will be used in
     |      place of the given ``dict``.  This can be used to provide custom
     |      deserializations (e.g. to support JSON-RPC class hinting).
     |
     |      ``object_pairs_hook``, if specified will be called with the result of
     |      every JSON object decoded with an ordered list of pairs.  The return
     |      value of ``object_pairs_hook`` will be used instead of the ``dict``.
     |      This feature can be used to implement custom decoders.
     |      If ``object_hook`` is also defined, the ``object_pairs_hook`` takes
     |      priority.
     |
     |      ``parse_float``, if specified, will be called with the string
     |      of every JSON float to be decoded. By default this is equivalent to
     |      float(num_str). This can be used to use another datatype or parser
     |      for JSON floats (e.g. decimal.Decimal).
     |
     |      ``parse_int``, if specified, will be called with the string
     |      of every JSON int to be decoded. By default this is equivalent to
     |      int(num_str). This can be used to use another datatype or parser
     |      for JSON integers (e.g. float).
     |
     |      ``parse_constant``, if specified, will be called with one of the
     |      following strings: -Infinity, Infinity, NaN.
     |      This can be used to raise an exception if invalid JSON numbers
     |      are encountered.
     |
     |      If ``strict`` is false (true is the default), then control
     |      characters will be allowed inside strings.  Control characters in
     |      this context are those with character codes in the 0-31 range,
     |      including ``'\t'`` (tab), ``'\n'``, ``'\r'`` and ``'\0'``.
     |
     |  decode(self, s, _w=<built-in method match of re.Pattern object at 0x000001CBC1539CB0>)
     |      Return the Python representation of ``s`` (a ``str`` instance
     |      containing a JSON document).
     |
     |  raw_decode(self, s, idx=0)
     |      Decode a JSON document from ``s`` (a ``str`` beginning with
     |      a JSON document) and return a 2-tuple of the Python
     |      representation and the index in ``s`` where the document ended.
     |
     |      This can be used to decode a JSON document from a string that may
     |      have extraneous data at the end.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

DATA
    __all__ = ['JSONDecoder', 'JSONDecodeError']

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\json\decoder.py

json.detect_encoding
Python Library Documentation: function detect_encoding in module json

detect_encoding(b)
json.dump
Python Library Documentation: function dump in module json

dump(obj, fp, *, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None, default=None, sort_keys=False, **kw)
    Serialize ``obj`` as a JSON formatted stream to ``fp`` (a
    ``.write()``-supporting file-like object).

    If ``skipkeys`` is true then ``dict`` keys that are not basic types
    (``str``, ``int``, ``float``, ``bool``, ``None``) will be skipped
    instead of raising a ``TypeError``.

    If ``ensure_ascii`` is false, then the strings written to ``fp`` can
    contain non-ASCII characters if they appear in strings contained in
    ``obj``. Otherwise, all such characters are escaped in JSON strings.

    If ``check_circular`` is false, then the circular reference check
    for container types will be skipped and a circular reference will
    result in an ``RecursionError`` (or worse).

    If ``allow_nan`` is false, then it will be a ``ValueError`` to
    serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``)
    in strict compliance of the JSON specification, instead of using the
    JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``).

    If ``indent`` is a non-negative integer, then JSON array elements and
    object members will be pretty-printed with that indent level. An indent
    level of 0 will only insert newlines. ``None`` is the most compact
    representation.

    If specified, ``separators`` should be an ``(item_separator, key_separator)``
    tuple.  The default is ``(', ', ': ')`` if *indent* is ``None`` and
    ``(',', ': ')`` otherwise.  To get the most compact JSON representation,
    you should specify ``(',', ':')`` to eliminate whitespace.

    ``default(obj)`` is a function that should return a serializable version
    of obj or raise TypeError. The default simply raises TypeError.

    If *sort_keys* is true (default: ``False``), then the output of
    dictionaries will be sorted by key.

    To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the
    ``.default()`` method to serialize additional types), specify it with
    the ``cls`` kwarg; otherwise ``JSONEncoder`` is used.
json.dumps
Python Library Documentation: function dumps in module json

dumps(obj, *, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None, default=None, sort_keys=False, **kw)
    Serialize ``obj`` to a JSON formatted ``str``.

    If ``skipkeys`` is true then ``dict`` keys that are not basic types
    (``str``, ``int``, ``float``, ``bool``, ``None``) will be skipped
    instead of raising a ``TypeError``.

    If ``ensure_ascii`` is false, then the return value can contain non-ASCII
    characters if they appear in strings contained in ``obj``. Otherwise, all
    such characters are escaped in JSON strings.

    If ``check_circular`` is false, then the circular reference check
    for container types will be skipped and a circular reference will
    result in an ``RecursionError`` (or worse).

    If ``allow_nan`` is false, then it will be a ``ValueError`` to
    serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in
    strict compliance of the JSON specification, instead of using the
    JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``).

    If ``indent`` is a non-negative integer, then JSON array elements and
    object members will be pretty-printed with that indent level. An indent
    level of 0 will only insert newlines. ``None`` is the most compact
    representation.

    If specified, ``separators`` should be an ``(item_separator, key_separator)``
    tuple.  The default is ``(', ', ': ')`` if *indent* is ``None`` and
    ``(',', ': ')`` otherwise.  To get the most compact JSON representation,
    you should specify ``(',', ':')`` to eliminate whitespace.

    ``default(obj)`` is a function that should return a serializable version
    of obj or raise TypeError. The default simply raises TypeError.

    If *sort_keys* is true (default: ``False``), then the output of
    dictionaries will be sorted by key.

    To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the
    ``.default()`` method to serialize additional types), specify it with
    the ``cls`` kwarg; otherwise ``JSONEncoder`` is used.
json.encoder
Python Library Documentation: module json.encoder in json

NAME
    json.encoder - Implementation of JSONEncoder

MODULE REFERENCE
    https://docs.python.org/3.12/library/json.encoder.html

    The following documentation is automatically generated from the Python
    source files.  It may be incomplete, incorrect or include features that
    are considered implementation detail and may vary between Python
    implementations.  When in doubt, consult the module reference at the
    location listed above.

CLASSES
    builtins.object
        JSONEncoder

    class JSONEncoder(builtins.object)
     |  JSONEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)
     |
     |  Extensible JSON <https://json.org> encoder for Python data structures.
     |
     |  Supports the following objects and types by default:
     |
     |  +-------------------+---------------+
     |  | Python            | JSON          |
     |  +===================+===============+
     |  | dict              | object        |
     |  +-------------------+---------------+
     |  | list, tuple       | array         |
     |  +-------------------+---------------+
     |  | str               | string        |
     |  +-------------------+---------------+
     |  | int, float        | number        |
     |  +-------------------+---------------+
     |  | True              | true          |
     |  +-------------------+---------------+
     |  | False             | false         |
     |  +-------------------+---------------+
     |  | None              | null          |
     |  +-------------------+---------------+
     |
     |  To extend this to recognize other objects, subclass and implement a
     |  ``.default()`` method with another method that returns a serializable
     |  object for ``o`` if possible, otherwise it should call the superclass
     |  implementation (to raise ``TypeError``).
     |
     |  Methods defined here:
     |
     |  __init__(self, *, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)
     |      Constructor for JSONEncoder, with sensible defaults.
     |
     |      If skipkeys is false, then it is a TypeError to attempt
     |      encoding of keys that are not str, int, float or None.  If
     |      skipkeys is True, such items are simply skipped.
     |
     |      If ensure_ascii is true, the output is guaranteed to be str
     |      objects with all incoming non-ASCII characters escaped.  If
     |      ensure_ascii is false, the output can contain non-ASCII characters.
     |
     |      If check_circular is true, then lists, dicts, and custom encoded
     |      objects will be checked for circular references during encoding to
     |      prevent an infinite recursion (which would cause an RecursionError).
     |      Otherwise, no such check takes place.
     |
     |      If allow_nan is true, then NaN, Infinity, and -Infinity will be
     |      encoded as such.  This behavior is not JSON specification compliant,
     |      but is consistent with most JavaScript based encoders and decoders.
     |      Otherwise, it will be a ValueError to encode such floats.
     |
     |      If sort_keys is true, then the output of dictionaries will be
     |      sorted by key; this is useful for regression tests to ensure
     |      that JSON serializations can be compared on a day-to-day basis.
     |
     |      If indent is a non-negative integer, then JSON array
     |      elements and object members will be pretty-printed with that
     |      indent level.  An indent level of 0 will only insert newlines.
     |      None is the most compact representation.
     |
     |      If specified, separators should be an (item_separator, key_separator)
     |      tuple.  The default is (', ', ': ') if *indent* is ``None`` and
     |      (',', ': ') otherwise.  To get the most compact JSON representation,
     |      you should specify (',', ':') to eliminate whitespace.
     |
     |      If specified, default is a function that gets called for objects
     |      that can't otherwise be serialized.  It should return a JSON encodable
     |      version of the object or raise a ``TypeError``.
     |
     |  default(self, o)
     |      Implement this method in a subclass such that it returns
     |      a serializable object for ``o``, or calls the base implementation
     |      (to raise a ``TypeError``).
     |
     |      For example, to support arbitrary iterators, you could
     |      implement default like this::
     |
     |          def default(self, o):
     |              try:
     |                  iterable = iter(o)
     |              except TypeError:
     |                  pass
     |              else:
     |                  return list(iterable)
     |              # Let the base class default method raise the TypeError
     |              return super().default(o)
     |
     |  encode(self, o)
     |      Return a JSON string representation of a Python data structure.
     |
     |      >>> from json.encoder import JSONEncoder
     |      >>> JSONEncoder().encode({"foo": ["bar", "baz"]})
     |      '{"foo": ["bar", "baz"]}'
     |
     |  iterencode(self, o, _one_shot=False)
     |      Encode the given object and yield each string
     |      representation as available.
     |
     |      For example::
     |
     |          for chunk in JSONEncoder().iterencode(bigobject):
     |              mysocket.write(chunk)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  item_separator = ', '
     |
     |  key_separator = ': '

FUNCTIONS
    c_encode_basestring = encode_basestring(...)
        encode_basestring(string) -> string

        Return a JSON representation of a Python string

    c_encode_basestring_ascii = encode_basestring_ascii(...)
        encode_basestring_ascii(string) -> string

        Return an ASCII-only JSON representation of a Python string

    encode_basestring(...)
        encode_basestring(string) -> string

        Return a JSON representation of a Python string

    encode_basestring_ascii(...)
        encode_basestring_ascii(string) -> string

        Return an ASCII-only JSON representation of a Python string

    py_encode_basestring(s)
        Return a JSON representation of a Python string

    py_encode_basestring_ascii(s)
        Return an ASCII-only JSON representation of a Python string

DATA
    ESCAPE = re.compile('[\\x00-\\x1f\\\\"\\b\\f\\n\\r\\t]')
    ESCAPE_ASCII = re.compile('([\\\\"]|[^\\ -~])')
    ESCAPE_DCT = {'\x00': r'\u0000', '\x01': r'\u0001', '\x02': r'\u0002',...
    HAS_UTF8 = re.compile(b'[\x80-\xff]')
    INFINITY = inf

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\json\encoder.py

json.load
Python Library Documentation: function load in module json

load(fp, *, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw)
    Deserialize ``fp`` (a ``.read()``-supporting file-like object containing
    a JSON document) to a Python object.

    ``object_hook`` is an optional function that will be called with the
    result of any object literal decode (a ``dict``). The return value of
    ``object_hook`` will be used instead of the ``dict``. This feature
    can be used to implement custom decoders (e.g. JSON-RPC class hinting).

    ``object_pairs_hook`` is an optional function that will be called with the
    result of any object literal decoded with an ordered list of pairs.  The
    return value of ``object_pairs_hook`` will be used instead of the ``dict``.
    This feature can be used to implement custom decoders.  If ``object_hook``
    is also defined, the ``object_pairs_hook`` takes priority.

    To use a custom ``JSONDecoder`` subclass, specify it with the ``cls``
    kwarg; otherwise ``JSONDecoder`` is used.
json.loads
Python Library Documentation: function loads in module json

loads(s, *, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw)
    Deserialize ``s`` (a ``str``, ``bytes`` or ``bytearray`` instance
    containing a JSON document) to a Python object.

    ``object_hook`` is an optional function that will be called with the
    result of any object literal decode (a ``dict``). The return value of
    ``object_hook`` will be used instead of the ``dict``. This feature
    can be used to implement custom decoders (e.g. JSON-RPC class hinting).

    ``object_pairs_hook`` is an optional function that will be called with the
    result of any object literal decoded with an ordered list of pairs.  The
    return value of ``object_pairs_hook`` will be used instead of the ``dict``.
    This feature can be used to implement custom decoders.  If ``object_hook``
    is also defined, the ``object_pairs_hook`` takes priority.

    ``parse_float``, if specified, will be called with the string
    of every JSON float to be decoded. By default this is equivalent to
    float(num_str). This can be used to use another datatype or parser
    for JSON floats (e.g. decimal.Decimal).

    ``parse_int``, if specified, will be called with the string
    of every JSON int to be decoded. By default this is equivalent to
    int(num_str). This can be used to use another datatype or parser
    for JSON integers (e.g. float).

    ``parse_constant``, if specified, will be called with one of the
    following strings: -Infinity, Infinity, NaN.
    This can be used to raise an exception if invalid JSON numbers
    are encountered.

    To use a custom ``JSONDecoder`` subclass, specify it with the ``cls``
    kwarg; otherwise ``JSONDecoder`` is used.
json.scanner
Python Library Documentation: module json.scanner in json

NAME
    json.scanner - JSON token scanner

MODULE REFERENCE
    https://docs.python.org/3.12/library/json.scanner.html

    The following documentation is automatically generated from the Python
    source files.  It may be incomplete, incorrect or include features that
    are considered implementation detail and may vary between Python
    implementations.  When in doubt, consult the module reference at the
    location listed above.

CLASSES
    builtins.object
        _json.Scanner

    make_scanner = class Scanner(builtins.object)
     |  JSON scanner object
     |
     |  Methods defined here:
     |
     |  __call__(self, /, *args, **kwargs)
     |      Call self as a function.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  object_hook
     |      object_hook
     |
     |  object_pairs_hook
     |
     |  parse_constant
     |      parse_constant
     |
     |  parse_float
     |      parse_float
     |
     |  parse_int
     |      parse_int
     |
     |  strict
     |      strict

DATA
    __all__ = ['make_scanner']

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\json\scanner.py