Create separate files on disk based on a JSON object
Project description
json-to-files
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
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)
Built Distribution
Close
Hashes for json_to_files-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a1301eb5440b887c36a73ddec3663762a4fb0de21c6fff54832242868f87ea7 |
|
MD5 | 006b936d50983f20d773fbb8e91fc2f2 |
|
BLAKE2b-256 | bb93aebcad9d449a6791a45ab9df377ce626e807c6f6b7f9352e4854831d5ab8 |