Skip to main content

Create separate files on disk based on a JSON object

Project description

json-to-files

PyPI Changelog Tests License

Create separate files on disk based on a JSON object

Installation

Install this tool using pip:

pip install json-to-files

Usage

This tool takes a JSON file that looks like this:

{
    "foo.txt": "The contents of foo.txt",
    "bar/baz.txt": "The contents of baz.txt"
}

And uses it to write out the following files on disk:

  • foo.txt containing "The contents of foo.txt"
  • bar/baz.txt containing "The contents of baz.txt"

You can run it like this:

json-to-files bundle.json

Or you can specify a directory to write those files to:

json-to-files bundle.json -d /tmp/other-directory

The bundles.json file name is optional - if omitted, this tool will read from standard input:

cat bundle.json | json-to-files

Development

To contribute to this tool, first checkout the code. Then create a new virtual environment:

cd json-to-files
python -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

json-to-files-0.1.tar.gz (6.8 kB view hashes)

Uploaded Source

Built Distribution

json_to_files-0.1-py3-none-any.whl (7.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page