json-prompt-formatter


Namejson-prompt-formatter JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/SemTiOne/json_prompt_formatter
SummaryCLI tool for formatting prompts using JSON templates for different use cases
upload_time2025-08-02 10:35:25
maintainerNone
docs_urlNone
authorSemTiOne
requires_python>=3.8
licenseNone
keywords prompt-engineering json cli ai chatgpt openai formatting templates automation prompt-templates developer-tools
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # πŸš€ JSON Prompt Formatter

A professional CLI and Python tool for converting text prompts into structured JSON/JSONL formats using customizable templates. Perfect for AI/ML workflows, API integrations, and batch processing of prompts.

## ✨ Features

- **πŸ–₯️ CLI Interface**: Easy-to-use command-line interface for developers
- **πŸ”„ Batch Processing**: Convert multiple prompts at once
- **πŸ“‹ Multiple Templates**: 7 professional templates included
- **🎯 Custom Placeholders**: Use any placeholder format
- **πŸ“ Dual Output**: Generate both JSON and JSONL formats
- **⚑ Fast Processing**: Handle 1000+ prompts efficiently
- **πŸ›‘οΈ Error Handling**: Comprehensive validation and error reporting
- **🌍 Unicode Support**: Full support for international characters
- **πŸ“¦ PyPI Package**: Install globally with pip

## πŸ“¦ Installation

### Option 1: Install from PyPI (Recommended)
```bash
pip install json-prompt-formatter
```

### Option 2: Install from Source
```bash
# Clone the repository
git clone https://github.com/SemTiOne/json_prompt_formatter.git
cd json_prompt_formatter

# Install in development mode
pip install -e .
```

### Requirements
- Python 3.8+
- No external dependencies required

## πŸš€ Quick Start

### CLI Usage (New!)
```bash
# Format a single prompt
json-prompt-formatter format "Create a marketing campaign for sustainable fashion" -t marketer

# Process a file
json-prompt-formatter file prompts/branding_prompts.txt -t copywriter -o my_output.json

# List available templates
json-prompt-formatter templates

# Show usage examples
json-prompt-formatter examples

# Short alias also works
jpf format "Design a minimalist logo" -t designer
```

### Python Script Usage (Original)
```bash
python formatter.py -p prompts/branding_prompts.txt -t templates/openai_template.json -o my_formatted_prompts
```

## 🎯 CLI Commands

### Core Commands

**Format a single prompt:**
```bash
json-prompt-formatter format "Your prompt text here" -t template_name [-o output_file]
```

**Process a file:**
```bash
json-prompt-formatter file input_file.txt -t template_name [-o output_file]
```

**Batch process directory:**
```bash
json-prompt-formatter batch ./input_dir ./output_dir -t template_name
```

**List available templates:**
```bash
json-prompt-formatter templates
```

**Show examples:**
```bash
json-prompt-formatter examples
```

### CLI Examples

```bash
# Single prompt formatting
json-prompt-formatter format "Create a tagline for an AI startup" -t marketer

# File processing with output
json-prompt-formatter file prompts/marketing.txt -t copywriter -o campaign_prompts.json

# Batch processing
json-prompt-formatter batch ./prompts ./outputs -t designer

# Using short alias
jpf format "Design a mobile app interface" -t product_designer -o design_brief.json
```

## πŸ“‹ Available Templates

**OpenAI Template** (`openai`) - Complete branding analysis with structured JSON response for OpenAI ChatGPT API integration.

**Copywriter Template** (`copywriter`) - Professional copywriting prompts optimized for marketing and advertising content creation.

**Designer Template** (`designer`) - Design-focused prompt structure for visual identity, branding, and creative design work.

**Marketer Template** (`marketer`) - Marketing campaign and strategy prompts for comprehensive marketing planning and execution.

**Founder Template** (`founder`) - Business strategy and startup prompts tailored for entrepreneurship and business development.

**Product Designer Template** (`product_designer`) - UX/UI and product development prompts focused on user experience and interface design.

**Prompt Engineer Template** (`prompt_engineer`) - Advanced prompt optimization and engineering for sophisticated AI interactions.

## πŸ”§ Development Commands (Makefile)

```bash
# Development setup
make install          # Install package in development mode
make clean           # Clean build artifacts
make test            # Run tests

# Examples and demo
make demo            # Run interactive demo
make examples        # Generate example outputs
make quick-test      # Quick functionality test

# Building and deployment
make build           # Build distribution packages
make deploy-test     # Deploy to Test PyPI
make deploy          # Deploy to PyPI (production)
```

## πŸ“Š Input/Output Examples

### Input Example (`prompts/sample.txt`)
```
Create a tagline for a tech startup
Write a product description for smart headphones
Develop a brand story for an eco-friendly company
```

### CLI Command
```bash
json-prompt-formatter file prompts/sample.txt -t openai -o branded_prompts.json
```

### Output Example (`branded_prompts.json`)
```json
[
  {
    "model": "gpt-4o",
    "temperature": 0.7,
    "max_tokens": 1500,
    "response_format": { "type": "json_object" },
    "messages": [
      {
        "role": "system",
        "content": "You are a world-class branding expert with 15+ years of experience..."
      },
      {
        "role": "user", 
        "content": "Create a tagline for a tech startup\n\nPlease respond with a comprehensive branding analysis..."
      }
    ],
    "metadata": {
      "template_version": "2.0",
      "category": "branding",
      "api_provider": "openai",
      "tags": ["openai", "api", "branding", "structured-output"]
    }
  }
]
```

## 🎯 Advanced Usage

### Python Script Usage
```bash
# Basic formatting
python formatter.py -p prompts/branding_prompts.txt -t templates/copywriter_template.json -o copywriter_prompts

# Custom output directory
python formatter.py -p prompts/my_prompts.txt -t templates/openai_template.json --output-dir results -o formatted_data

# Custom placeholder
python formatter.py -p prompts/my_prompts.txt -t templates/custom_template.json -o custom_output --placeholder "{{CUSTOM_PROMPT}}"

# Verbose logging
python formatter.py -p prompts/my_prompts.txt -t templates/openai_template.json -o debug_output --verbose
```

### Batch Processing All Templates
```bash
# CLI approach
for template in openai copywriter designer marketer founder product_designer prompt_engineer; do
    json-prompt-formatter file prompts/branding_prompts.txt -t "$template" -o "output_$template.json"
done

# Python script approach
for template in templates/*.json; do
    template_name=$(basename "$template" .json)
    python formatter.py -p prompts/branding_prompts.txt -t "$template" -o "output_$template_name"
done
```

## πŸ“ Project Structure

```
json_prompt_formatter/
β”œβ”€β”€ πŸ“„ README.md                        # This file
β”œβ”€β”€ πŸ“„ LICENSE                          # MIT license
β”œβ”€β”€ πŸ“„ CONTRIBUTING.md                  # Contribution guidelines
β”œβ”€β”€ πŸ“„ CHANGELOG.md                     # Version history
β”œβ”€β”€ πŸ“„ setup.py                         # Package configuration
β”œβ”€β”€ πŸ“„ requirements.txt                 # Dependencies
β”œβ”€β”€ πŸ“„ Makefile                         # Dev commands
β”œβ”€β”€ πŸ“„ .gitignore                       # Git exclusions
β”œβ”€β”€ πŸ“„ MANIFEST.in                      # Package files
β”œβ”€β”€ πŸ“„ package.json                     # Node.js package config
β”œβ”€β”€ 🐍 __main__.py                      # Main entry point
β”œβ”€β”€ 🐍 formatter.py                     # Main formatting tool
β”œβ”€β”€ 🐍 json_to_jsonl.py                 # Format converter
β”œβ”€β”€ 🐍 deploy.py                        # Deployment script
β”œβ”€β”€ πŸ“ templates/                       # 7 professional templates
β”‚   β”œβ”€β”€ openai_template.json            # OpenAI API with branding expertise
β”‚   β”œβ”€β”€ copywriter_template.json        # Marketing copywriting
β”‚   β”œβ”€β”€ designer_template.json          # Design & visual identity
β”‚   β”œβ”€β”€ marketer_template.json          # Marketing strategy
β”‚   β”œβ”€β”€ founder_template.json           # Entrepreneurship & business
β”‚   β”œβ”€β”€ product_designer_template.json  # Product design & UX/UI
β”‚   └── prompt_engineer_template.json   # Advanced prompt engineering
β”œβ”€β”€ πŸ“ prompts/                         # Sample prompt collections
β”‚   └── branding_prompts.txt            # 75+ branding prompts
β”œβ”€β”€ πŸ“ examples/                        # Usage examples & demos
└── πŸ“ outputs/                         # Generated files (created automatically)
```

## βš™οΈ CLI Options

```bash
json-prompt-formatter [COMMAND] [OPTIONS]

Commands:
  format      Format a single prompt
  file        Process prompts from a file
  batch       Process multiple files in a directory
  templates   List available templates
  examples    Show usage examples

Global Options:
  --help      Show help message
  --version   Show version information

Format/File Options:
  -t, --template NAME    Template to use (default: openai)
  -o, --output FILE      Output file path
```

## βš™οΈ Python Script Options

```bash
python formatter.py [OPTIONS]

Required Arguments:
  -p, --prompt PATH          Path to prompt .txt file
  -t, --template PATH        Path to template .json file

Optional Arguments:
  -o, --output NAME          Base name for output files
  --output-dir DIR           Output directory (default: outputs)
  --placeholder TEXT         Placeholder to replace (default: {{prompt}})
  --json-only               Only generate JSON format
  --jsonl-only              Only generate JSONL format  
  --verbose, -v             Enable verbose logging
```

## πŸ”§ Creating Custom Templates

### Template Structure
```json
{
  "messages": [
    {
      "role": "user",
      "content": "{{prompt}}"
    }
  ],
  "temperature": 0.7,
  "max_tokens": 1000
}
```

### Using Custom Templates with CLI
```bash
# Place your template in templates/ directory as my_template.json
json-prompt-formatter format "Test prompt" -t my_template

# Or use full path with Python script
python formatter.py -p prompts.txt -t path/to/custom_template.json -o output
```

## πŸ“Š Performance

- **Speed**: Processes 1000+ prompts in under 10 seconds
- **Memory**: Efficient memory usage for large datasets
- **Scalability**: Tested with 10,000+ prompts
- **Cross-platform**: Works on Windows, macOS, and Linux

## πŸ› Troubleshooting

### CLI Issues

**Command not found:**
```bash
# Reinstall the package
pip uninstall json-prompt-formatter
pip install json-prompt-formatter

# Or use Python directly
python cli.py format "test prompt" -t openai
```

**Template not found:**
```bash
# List available templates
json-prompt-formatter templates

# Use correct template name
json-prompt-formatter format "prompt" -t copywriter  # Not copywriter_template
```

### Common Issues

**Invalid JSON Template Error**
- Check your template JSON syntax at [jsonlint.com](https://jsonlint.com/)

**File Not Found Error**
- Verify file paths are correct
- Use forward slashes or escaped backslashes on Windows

**Unicode Encoding Issues (Windows)**
```bash
chcp 65001
json-prompt-formatter format "prompt with Γ©mojis πŸš€" -t openai
```

## πŸš€ Publishing to PyPI

This package is available on PyPI! To publish updates:

```bash
# Test deployment
make deploy-test

# Production deployment
make deploy
```

## 🀝 Contributing

We welcome contributions! Quick steps:

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Test with both CLI and Python script
5. Submit a pull request

## πŸ“œ License

MIT License - see [LICENSE](LICENSE) file for details.

## 🌟 Acknowledgments

- Built for the AI/ML developer community
- Designed for both CLI and programmatic usage
- Optimized for modern prompt engineering workflows

## πŸ“ˆ Roadmap

- [x] CLI interface for developers
- [x] PyPI package distribution
- [ ] GUI interface
- [ ] Template validation tool
- [ ] Cloud storage integration
- [ ] Docker containerization
- [ ] Plugin system for custom processors

---

## πŸ’‘ Use Cases

### For Developers
```bash
# Quick prompt formatting in development
jpf format "Debug this React component" -t prompt_engineer

# Batch process training data
jpf batch ./training_prompts ./formatted_data -t openai

# CI/CD integration
json-prompt-formatter file prompts.txt -t api_template -o deployment_ready.json
```

### For Content Teams
```bash
# Marketing campaign development
jpf file marketing_briefs.txt -t marketer -o campaign_prompts.json

# Design brief generation
jpf format "Design a modern dashboard" -t designer -o design_brief.json
```

### For Researchers
```bash
# Experiment preparation
jpf batch ./research_prompts ./experiments -t openai

# Evaluation dataset creation
python formatter.py -p evaluation_set.txt -t research_template.json -o eval_data
```

---

**⭐ Star this repository if you find it helpful!**

**🐦 Follow [@SemTiOne](https://github.com/SemTiOne) for updates**

For questions or issues, please [open an issue](https://github.com/SemTiOne/json_prompt_formatter/issues).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/SemTiOne/json_prompt_formatter",
    "name": "json-prompt-formatter",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "prompt-engineering, json, cli, ai, chatgpt, openai, formatting, templates, automation, prompt-templates, developer-tools",
    "author": "SemTiOne",
    "author_email": "emphyst80@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/d6/a8/5a1a38bf93d0a9427176d9fe239a20e4eb8c26e2295c72c41b8aef65c774/json_prompt_formatter-1.0.0.tar.gz",
    "platform": null,
    "description": "# \ud83d\ude80 JSON Prompt Formatter\r\n\r\nA professional CLI and Python tool for converting text prompts into structured JSON/JSONL formats using customizable templates. Perfect for AI/ML workflows, API integrations, and batch processing of prompts.\r\n\r\n## \u2728 Features\r\n\r\n- **\ud83d\udda5\ufe0f CLI Interface**: Easy-to-use command-line interface for developers\r\n- **\ud83d\udd04 Batch Processing**: Convert multiple prompts at once\r\n- **\ud83d\udccb Multiple Templates**: 7 professional templates included\r\n- **\ud83c\udfaf Custom Placeholders**: Use any placeholder format\r\n- **\ud83d\udcc1 Dual Output**: Generate both JSON and JSONL formats\r\n- **\u26a1 Fast Processing**: Handle 1000+ prompts efficiently\r\n- **\ud83d\udee1\ufe0f Error Handling**: Comprehensive validation and error reporting\r\n- **\ud83c\udf0d Unicode Support**: Full support for international characters\r\n- **\ud83d\udce6 PyPI Package**: Install globally with pip\r\n\r\n## \ud83d\udce6 Installation\r\n\r\n### Option 1: Install from PyPI (Recommended)\r\n```bash\r\npip install json-prompt-formatter\r\n```\r\n\r\n### Option 2: Install from Source\r\n```bash\r\n# Clone the repository\r\ngit clone https://github.com/SemTiOne/json_prompt_formatter.git\r\ncd json_prompt_formatter\r\n\r\n# Install in development mode\r\npip install -e .\r\n```\r\n\r\n### Requirements\r\n- Python 3.8+\r\n- No external dependencies required\r\n\r\n## \ud83d\ude80 Quick Start\r\n\r\n### CLI Usage (New!)\r\n```bash\r\n# Format a single prompt\r\njson-prompt-formatter format \"Create a marketing campaign for sustainable fashion\" -t marketer\r\n\r\n# Process a file\r\njson-prompt-formatter file prompts/branding_prompts.txt -t copywriter -o my_output.json\r\n\r\n# List available templates\r\njson-prompt-formatter templates\r\n\r\n# Show usage examples\r\njson-prompt-formatter examples\r\n\r\n# Short alias also works\r\njpf format \"Design a minimalist logo\" -t designer\r\n```\r\n\r\n### Python Script Usage (Original)\r\n```bash\r\npython formatter.py -p prompts/branding_prompts.txt -t templates/openai_template.json -o my_formatted_prompts\r\n```\r\n\r\n## \ud83c\udfaf CLI Commands\r\n\r\n### Core Commands\r\n\r\n**Format a single prompt:**\r\n```bash\r\njson-prompt-formatter format \"Your prompt text here\" -t template_name [-o output_file]\r\n```\r\n\r\n**Process a file:**\r\n```bash\r\njson-prompt-formatter file input_file.txt -t template_name [-o output_file]\r\n```\r\n\r\n**Batch process directory:**\r\n```bash\r\njson-prompt-formatter batch ./input_dir ./output_dir -t template_name\r\n```\r\n\r\n**List available templates:**\r\n```bash\r\njson-prompt-formatter templates\r\n```\r\n\r\n**Show examples:**\r\n```bash\r\njson-prompt-formatter examples\r\n```\r\n\r\n### CLI Examples\r\n\r\n```bash\r\n# Single prompt formatting\r\njson-prompt-formatter format \"Create a tagline for an AI startup\" -t marketer\r\n\r\n# File processing with output\r\njson-prompt-formatter file prompts/marketing.txt -t copywriter -o campaign_prompts.json\r\n\r\n# Batch processing\r\njson-prompt-formatter batch ./prompts ./outputs -t designer\r\n\r\n# Using short alias\r\njpf format \"Design a mobile app interface\" -t product_designer -o design_brief.json\r\n```\r\n\r\n## \ud83d\udccb Available Templates\r\n\r\n**OpenAI Template** (`openai`) - Complete branding analysis with structured JSON response for OpenAI ChatGPT API integration.\r\n\r\n**Copywriter Template** (`copywriter`) - Professional copywriting prompts optimized for marketing and advertising content creation.\r\n\r\n**Designer Template** (`designer`) - Design-focused prompt structure for visual identity, branding, and creative design work.\r\n\r\n**Marketer Template** (`marketer`) - Marketing campaign and strategy prompts for comprehensive marketing planning and execution.\r\n\r\n**Founder Template** (`founder`) - Business strategy and startup prompts tailored for entrepreneurship and business development.\r\n\r\n**Product Designer Template** (`product_designer`) - UX/UI and product development prompts focused on user experience and interface design.\r\n\r\n**Prompt Engineer Template** (`prompt_engineer`) - Advanced prompt optimization and engineering for sophisticated AI interactions.\r\n\r\n## \ud83d\udd27 Development Commands (Makefile)\r\n\r\n```bash\r\n# Development setup\r\nmake install          # Install package in development mode\r\nmake clean           # Clean build artifacts\r\nmake test            # Run tests\r\n\r\n# Examples and demo\r\nmake demo            # Run interactive demo\r\nmake examples        # Generate example outputs\r\nmake quick-test      # Quick functionality test\r\n\r\n# Building and deployment\r\nmake build           # Build distribution packages\r\nmake deploy-test     # Deploy to Test PyPI\r\nmake deploy          # Deploy to PyPI (production)\r\n```\r\n\r\n## \ud83d\udcca Input/Output Examples\r\n\r\n### Input Example (`prompts/sample.txt`)\r\n```\r\nCreate a tagline for a tech startup\r\nWrite a product description for smart headphones\r\nDevelop a brand story for an eco-friendly company\r\n```\r\n\r\n### CLI Command\r\n```bash\r\njson-prompt-formatter file prompts/sample.txt -t openai -o branded_prompts.json\r\n```\r\n\r\n### Output Example (`branded_prompts.json`)\r\n```json\r\n[\r\n  {\r\n    \"model\": \"gpt-4o\",\r\n    \"temperature\": 0.7,\r\n    \"max_tokens\": 1500,\r\n    \"response_format\": { \"type\": \"json_object\" },\r\n    \"messages\": [\r\n      {\r\n        \"role\": \"system\",\r\n        \"content\": \"You are a world-class branding expert with 15+ years of experience...\"\r\n      },\r\n      {\r\n        \"role\": \"user\", \r\n        \"content\": \"Create a tagline for a tech startup\\n\\nPlease respond with a comprehensive branding analysis...\"\r\n      }\r\n    ],\r\n    \"metadata\": {\r\n      \"template_version\": \"2.0\",\r\n      \"category\": \"branding\",\r\n      \"api_provider\": \"openai\",\r\n      \"tags\": [\"openai\", \"api\", \"branding\", \"structured-output\"]\r\n    }\r\n  }\r\n]\r\n```\r\n\r\n## \ud83c\udfaf Advanced Usage\r\n\r\n### Python Script Usage\r\n```bash\r\n# Basic formatting\r\npython formatter.py -p prompts/branding_prompts.txt -t templates/copywriter_template.json -o copywriter_prompts\r\n\r\n# Custom output directory\r\npython formatter.py -p prompts/my_prompts.txt -t templates/openai_template.json --output-dir results -o formatted_data\r\n\r\n# Custom placeholder\r\npython formatter.py -p prompts/my_prompts.txt -t templates/custom_template.json -o custom_output --placeholder \"{{CUSTOM_PROMPT}}\"\r\n\r\n# Verbose logging\r\npython formatter.py -p prompts/my_prompts.txt -t templates/openai_template.json -o debug_output --verbose\r\n```\r\n\r\n### Batch Processing All Templates\r\n```bash\r\n# CLI approach\r\nfor template in openai copywriter designer marketer founder product_designer prompt_engineer; do\r\n    json-prompt-formatter file prompts/branding_prompts.txt -t \"$template\" -o \"output_$template.json\"\r\ndone\r\n\r\n# Python script approach\r\nfor template in templates/*.json; do\r\n    template_name=$(basename \"$template\" .json)\r\n    python formatter.py -p prompts/branding_prompts.txt -t \"$template\" -o \"output_$template_name\"\r\ndone\r\n```\r\n\r\n## \ud83d\udcc1 Project Structure\r\n\r\n```\r\njson_prompt_formatter/\r\n\u251c\u2500\u2500 \ud83d\udcc4 README.md                        # This file\r\n\u251c\u2500\u2500 \ud83d\udcc4 LICENSE                          # MIT license\r\n\u251c\u2500\u2500 \ud83d\udcc4 CONTRIBUTING.md                  # Contribution guidelines\r\n\u251c\u2500\u2500 \ud83d\udcc4 CHANGELOG.md                     # Version history\r\n\u251c\u2500\u2500 \ud83d\udcc4 setup.py                         # Package configuration\r\n\u251c\u2500\u2500 \ud83d\udcc4 requirements.txt                 # Dependencies\r\n\u251c\u2500\u2500 \ud83d\udcc4 Makefile                         # Dev commands\r\n\u251c\u2500\u2500 \ud83d\udcc4 .gitignore                       # Git exclusions\r\n\u251c\u2500\u2500 \ud83d\udcc4 MANIFEST.in                      # Package files\r\n\u251c\u2500\u2500 \ud83d\udcc4 package.json                     # Node.js package config\r\n\u251c\u2500\u2500 \ud83d\udc0d __main__.py                      # Main entry point\r\n\u251c\u2500\u2500 \ud83d\udc0d formatter.py                     # Main formatting tool\r\n\u251c\u2500\u2500 \ud83d\udc0d json_to_jsonl.py                 # Format converter\r\n\u251c\u2500\u2500 \ud83d\udc0d deploy.py                        # Deployment script\r\n\u251c\u2500\u2500 \ud83d\udcc1 templates/                       # 7 professional templates\r\n\u2502   \u251c\u2500\u2500 openai_template.json            # OpenAI API with branding expertise\r\n\u2502   \u251c\u2500\u2500 copywriter_template.json        # Marketing copywriting\r\n\u2502   \u251c\u2500\u2500 designer_template.json          # Design & visual identity\r\n\u2502   \u251c\u2500\u2500 marketer_template.json          # Marketing strategy\r\n\u2502   \u251c\u2500\u2500 founder_template.json           # Entrepreneurship & business\r\n\u2502   \u251c\u2500\u2500 product_designer_template.json  # Product design & UX/UI\r\n\u2502   \u2514\u2500\u2500 prompt_engineer_template.json   # Advanced prompt engineering\r\n\u251c\u2500\u2500 \ud83d\udcc1 prompts/                         # Sample prompt collections\r\n\u2502   \u2514\u2500\u2500 branding_prompts.txt            # 75+ branding prompts\r\n\u251c\u2500\u2500 \ud83d\udcc1 examples/                        # Usage examples & demos\r\n\u2514\u2500\u2500 \ud83d\udcc1 outputs/                         # Generated files (created automatically)\r\n```\r\n\r\n## \u2699\ufe0f CLI Options\r\n\r\n```bash\r\njson-prompt-formatter [COMMAND] [OPTIONS]\r\n\r\nCommands:\r\n  format      Format a single prompt\r\n  file        Process prompts from a file\r\n  batch       Process multiple files in a directory\r\n  templates   List available templates\r\n  examples    Show usage examples\r\n\r\nGlobal Options:\r\n  --help      Show help message\r\n  --version   Show version information\r\n\r\nFormat/File Options:\r\n  -t, --template NAME    Template to use (default: openai)\r\n  -o, --output FILE      Output file path\r\n```\r\n\r\n## \u2699\ufe0f Python Script Options\r\n\r\n```bash\r\npython formatter.py [OPTIONS]\r\n\r\nRequired Arguments:\r\n  -p, --prompt PATH          Path to prompt .txt file\r\n  -t, --template PATH        Path to template .json file\r\n\r\nOptional Arguments:\r\n  -o, --output NAME          Base name for output files\r\n  --output-dir DIR           Output directory (default: outputs)\r\n  --placeholder TEXT         Placeholder to replace (default: {{prompt}})\r\n  --json-only               Only generate JSON format\r\n  --jsonl-only              Only generate JSONL format  \r\n  --verbose, -v             Enable verbose logging\r\n```\r\n\r\n## \ud83d\udd27 Creating Custom Templates\r\n\r\n### Template Structure\r\n```json\r\n{\r\n  \"messages\": [\r\n    {\r\n      \"role\": \"user\",\r\n      \"content\": \"{{prompt}}\"\r\n    }\r\n  ],\r\n  \"temperature\": 0.7,\r\n  \"max_tokens\": 1000\r\n}\r\n```\r\n\r\n### Using Custom Templates with CLI\r\n```bash\r\n# Place your template in templates/ directory as my_template.json\r\njson-prompt-formatter format \"Test prompt\" -t my_template\r\n\r\n# Or use full path with Python script\r\npython formatter.py -p prompts.txt -t path/to/custom_template.json -o output\r\n```\r\n\r\n## \ud83d\udcca Performance\r\n\r\n- **Speed**: Processes 1000+ prompts in under 10 seconds\r\n- **Memory**: Efficient memory usage for large datasets\r\n- **Scalability**: Tested with 10,000+ prompts\r\n- **Cross-platform**: Works on Windows, macOS, and Linux\r\n\r\n## \ud83d\udc1b Troubleshooting\r\n\r\n### CLI Issues\r\n\r\n**Command not found:**\r\n```bash\r\n# Reinstall the package\r\npip uninstall json-prompt-formatter\r\npip install json-prompt-formatter\r\n\r\n# Or use Python directly\r\npython cli.py format \"test prompt\" -t openai\r\n```\r\n\r\n**Template not found:**\r\n```bash\r\n# List available templates\r\njson-prompt-formatter templates\r\n\r\n# Use correct template name\r\njson-prompt-formatter format \"prompt\" -t copywriter  # Not copywriter_template\r\n```\r\n\r\n### Common Issues\r\n\r\n**Invalid JSON Template Error**\r\n- Check your template JSON syntax at [jsonlint.com](https://jsonlint.com/)\r\n\r\n**File Not Found Error**\r\n- Verify file paths are correct\r\n- Use forward slashes or escaped backslashes on Windows\r\n\r\n**Unicode Encoding Issues (Windows)**\r\n```bash\r\nchcp 65001\r\njson-prompt-formatter format \"prompt with \u00e9mojis \ud83d\ude80\" -t openai\r\n```\r\n\r\n## \ud83d\ude80 Publishing to PyPI\r\n\r\nThis package is available on PyPI! To publish updates:\r\n\r\n```bash\r\n# Test deployment\r\nmake deploy-test\r\n\r\n# Production deployment\r\nmake deploy\r\n```\r\n\r\n## \ud83e\udd1d Contributing\r\n\r\nWe welcome contributions! Quick steps:\r\n\r\n1. Fork the repository\r\n2. Create a feature branch\r\n3. Make your changes\r\n4. Test with both CLI and Python script\r\n5. Submit a pull request\r\n\r\n## \ud83d\udcdc License\r\n\r\nMIT License - see [LICENSE](LICENSE) file for details.\r\n\r\n## \ud83c\udf1f Acknowledgments\r\n\r\n- Built for the AI/ML developer community\r\n- Designed for both CLI and programmatic usage\r\n- Optimized for modern prompt engineering workflows\r\n\r\n## \ud83d\udcc8 Roadmap\r\n\r\n- [x] CLI interface for developers\r\n- [x] PyPI package distribution\r\n- [ ] GUI interface\r\n- [ ] Template validation tool\r\n- [ ] Cloud storage integration\r\n- [ ] Docker containerization\r\n- [ ] Plugin system for custom processors\r\n\r\n---\r\n\r\n## \ud83d\udca1 Use Cases\r\n\r\n### For Developers\r\n```bash\r\n# Quick prompt formatting in development\r\njpf format \"Debug this React component\" -t prompt_engineer\r\n\r\n# Batch process training data\r\njpf batch ./training_prompts ./formatted_data -t openai\r\n\r\n# CI/CD integration\r\njson-prompt-formatter file prompts.txt -t api_template -o deployment_ready.json\r\n```\r\n\r\n### For Content Teams\r\n```bash\r\n# Marketing campaign development\r\njpf file marketing_briefs.txt -t marketer -o campaign_prompts.json\r\n\r\n# Design brief generation\r\njpf format \"Design a modern dashboard\" -t designer -o design_brief.json\r\n```\r\n\r\n### For Researchers\r\n```bash\r\n# Experiment preparation\r\njpf batch ./research_prompts ./experiments -t openai\r\n\r\n# Evaluation dataset creation\r\npython formatter.py -p evaluation_set.txt -t research_template.json -o eval_data\r\n```\r\n\r\n---\r\n\r\n**\u2b50 Star this repository if you find it helpful!**\r\n\r\n**\ud83d\udc26 Follow [@SemTiOne](https://github.com/SemTiOne) for updates**\r\n\r\nFor questions or issues, please [open an issue](https://github.com/SemTiOne/json_prompt_formatter/issues).\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "CLI tool for formatting prompts using JSON templates for different use cases",
    "version": "1.0.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/SemTiOne/json_prompt_formatter/issues",
        "Documentation": "https://github.com/SemTiOne/json_prompt_formatter#readme",
        "Homepage": "https://github.com/SemTiOne/json_prompt_formatter",
        "Source Code": "https://github.com/SemTiOne/json_prompt_formatter"
    },
    "split_keywords": [
        "prompt-engineering",
        " json",
        " cli",
        " ai",
        " chatgpt",
        " openai",
        " formatting",
        " templates",
        " automation",
        " prompt-templates",
        " developer-tools"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3d6adbe895d6a4ea09e9b6b71f4e00d2fcd2fbb311b656250af24e60a27c1237",
                "md5": "1f553007438743eb65164d1d19caed6d",
                "sha256": "7b7285dcd5c108757f556492ce8ae7207338105aa984ccab177e64b141579f0c"
            },
            "downloads": -1,
            "filename": "json_prompt_formatter-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1f553007438743eb65164d1d19caed6d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 28060,
            "upload_time": "2025-08-02T10:35:24",
            "upload_time_iso_8601": "2025-08-02T10:35:24.129474Z",
            "url": "https://files.pythonhosted.org/packages/3d/6a/dbe895d6a4ea09e9b6b71f4e00d2fcd2fbb311b656250af24e60a27c1237/json_prompt_formatter-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d6a85a1a38bf93d0a9427176d9fe239a20e4eb8c26e2295c72c41b8aef65c774",
                "md5": "ab23f196f38e4e856badb98b732c6c08",
                "sha256": "45da39f8af4a78939641f0af7614d07e85a35c3fff90ba1907aa1da156c17529"
            },
            "downloads": -1,
            "filename": "json_prompt_formatter-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "ab23f196f38e4e856badb98b732c6c08",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 26516,
            "upload_time": "2025-08-02T10:35:25",
            "upload_time_iso_8601": "2025-08-02T10:35:25.908378Z",
            "url": "https://files.pythonhosted.org/packages/d6/a8/5a1a38bf93d0a9427176d9fe239a20e4eb8c26e2295c72c41b8aef65c774/json_prompt_formatter-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-02 10:35:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "SemTiOne",
    "github_project": "json_prompt_formatter",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "json-prompt-formatter"
}
        
Elapsed time: 1.61962s