Skip to content

Reading an existing .json file written out using TinyDB #67

@tomwallis

Description

@tomwallis

Apologies if this is a stupid question, but I have not seen the answer in your docs.

A colleague has passed me a .json file written out using TinyDB. I would like to read its contents. However, if I use

db = TinyDB('my_file.json')

then db is empty, and the file on disk is overwritten (contains one line {"_default": {}}). What's the correct way to read this file into a Python interpreter? I see no "load" method in the docs and tinydb.Storage.read doesn't do this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions