Manipulate JSON with your words
Project description
Partial-sh
Examples
Example single line
Command:
echo '{"name":"Jay Neal", "address": "42 Main St 94111"}' | pt -i "Split firstname and lastname" -i "remove the address"
Output:
{ "first_name": "Jay", "last_name": "Neal" }
Example multi lines
Create data.jsonl
JSON Lines file:
cat << EOF > data.jsonl
{"name":"John Doe","date_of_birth":"1980-01-01", "address": "123 Main St"}
{"name":"Jane Smith","date_of_birth":"1990-02-15", "address": "456 Main St"}
{"name":"Jay Neal","date_of_birth":"1993-07-27", "address": "42 Main St 94111"}
{"name":"Lisa Ray","date_of_birth":"1985-03-03", "address": "789 Elm St"}
EOF
Transform the data:
cat data.jsonl | pt -i "Split firstname and lastname" -i "remove the address"
Output:
{"date_of_birth": "1980-01-01", "first_name": "John", "last_name": "Doe"}
{"date_of_birth": "1990-02-15", "first_name": "Jane", "last_name": "Smith"}
{"date_of_birth": "1993-07-27", "first_name": "Jay", "last_name": "Neal"}
{"date_of_birth": "1985-03-03", "first_name": "Lisa", "last_name": "Ray"}
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
partial_sh-0.7.1.tar.gz
(32.7 kB
view details)
Built Distribution
File details
Details for the file partial_sh-0.7.1.tar.gz
.
File metadata
- Download URL: partial_sh-0.7.1.tar.gz
- Upload date:
- Size: 32.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.1 Linux/6.6.26-linuxkit
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14cbcf7dffa5c2b79f4fd18a687bf7568bb3d7fa637167630f2cec9d2590b7dd |
|
MD5 | 7a1ac1c4ba99921f7943a7af5d9f74f4 |
|
BLAKE2b-256 | 91e8c332069298f2b450ff3ed3ac5b55d19d9e58372cf17ed3e58ab2f9a78248 |
File details
Details for the file partial_sh-0.7.1-py3-none-any.whl
.
File metadata
- Download URL: partial_sh-0.7.1-py3-none-any.whl
- Upload date:
- Size: 46.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.1 Linux/6.6.26-linuxkit
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe08da91c22eeaee51c24912b431de2d2486be5b49d74563ddc32c198ac1c594 |
|
MD5 | 796d47752e79a621b7d5aad09d91606e |
|
BLAKE2b-256 | 16193d7bb4baa1de993760d9e668c7f771b548c210f356ce8832101ce04e4f90 |