ostruct-cli 0.7.0__py3-none-any.whl → 0.7.2__py3-none-any.whl
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.
- {ostruct_cli-0.7.0.dist-info → ostruct_cli-0.7.2.dist-info}/METADATA +64 -4
- {ostruct_cli-0.7.0.dist-info → ostruct_cli-0.7.2.dist-info}/RECORD +5 -5
- {ostruct_cli-0.7.0.dist-info → ostruct_cli-0.7.2.dist-info}/LICENSE +0 -0
- {ostruct_cli-0.7.0.dist-info → ostruct_cli-0.7.2.dist-info}/WHEEL +0 -0
- {ostruct_cli-0.7.0.dist-info → ostruct_cli-0.7.2.dist-info}/entry_points.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: ostruct-cli
|
3
|
-
Version: 0.7.
|
3
|
+
Version: 0.7.2
|
4
4
|
Summary: CLI for OpenAI Structured Output
|
5
5
|
Author: Yaniv Golan
|
6
6
|
Author-email: yaniv@golan.name
|
@@ -14,10 +14,12 @@ Requires-Dist: cachetools (>=5.3.2,<6.0.0)
|
|
14
14
|
Requires-Dist: chardet (>=5.0.0,<6.0.0)
|
15
15
|
Requires-Dist: click (>=8.1.7,<9.0.0)
|
16
16
|
Requires-Dist: ijson (>=3.2.3,<4.0.0)
|
17
|
+
Requires-Dist: jinja2 (>=3.1.2,<4.0.0)
|
17
18
|
Requires-Dist: jsonschema (>=4.23.0,<5.0.0)
|
18
19
|
Requires-Dist: openai (>=1.0.0,<2.0.0)
|
19
|
-
Requires-Dist: openai-structured (>=
|
20
|
+
Requires-Dist: openai-structured (>=3.0.0,<4.0.0)
|
20
21
|
Requires-Dist: pydantic (>=2.6.3,<3.0.0)
|
22
|
+
Requires-Dist: pygments (>=2.15.0,<3.0.0)
|
21
23
|
Requires-Dist: pyyaml (>=6.0.2,<7.0.0)
|
22
24
|
Requires-Dist: tiktoken (==0.9.0)
|
23
25
|
Requires-Dist: tomli (>=2.0.1,<3.0.0) ; python_version < "3.11"
|
@@ -25,7 +27,9 @@ Requires-Dist: typing-extensions (>=4.9.0,<5.0.0)
|
|
25
27
|
Requires-Dist: werkzeug (>=3.1.3,<4.0.0)
|
26
28
|
Description-Content-Type: text/markdown
|
27
29
|
|
28
|
-
|
30
|
+

|
31
|
+
|
32
|
+
<div align="center">
|
29
33
|
|
30
34
|
[](https://badge.fury.io/py/ostruct-cli)
|
31
35
|
[](https://pypi.org/project/ostruct-cli)
|
@@ -33,10 +37,66 @@ Description-Content-Type: text/markdown
|
|
33
37
|
[](https://github.com/yaniv-golan/ostruct/actions/workflows/ci.yml)
|
34
38
|
[](https://opensource.org/licenses/MIT)
|
35
39
|
|
36
|
-
ostruct tranforms unstructured inputs into structured
|
40
|
+
**ostruct** tranforms **unstructured** inputs into **structured**, usable **JSON** output using **OpenAI APIs** using dynamic **templates**
|
41
|
+
|
42
|
+
</div>
|
43
|
+
|
44
|
+
# ostruct-cli
|
37
45
|
|
38
46
|
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
47
|
|
48
|
+
<div align="center">
|
49
|
+
|
50
|
+

|
51
|
+
|
52
|
+
</div>
|
53
|
+
|
54
|
+
## Why ostruct?
|
55
|
+
|
56
|
+
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:
|
57
|
+
|
58
|
+
- **Bridge the gap** between freeform LLM capabilities and structured data needs in production systems
|
59
|
+
- **Simplify integration** of AI into existing workflows and applications that expect consistent data formats
|
60
|
+
- **Ensure reliability** and validate output against a defined schema to avoid unexpected formats or missing data
|
61
|
+
- **Reduce development time** by providing a standardized way to interact with OpenAI models for structured outputs
|
62
|
+
- **Enable non-developers** to leverage AI capabilities through a simple CLI interface with templates
|
63
|
+
|
64
|
+
## Real-World Use Cases
|
65
|
+
|
66
|
+
ostruct can be used for various scenarios, including:
|
67
|
+
|
68
|
+
### Etymology Analysis
|
69
|
+
|
70
|
+
```bash
|
71
|
+
ostruct run prompts/task.j2 schemas/etymology.json -f input examples/scientific.txt --model gpt-4o
|
72
|
+
```
|
73
|
+
|
74
|
+
Break down words into their components, showing their origins, meanings, and hierarchical relationships. Useful for linguistics, educational tools, and understanding terminology in specialized fields.
|
75
|
+
|
76
|
+
### Automated Code Review
|
77
|
+
|
78
|
+
```bash
|
79
|
+
ostruct run prompts/task.j2 schemas/code_review.json -p source "examples/security/*.py" --model gpt-4o
|
80
|
+
```
|
81
|
+
|
82
|
+
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.
|
83
|
+
|
84
|
+
### Security Vulnerability Scanning
|
85
|
+
|
86
|
+
```bash
|
87
|
+
ostruct run prompts/task.j2 schemas/scan_result.json -d examples/intermediate --model gpt-4o
|
88
|
+
```
|
89
|
+
|
90
|
+
Scan codebases for security vulnerabilities, combining static analysis with AI-powered reasoning to identify potential issues, suggest fixes, and provide detailed explanations.
|
91
|
+
|
92
|
+
### Configuration Validation & Analysis
|
93
|
+
|
94
|
+
```bash
|
95
|
+
ostruct run prompts/task.j2 schemas/validation_result.json -f dev examples/basic/dev.yaml -f prod examples/basic/prod.yaml
|
96
|
+
```
|
97
|
+
|
98
|
+
Validate configuration files across environments, check for inconsistencies, and provide intelligent feedback on potential issues or improvements in infrastructure setups.
|
99
|
+
|
40
100
|
## Features
|
41
101
|
|
42
102
|
- Generate structured JSON output from natural language using OpenAI models and a JSON schema
|
@@ -38,8 +38,8 @@ ostruct/cli/token_utils.py,sha256=r4KPEO3Sec18Q6mU0aClK6XGShvusgUggXEQgEPPlaA,13
|
|
38
38
|
ostruct/cli/utils.py,sha256=uY7c0NaINHWfnl77FcPE3TmYUXv3RqEeUTjrCMDij9A,922
|
39
39
|
ostruct/cli/validators.py,sha256=k-vmBjkPmC-VwSTM5Yq1zQjGSIOzzTHS4kc0B7Aqpck,3186
|
40
40
|
ostruct/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
41
|
-
ostruct_cli-0.7.
|
42
|
-
ostruct_cli-0.7.
|
43
|
-
ostruct_cli-0.7.
|
44
|
-
ostruct_cli-0.7.
|
45
|
-
ostruct_cli-0.7.
|
41
|
+
ostruct_cli-0.7.2.dist-info/LICENSE,sha256=QUOY6QCYVxAiH8vdrUTDqe3i9hQ5bcNczppDSVpLTjk,1068
|
42
|
+
ostruct_cli-0.7.2.dist-info/METADATA,sha256=iJHa7gp6eLDvHQMKtuReyMRPmgJESKiNzx-PHMxw9d0,11154
|
43
|
+
ostruct_cli-0.7.2.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
44
|
+
ostruct_cli-0.7.2.dist-info/entry_points.txt,sha256=NFq9IuqHVTem0j9zKjV8C1si_zGcP1RL6Wbvt9fUDXw,48
|
45
|
+
ostruct_cli-0.7.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|