Skip to content

Releases: fenhl/lazyjson

lazyjson 2.2.0 — better iteration and support for open kwargs

03 Nov 16:47
Compare
Choose a tag to compare

The __iter__ method on Nodes (which is used e.g. in for loops) is now a part of the API, and has been customized to always yield more nodes. Iterating over nodes representing objects yields the values.

file_is_open, an optional argument to the File constructor, is now documented and versioned.

As a new feature, the File constructor now also takes arbitrary keyword arguments and passes them to each call to open. This can for example be used to open a file with a certain encoding.

lazyjson 2.1.0 — get

03 Nov 01:19
Compare
Choose a tag to compare

With this release, the get method on nodes is overridden to handle key lookup correctly and to always return Python values (as opposed to nodes). It also accepts numeric indices and slice objects as its first arguments when used on arrays.

lazyjson 2.0.1

13 Oct 08:08
Compare
Choose a tag to compare

This release fixes missing imports that caused parse_version_string to fail.

lazyjson 2.0.0 — ABC

13 Oct 07:54
Compare
Choose a tag to compare

With this backwards-incompatible release, lazyjson now supports files which have values other than objects as their root node. To support this, the Dict and List subclasses are gone, and a Node may now represent a JSON value of any type.

Also, File now inherits from an ABC called BaseFile. Implementing lazyjson files with custom behaviors is easy; just implement value (reading) and set (writing).

New types of files come with lazyjson now:

  • SFTPFile, which represents a file on the network, accessed through SFTP (requires paramiko),
  • MultiFile, which represents a stack of files, recursively merged into one upon reading (writing doesn't quite work as expected yet),
  • and PythonFile, which just stores data in a native Python object (and can be used in multifiles as fallback).

lazyjson 1.2.0 — file object support and write failsafe

29 Apr 07:01
Compare
Choose a tag to compare

With this release, lazyjson.File objects support open file objects as constructor arguments in addition to objects that can be opened and pathlib.Path objects.

There is also a new failsafe that will cause lazyjson to raise an exception before trying to write an object that contains illegal elements, instead of letting json start to write to the file and then leaving corrupted JSON behind when it encounters the illegal object. This failsafe works by simply passing the object to json.dumps, which should raise an exception if it cannot be converted to valid JSON.

lazyjson 1.1.0 — pathlib support

09 Apr 02:02
Compare
Choose a tag to compare

With this release, lazyjson.File objects support pathlib.Path objects as constructor arguments in addition to objects that can be opened.

lazyjson still maintains backward compatibility with Python 3.2 and 3.3.

lazyjson 1.0.2 — Python 3.2 compatibility

21 Feb 15:47
Compare
Choose a tag to compare

With this release, lazyjson is designed to work not only for Python version 3.3 but also version 3.2.

lazyjson 1.0.1 — Make everything work

20 Feb 03:29
Compare
Choose a tag to compare

With this release, everything should work as intended. The examples in the readme have been tested. Lazyjson will also make sure that changed files end in a newline.