Metadata-Version: 2.1
Name: partial-sh
Version: 0.4.5
Summary: Manipulate JSON with your words
License: Apache-2.0
Author: Yanael Barbier
Author-email: st3w4r@gmail.com
Requires-Python: >=3.11,<4.0
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: docker (>=7.0.0,<8.0.0)
Requires-Dist: e2b (>=0.13.15,<0.14.0)
Requires-Dist: langchain (==0.1.0)
Requires-Dist: langchain-community (>=0.0.11,<0.0.12)
Requires-Dist: langchain-openai (>=0.0.2,<0.0.3)
Requires-Dist: openai (==1.7.1)
Requires-Dist: rich (>=13.7.0,<14.0.0)
Requires-Dist: tabulate (>=0.9.0,<0.10.0)
Requires-Dist: typer (==0.9.0)
Description-Content-Type: text/markdown

# Partial-sh

## Examples

### Example single line

Command:

```bash
echo '{"name":"Jay Neal", "address": "42 Main St 94111"}' | pt -i "Split firstname and lastname" -i "remove the address"
```

Output:

```json
{ "first_name": "Jay", "last_name": "Neal" }
```

### Example multi lines

Create `data.jsonl` [JSON Lines](https://jsonlines.org/) file:

```json
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:

```bash
cat data.jsonl | pt -i "Split firstname and lastname" -i "remove the address"
```

Output:

```json
{"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"}
```

