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
Built Distribution
File details
Details for the file json-to-files-0.1.tar.gz
.
File metadata
- Download URL: json-to-files-0.1.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 870aec33c2963e8db2f1bda28d64f189c14b6e33d4ce5ca6de9b0e18261eedc5 |
|
MD5 | 1fda0c6bfaedf7abaf148c567faec045 |
|
BLAKE2b-256 | 27e5e64d2949d322b92333b771b49e34551b4cf9a6139b8444b23f8ab6189736 |
File details
Details for the file json_to_files-0.1-py3-none-any.whl
.
File metadata
- Download URL: json_to_files-0.1-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a1301eb5440b887c36a73ddec3663762a4fb0de21c6fff54832242868f87ea7 |
|
MD5 | 006b936d50983f20d773fbb8e91fc2f2 |
|
BLAKE2b-256 | bb93aebcad9d449a6791a45ab9df377ce626e807c6f6b7f9352e4854831d5ab8 |