semvec/pypi-packages huggingface dataset:
python-jsonllm 0.0.3.1
LLM please cast to JSON
License: MIT
Requires Python: >=3.8

## `jsonllm` 
-----------------------

![image](https://github.com/ivanbelenky/jsonllm/assets/49297252/d0526122-0199-4434-ad3c-19d11a3a9fd4)

## Installation
---------------

### From PyPI

```bash
pip install python-jsonllm
```


### From source

```bash
git clone https://github.com/ivanbelenky/jsonllm.git
cd jsonllm
python3 -m pip install -e .
```

## Documentation
----------------

### Schema type

```python
class SchemaKey(TypedDict):
    name: Optional[str]
    type: Optional[type]
    default: JSONCompatible
    required: Optional[bool]
    instructions: Optional[str]
    valid: Optional[Caster] 
    caster: Optional[Validator]

class Schema(TypedDict):
    __key__: Union[SchemaKey, 'Schema'] # nested schemas
```


### Example

```python
import os

import jsonllm

#assert os.environ.get('ANTHROPIC_API_KEY') != None
#assert os.environ.get('OPENAI_API_KEY') != None

person = {
    'first_name': {
        'type': str,
        'required': True,
        'instructions': 'Find the first name, if not found input John'        
    },
    'last_name': {
        'type': str,
        'required': True,
        'instructions': 'Find the last name, if not found input Doe'
    },
    'date_of_birth': {
        'name': 'dob',
        'type': str,
        'instructions': 'Find the date of birth and cast it to isoformat'
    }
}

message = 'My name is John Connor, I think I was born 0 of Unix time.'
response = jsonllm.loads(message, person, model='claude-3-opus-20240229')
print(response.response)

{
    'first_name': 'John',
    'last_name': 'Connor',
    'dob': '1970-01-01'
}

```
mockmaster 0.0.2
A CLI tool to generate dummy data
License: MIT
Keywords: data dummy

## Welcome to MockMaster

A CLI tool to generate dummy data in various formats using GPT ,designed to meet diverse needs of software engineers .
It can be used to bootstrap your database , serve dummy data to test out your frontend etc..

## Table of contents
- [Features](#features)
- [Basic Usage](#basic-usage)
- [Authors](#authors)
- [To-dos](#to-dos)

## Features
- :books:	Generate data in json or csv format ( more will be added)
- :toolbox:	 Generate data for dynamic fields with no fixed vocabulary.
- :mirror:	Generate json that follows json schema data fromat.
- :lock:	Store output in specified path.

## What's Unique and better
- :smile:	 Usage of GPT for dummy data generation
- :smiley: No pre built dictionary for fixed set of keys and values
- :sweat_smile: Data generation follows json schema and generated datafrom gpt is validated to make ouput more reliable

## What's not good
- :roll_eyes: Json or csv generated with field inputs may have no linking for all fields ex- email generated will not match with first name or last name
- :expressionless: only openAI GPT is supported for now
- :roll_eyes: only json and csv is supported 

## Basic Usage

### Step 1: Installation

#### Installing from source

```
git clone https://github.com/deepukr007/mockmaster.git
cd mockmaster
```

### Step 2:
```
pip install .
```

### Step 3:
Set or edit openAI API key and store it in .env file 
```
mockmaster init
```

### Step 4:

Example 1: Json with fields
```
mockmaster generate json name place age zip_code --limit 10
```

Example 2: Json with schema
```
mockmaster generate json --schema --path <path_to_schema>
```

Example 3:
```
mockmaster generate csv name place age zip_code --limit 10 -o <output_path>
```

### To-dos
- Add support to other llms
- Change stratergy to store API keys
- Python SDK like faker

#### Authors
-  Deepu Krishnareddy
-  Harish Mohan