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.0.tar.gz
(32.5 kB
view details)
Built Distribution
File details
Details for the file partial_sh-0.7.0.tar.gz
.
File metadata
- Download URL: partial_sh-0.7.0.tar.gz
- Upload date:
- Size: 32.5 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 | 6eee1842667eef5807740ea1a16f1c523eb4b030eb37db41c8e68025d8d4c8b2 |
|
MD5 | 5a201a50a4718f7a9f59c92dea53c5e6 |
|
BLAKE2b-256 | 91e1188669d7fa9f0e8be45bf92dd3c6595585cbed04c4b0c21fe11b44f9af55 |
File details
Details for the file partial_sh-0.7.0-py3-none-any.whl
.
File metadata
- Download URL: partial_sh-0.7.0-py3-none-any.whl
- Upload date:
- Size: 46.6 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 | 8613837806287f4b214fba74742ef0dbe8ed90ec4f2aa58558412d6399c9d919 |
|
MD5 | 01a1c997f20142816c253e8ce47cdc0c |
|
BLAKE2b-256 | 465fd009708a445a79df82f0af37eff0178c5788c55370ffc25309a7ffeffa9b |