ostruct-cli 0.7.0__tar.gz → 0.7.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/PKG-INFO +63 -4
  2. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/README.md +60 -2
  3. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/pyproject.toml +3 -2
  4. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/LICENSE +0 -0
  5. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/__init__.py +0 -0
  6. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/__init__.py +0 -0
  7. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/base_errors.py +0 -0
  8. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/cache_manager.py +0 -0
  9. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/cli.py +0 -0
  10. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/click_options.py +0 -0
  11. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/errors.py +0 -0
  12. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/exit_codes.py +0 -0
  13. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/file_info.py +0 -0
  14. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/file_list.py +0 -0
  15. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/file_utils.py +0 -0
  16. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/model_creation.py +0 -0
  17. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/path_utils.py +0 -0
  18. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/progress.py +0 -0
  19. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/registry_updates.py +0 -0
  20. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/schema_validation.py +0 -0
  21. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/security/__init__.py +0 -0
  22. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/security/allowed_checker.py +0 -0
  23. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/security/base.py +0 -0
  24. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/security/case_manager.py +0 -0
  25. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/security/errors.py +0 -0
  26. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/security/normalization.py +0 -0
  27. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/security/safe_joiner.py +0 -0
  28. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/security/security_manager.py +0 -0
  29. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/security/symlink_resolver.py +0 -0
  30. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/security/types.py +0 -0
  31. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/security/windows_paths.py +0 -0
  32. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/serialization.py +0 -0
  33. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/template_env.py +0 -0
  34. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/template_extensions.py +0 -0
  35. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/template_filters.py +0 -0
  36. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/template_io.py +0 -0
  37. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/template_rendering.py +0 -0
  38. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/template_schema.py +0 -0
  39. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/template_utils.py +0 -0
  40. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/template_validation.py +0 -0
  41. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/token_utils.py +0 -0
  42. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/utils.py +0 -0
  43. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/cli/validators.py +0 -0
  44. {ostruct_cli-0.7.0 → ostruct_cli-0.7.1}/src/ostruct/py.typed +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: ostruct-cli
3
- Version: 0.7.0
3
+ Version: 0.7.1
4
4
  Summary: CLI for OpenAI Structured Output
5
5
  Author: Yaniv Golan
6
6
  Author-email: yaniv@golan.name
@@ -16,8 +16,9 @@ Requires-Dist: click (>=8.1.7,<9.0.0)
16
16
  Requires-Dist: ijson (>=3.2.3,<4.0.0)
17
17
  Requires-Dist: jsonschema (>=4.23.0,<5.0.0)
18
18
  Requires-Dist: openai (>=1.0.0,<2.0.0)
19
- Requires-Dist: openai-structured (>=2.1.0,<3.0.0)
19
+ Requires-Dist: openai-structured (>=3.0.0,<4.0.0)
20
20
  Requires-Dist: pydantic (>=2.6.3,<3.0.0)
21
+ Requires-Dist: pygments (>=2.15.0,<3.0.0)
21
22
  Requires-Dist: pyyaml (>=6.0.2,<7.0.0)
22
23
  Requires-Dist: tiktoken (==0.9.0)
23
24
  Requires-Dist: tomli (>=2.0.1,<3.0.0) ; python_version < "3.11"
@@ -25,7 +26,9 @@ Requires-Dist: typing-extensions (>=4.9.0,<5.0.0)
25
26
  Requires-Dist: werkzeug (>=3.1.3,<4.0.0)
26
27
  Description-Content-Type: text/markdown
27
28
 
28
- # ostruct-cli
29
+ ![ostruct](src/assets/ostruct-header.png)
30
+
31
+ <div align="center">
29
32
 
30
33
  [![PyPI version](https://badge.fury.io/py/ostruct-cli.svg)](https://badge.fury.io/py/ostruct-cli)
31
34
  [![Python Versions](https://img.shields.io/pypi/pyversions/ostruct-cli.svg)](https://pypi.org/project/ostruct-cli)
@@ -33,10 +36,66 @@ Description-Content-Type: text/markdown
33
36
  [![CI](https://github.com/yaniv-golan/ostruct/actions/workflows/ci.yml/badge.svg)](https://github.com/yaniv-golan/ostruct/actions/workflows/ci.yml)
34
37
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
35
38
 
36
- ostruct tranforms unstructured inputs into structured, usable JSON output using OpenAI APIs.
39
+ **ostruct** tranforms **unstructured** inputs into **structured**, usable **JSON** output using **OpenAI APIs** using dynamic **templates**
40
+
41
+ </div>
42
+
43
+ # ostruct-cli
37
44
 
38
45
  ostruct will process a set of plain text files (data, source code, CSV, etc), input variables, a dynamic prompt template, and a JSON schema specifying the desired output format, and will produce the result in JSON format.
39
46
 
47
+ <div align="center">
48
+
49
+ ![How ostruct works](src/assets/ostrict-hl-diagram.png)
50
+
51
+ </div>
52
+
53
+ ## Why ostruct?
54
+
55
+ LLMs are powerful, but getting consistent, structured output from them can be challenging. ostruct solves this problem by providing a streamlined approach to transform unstructured data into reliable JSON structures. The motivation behind creating ostruct was to:
56
+
57
+ - **Bridge the gap** between freeform LLM capabilities and structured data needs in production systems
58
+ - **Simplify integration** of AI into existing workflows and applications that expect consistent data formats
59
+ - **Ensure reliability** and validate output against a defined schema to avoid unexpected formats or missing data
60
+ - **Reduce development time** by providing a standardized way to interact with OpenAI models for structured outputs
61
+ - **Enable non-developers** to leverage AI capabilities through a simple CLI interface with templates
62
+
63
+ ## Real-World Use Cases
64
+
65
+ ostruct can be used for various scenarios, including:
66
+
67
+ ### Etymology Analysis
68
+
69
+ ```bash
70
+ ostruct run prompts/task.j2 schemas/etymology.json -f input examples/scientific.txt --model gpt-4o
71
+ ```
72
+
73
+ Break down words into their components, showing their origins, meanings, and hierarchical relationships. Useful for linguistics, educational tools, and understanding terminology in specialized fields.
74
+
75
+ ### Automated Code Review
76
+
77
+ ```bash
78
+ ostruct run prompts/task.j2 schemas/code_review.json -p source "examples/security/*.py" --model gpt-4o
79
+ ```
80
+
81
+ Analyze code for security vulnerabilities, style issues, and performance problems, producing structured reports that can be easily integrated into CI/CD pipelines or developer workflows.
82
+
83
+ ### Security Vulnerability Scanning
84
+
85
+ ```bash
86
+ ostruct run prompts/task.j2 schemas/scan_result.json -d examples/intermediate --model gpt-4o
87
+ ```
88
+
89
+ Scan codebases for security vulnerabilities, combining static analysis with AI-powered reasoning to identify potential issues, suggest fixes, and provide detailed explanations.
90
+
91
+ ### Configuration Validation & Analysis
92
+
93
+ ```bash
94
+ ostruct run prompts/task.j2 schemas/validation_result.json -f dev examples/basic/dev.yaml -f prod examples/basic/prod.yaml
95
+ ```
96
+
97
+ Validate configuration files across environments, check for inconsistencies, and provide intelligent feedback on potential issues or improvements in infrastructure setups.
98
+
40
99
  ## Features
41
100
 
42
101
  - Generate structured JSON output from natural language using OpenAI models and a JSON schema
@@ -1,4 +1,6 @@
1
- # ostruct-cli
1
+ ![ostruct](src/assets/ostruct-header.png)
2
+
3
+ <div align="center">
2
4
 
3
5
  [![PyPI version](https://badge.fury.io/py/ostruct-cli.svg)](https://badge.fury.io/py/ostruct-cli)
4
6
  [![Python Versions](https://img.shields.io/pypi/pyversions/ostruct-cli.svg)](https://pypi.org/project/ostruct-cli)
@@ -6,10 +8,66 @@
6
8
  [![CI](https://github.com/yaniv-golan/ostruct/actions/workflows/ci.yml/badge.svg)](https://github.com/yaniv-golan/ostruct/actions/workflows/ci.yml)
7
9
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8
10
 
9
- ostruct tranforms unstructured inputs into structured, usable JSON output using OpenAI APIs.
11
+ **ostruct** tranforms **unstructured** inputs into **structured**, usable **JSON** output using **OpenAI APIs** using dynamic **templates**
12
+
13
+ </div>
14
+
15
+ # ostruct-cli
10
16
 
11
17
  ostruct will process a set of plain text files (data, source code, CSV, etc), input variables, a dynamic prompt template, and a JSON schema specifying the desired output format, and will produce the result in JSON format.
12
18
 
19
+ <div align="center">
20
+
21
+ ![How ostruct works](src/assets/ostrict-hl-diagram.png)
22
+
23
+ </div>
24
+
25
+ ## Why ostruct?
26
+
27
+ LLMs are powerful, but getting consistent, structured output from them can be challenging. ostruct solves this problem by providing a streamlined approach to transform unstructured data into reliable JSON structures. The motivation behind creating ostruct was to:
28
+
29
+ - **Bridge the gap** between freeform LLM capabilities and structured data needs in production systems
30
+ - **Simplify integration** of AI into existing workflows and applications that expect consistent data formats
31
+ - **Ensure reliability** and validate output against a defined schema to avoid unexpected formats or missing data
32
+ - **Reduce development time** by providing a standardized way to interact with OpenAI models for structured outputs
33
+ - **Enable non-developers** to leverage AI capabilities through a simple CLI interface with templates
34
+
35
+ ## Real-World Use Cases
36
+
37
+ ostruct can be used for various scenarios, including:
38
+
39
+ ### Etymology Analysis
40
+
41
+ ```bash
42
+ ostruct run prompts/task.j2 schemas/etymology.json -f input examples/scientific.txt --model gpt-4o
43
+ ```
44
+
45
+ Break down words into their components, showing their origins, meanings, and hierarchical relationships. Useful for linguistics, educational tools, and understanding terminology in specialized fields.
46
+
47
+ ### Automated Code Review
48
+
49
+ ```bash
50
+ ostruct run prompts/task.j2 schemas/code_review.json -p source "examples/security/*.py" --model gpt-4o
51
+ ```
52
+
53
+ Analyze code for security vulnerabilities, style issues, and performance problems, producing structured reports that can be easily integrated into CI/CD pipelines or developer workflows.
54
+
55
+ ### Security Vulnerability Scanning
56
+
57
+ ```bash
58
+ ostruct run prompts/task.j2 schemas/scan_result.json -d examples/intermediate --model gpt-4o
59
+ ```
60
+
61
+ Scan codebases for security vulnerabilities, combining static analysis with AI-powered reasoning to identify potential issues, suggest fixes, and provide detailed explanations.
62
+
63
+ ### Configuration Validation & Analysis
64
+
65
+ ```bash
66
+ ostruct run prompts/task.j2 schemas/validation_result.json -f dev examples/basic/dev.yaml -f prod examples/basic/prod.yaml
67
+ ```
68
+
69
+ Validate configuration files across environments, check for inconsistencies, and provide intelligent feedback on potential issues or improvements in infrastructure setups.
70
+
13
71
  ## Features
14
72
 
15
73
  - Generate structured JSON output from natural language using OpenAI models and a JSON schema
@@ -4,7 +4,7 @@
4
4
 
5
5
  [tool.poetry]
6
6
  name = "ostruct-cli"
7
- version = "0.7.0"
7
+ version = "0.7.1"
8
8
  description = "CLI for OpenAI Structured Output"
9
9
  authors = ["Yaniv Golan <yaniv@golan.name>"]
10
10
  readme = "README.md"
@@ -24,8 +24,9 @@
24
24
  click = "^8.1.7"
25
25
  werkzeug = "^3.1.3"
26
26
  openai = "^1.0.0"
27
- openai-structured = "^2.1.0"
27
+ openai-structured = "^3.0.0"
28
28
  tiktoken = "0.9.0"
29
+ pygments = "^2.15.0"
29
30
 
30
31
  [tool.poetry.scripts]
31
32
  ostruct = "ostruct.cli.cli:main"
File without changes