python-infrakit-dev 0.1.3__tar.gz → 0.1.5__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.
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/.gitignore +2 -1
- python_infrakit_dev-0.1.3/README.md → python_infrakit_dev-0.1.5/PKG-INFO +124 -3
- python_infrakit_dev-0.1.3/PKG-INFO → python_infrakit_dev-0.1.5/README.md +102 -20
- python_infrakit_dev-0.1.5/infrakit/__init__.py +74 -0
- python_infrakit_dev-0.1.5/infrakit/cli/__init__.py +5 -0
- python_infrakit_dev-0.1.5/infrakit/cli/commands/__init__.py +19 -0
- python_infrakit_dev-0.1.5/infrakit/core/__init__.py +46 -0
- python_infrakit_dev-0.1.5/infrakit/core/config/__init__.py +71 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/scaffolder/generator.py +1 -1
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/pyproject.toml +12 -5
- python_infrakit_dev-0.1.3/.claude/settings.local.json +0 -7
- python_infrakit_dev-0.1.3/infrakit/cli/__init__.py +0 -1
- python_infrakit_dev-0.1.3/infrakit/cli/commands/__init__.py +0 -1
- python_infrakit_dev-0.1.3/tests/core/__init__.py +0 -0
- python_infrakit_dev-0.1.3/tests/core/config/__init__.py +0 -0
- python_infrakit_dev-0.1.3/tests/core/logger/__init__.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/.python-version +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/cli/commands/config.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/cli/commands/deps.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/cli/commands/init.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/cli/commands/llm.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/cli/commands/logger.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/cli/commands/module.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/cli/commands/time.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/cli/main.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/core/config/converter.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/core/config/exporter.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/core/config/loader.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/core/config/validator.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/core/logger/__init__.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/core/logger/formatters.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/core/logger/handlers.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/core/logger/retention.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/core/logger/setup.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/deps/__init__.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/deps/clean.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/deps/depfile.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/deps/health.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/deps/optimizer.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/deps/scanner.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/llm/__init__.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/llm/batch.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/llm/client.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/llm/key_manager.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/llm/llm_readme.md +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/llm/models.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/llm/providers/__init__.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/llm/providers/base.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/llm/providers/gemini.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/llm/providers/openai.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/llm/rate_limiter.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/scaffolder/__init__.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/scaffolder/ai.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/scaffolder/backend.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/scaffolder/cli_tool.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/scaffolder/pipeline.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/scaffolder/registry.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/time/__init__.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/infrakit/time/profiler.py +0 -0
- {python_infrakit_dev-0.1.3/infrakit → python_infrakit_dev-0.1.5/tests}/__init__.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/tests/cli/__init__.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/tests/cli/conftest.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/tests/cli/test_config.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/tests/cli/test_init.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/tests/cli/test_logger.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/tests/cli/test_module.py +0 -0
- {python_infrakit_dev-0.1.3/infrakit → python_infrakit_dev-0.1.5/tests}/core/__init__.py +0 -0
- {python_infrakit_dev-0.1.3/infrakit → python_infrakit_dev-0.1.5/tests}/core/config/__init__.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/tests/core/config/test_converter.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/tests/core/config/test_exporter.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/tests/core/config/test_loader.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/tests/core/config/test_validator.py +0 -0
- {python_infrakit_dev-0.1.3/tests → python_infrakit_dev-0.1.5/tests/core/logger}/__init__.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/tests/core/logger/test_formatters.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/tests/core/logger/test_handler.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/tests/core/logger/test_retention.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/tests/core/logger/test_setup.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/tests/test_llm.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/tests/test_scaffolders.py +0 -0
- {python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/tests/test_time.py +0 -0
|
@@ -1,12 +1,88 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: python-infrakit-dev
|
|
3
|
+
Version: 0.1.5
|
|
4
|
+
Summary: A comprehensive Python developer infrastructure toolkit
|
|
5
|
+
Project-URL: Homepage, https://github.com/chiragg21/infrakit
|
|
6
|
+
Project-URL: Repository, https://github.com/chiragg21/infrakit
|
|
7
|
+
Requires-Python: >=3.10
|
|
8
|
+
Requires-Dist: isort>=8.0.1
|
|
9
|
+
Requires-Dist: pydantic>=2.12.5
|
|
10
|
+
Requires-Dist: python-dotenv>=1.2.2
|
|
11
|
+
Requires-Dist: pyyaml>=6.0.3
|
|
12
|
+
Requires-Dist: typer>=0.24.1
|
|
13
|
+
Provides-Extra: all
|
|
14
|
+
Requires-Dist: google-genai>=1.69.0; extra == 'all'
|
|
15
|
+
Requires-Dist: openai>=2.30.0; extra == 'all'
|
|
16
|
+
Requires-Dist: tqdm>=4.67.3; extra == 'all'
|
|
17
|
+
Provides-Extra: llm
|
|
18
|
+
Requires-Dist: google-genai>=1.69.0; extra == 'llm'
|
|
19
|
+
Requires-Dist: openai>=2.30.0; extra == 'llm'
|
|
20
|
+
Requires-Dist: tqdm>=4.67.3; extra == 'llm'
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
|
|
1
23
|
# Infrakit
|
|
2
24
|
|
|
3
25
|
A modular developer toolkit for Python — project scaffolding, logging, config loading, a multi-provider LLM client, and dependency utilities.
|
|
4
26
|
|
|
27
|
+
**Requires Python 3.10+**
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
**Core** — scaffolding, config, logging, deps, profiling, and CLI:
|
|
34
|
+
|
|
5
35
|
```bash
|
|
6
|
-
pip install infrakit
|
|
36
|
+
pip install python-infrakit-dev
|
|
7
37
|
```
|
|
8
38
|
|
|
9
|
-
|
|
39
|
+
**With LLM support** — adds OpenAI and Gemini providers:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pip install python-infrakit-dev[llm]
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Everything:**
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pip install python-infrakit-dev[all]
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The CLI is available as both `infrakit` and `ik`.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Quick Imports
|
|
56
|
+
|
|
57
|
+
Most public symbols are available directly from the top-level package:
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
# Logging
|
|
61
|
+
from infrakit import setup, get_logger
|
|
62
|
+
|
|
63
|
+
# Config
|
|
64
|
+
from infrakit import load, load_env, validate, Schema, field
|
|
65
|
+
|
|
66
|
+
# Config conversion / export
|
|
67
|
+
from infrakit import convert_file, convert_dict, export_file, export_dict
|
|
68
|
+
|
|
69
|
+
# LLM (requires infrakit[llm])
|
|
70
|
+
from infrakit import LLMClient, Prompt, QuotaConfig
|
|
71
|
+
|
|
72
|
+
# Subpackages
|
|
73
|
+
from infrakit import deps, scaffolder, time
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Or import from the specific subpackages:
|
|
77
|
+
|
|
78
|
+
```python
|
|
79
|
+
from infrakit.core.config import load, validate, convert_dict, export_file
|
|
80
|
+
from infrakit.core.logger import setup, get_logger
|
|
81
|
+
from infrakit.llm import LLMClient, Prompt
|
|
82
|
+
from infrakit.deps import scan, export, check, clean, optimise
|
|
83
|
+
from infrakit.scaffolder import scaffold_basic, scaffold_ai, scaffold_backend
|
|
84
|
+
from infrakit.time import pipeline_profiler, track
|
|
85
|
+
```
|
|
10
86
|
|
|
11
87
|
---
|
|
12
88
|
|
|
@@ -43,7 +119,7 @@ Every template generates a config file pre-populated with the variables its util
|
|
|
43
119
|
### Config loader
|
|
44
120
|
|
|
45
121
|
```python
|
|
46
|
-
from infrakit.core.config
|
|
122
|
+
from infrakit.core.config import load, load_env
|
|
47
123
|
|
|
48
124
|
cfg = load_env(".env", cast_values=True) # "true" → bool, "42" → int
|
|
49
125
|
cfg = load("config.yaml")
|
|
@@ -67,6 +143,49 @@ port = cfg.get("APP_PORT", 8000)
|
|
|
67
143
|
|
|
68
144
|
---
|
|
69
145
|
|
|
146
|
+
### Config validation
|
|
147
|
+
|
|
148
|
+
```python
|
|
149
|
+
from infrakit.core.config import validate, Schema, field
|
|
150
|
+
from pydantic import BaseModel
|
|
151
|
+
|
|
152
|
+
# Pydantic model
|
|
153
|
+
class AppConfig(BaseModel):
|
|
154
|
+
host: str
|
|
155
|
+
port: int
|
|
156
|
+
debug: bool = False
|
|
157
|
+
|
|
158
|
+
result = validate({"host": "localhost", "port": 8080}, AppConfig)
|
|
159
|
+
if result.ok:
|
|
160
|
+
cfg = result.data # fully typed AppConfig instance
|
|
161
|
+
|
|
162
|
+
# Lightweight dict schema (no Pydantic model needed)
|
|
163
|
+
schema = Schema({
|
|
164
|
+
"host": field(str, required=True),
|
|
165
|
+
"port": field(int, required=True),
|
|
166
|
+
"debug": field(bool, required=False, default=False),
|
|
167
|
+
})
|
|
168
|
+
result = schema.validate({"host": "localhost", "port": 8080})
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
### Config conversion and export
|
|
174
|
+
|
|
175
|
+
```python
|
|
176
|
+
from infrakit.core.config import convert_file, convert_dict, export_file, export_dict
|
|
177
|
+
|
|
178
|
+
# Convert between formats
|
|
179
|
+
convert_file("config.yaml", "config.ini")
|
|
180
|
+
output, warnings = convert_dict(data, from_format="yaml", to_format="env")
|
|
181
|
+
|
|
182
|
+
# Sanitize config for sharing (replaces all values with YOUR_VALUE_HERE)
|
|
183
|
+
export_file("config.yaml", ".env.example", to_format="env")
|
|
184
|
+
safe = export_dict({"PORT": 8080, "SECRET": "abc"}, to_format="env")
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
70
189
|
### Logger
|
|
71
190
|
|
|
72
191
|
```python
|
|
@@ -99,6 +218,8 @@ log.info("started on port %d", 8080)
|
|
|
99
218
|
|
|
100
219
|
## LLM Client
|
|
101
220
|
|
|
221
|
+
> Requires `pip install python-infrakit-dev[llm]`
|
|
222
|
+
|
|
102
223
|
A unified client for **OpenAI** and **Gemini** with key rotation, rate limiting, quota tracking, and async/batch generation.
|
|
103
224
|
|
|
104
225
|
```python
|
|
@@ -1,29 +1,66 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: python-infrakit-dev
|
|
3
|
-
Version: 0.1.3
|
|
4
|
-
Summary: A comprehensive Python developer infrastructure toolkit
|
|
5
|
-
Project-URL: Homepage, https://github.com/chiragg21/infrakit
|
|
6
|
-
Project-URL: Repository, https://github.com/chiragg21/infrakit
|
|
7
|
-
Requires-Python: >=3.13
|
|
8
|
-
Requires-Dist: google-genai>=1.69.0
|
|
9
|
-
Requires-Dist: isort>=8.0.1
|
|
10
|
-
Requires-Dist: openai>=2.30.0
|
|
11
|
-
Requires-Dist: pydantic>=2.12.5
|
|
12
|
-
Requires-Dist: python-dotenv>=1.2.2
|
|
13
|
-
Requires-Dist: pyyaml>=6.0.3
|
|
14
|
-
Requires-Dist: tqdm>=4.67.3
|
|
15
|
-
Requires-Dist: typer>=0.24.1
|
|
16
|
-
Description-Content-Type: text/markdown
|
|
17
|
-
|
|
18
1
|
# Infrakit
|
|
19
2
|
|
|
20
3
|
A modular developer toolkit for Python — project scaffolding, logging, config loading, a multi-provider LLM client, and dependency utilities.
|
|
21
4
|
|
|
5
|
+
**Requires Python 3.10+**
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
**Core** — scaffolding, config, logging, deps, profiling, and CLI:
|
|
12
|
+
|
|
22
13
|
```bash
|
|
23
|
-
pip install infrakit
|
|
14
|
+
pip install python-infrakit-dev
|
|
24
15
|
```
|
|
25
16
|
|
|
26
|
-
|
|
17
|
+
**With LLM support** — adds OpenAI and Gemini providers:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pip install python-infrakit-dev[llm]
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Everything:**
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pip install python-infrakit-dev[all]
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The CLI is available as both `infrakit` and `ik`.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Quick Imports
|
|
34
|
+
|
|
35
|
+
Most public symbols are available directly from the top-level package:
|
|
36
|
+
|
|
37
|
+
```python
|
|
38
|
+
# Logging
|
|
39
|
+
from infrakit import setup, get_logger
|
|
40
|
+
|
|
41
|
+
# Config
|
|
42
|
+
from infrakit import load, load_env, validate, Schema, field
|
|
43
|
+
|
|
44
|
+
# Config conversion / export
|
|
45
|
+
from infrakit import convert_file, convert_dict, export_file, export_dict
|
|
46
|
+
|
|
47
|
+
# LLM (requires infrakit[llm])
|
|
48
|
+
from infrakit import LLMClient, Prompt, QuotaConfig
|
|
49
|
+
|
|
50
|
+
# Subpackages
|
|
51
|
+
from infrakit import deps, scaffolder, time
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Or import from the specific subpackages:
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
from infrakit.core.config import load, validate, convert_dict, export_file
|
|
58
|
+
from infrakit.core.logger import setup, get_logger
|
|
59
|
+
from infrakit.llm import LLMClient, Prompt
|
|
60
|
+
from infrakit.deps import scan, export, check, clean, optimise
|
|
61
|
+
from infrakit.scaffolder import scaffold_basic, scaffold_ai, scaffold_backend
|
|
62
|
+
from infrakit.time import pipeline_profiler, track
|
|
63
|
+
```
|
|
27
64
|
|
|
28
65
|
---
|
|
29
66
|
|
|
@@ -60,7 +97,7 @@ Every template generates a config file pre-populated with the variables its util
|
|
|
60
97
|
### Config loader
|
|
61
98
|
|
|
62
99
|
```python
|
|
63
|
-
from infrakit.core.config
|
|
100
|
+
from infrakit.core.config import load, load_env
|
|
64
101
|
|
|
65
102
|
cfg = load_env(".env", cast_values=True) # "true" → bool, "42" → int
|
|
66
103
|
cfg = load("config.yaml")
|
|
@@ -84,6 +121,49 @@ port = cfg.get("APP_PORT", 8000)
|
|
|
84
121
|
|
|
85
122
|
---
|
|
86
123
|
|
|
124
|
+
### Config validation
|
|
125
|
+
|
|
126
|
+
```python
|
|
127
|
+
from infrakit.core.config import validate, Schema, field
|
|
128
|
+
from pydantic import BaseModel
|
|
129
|
+
|
|
130
|
+
# Pydantic model
|
|
131
|
+
class AppConfig(BaseModel):
|
|
132
|
+
host: str
|
|
133
|
+
port: int
|
|
134
|
+
debug: bool = False
|
|
135
|
+
|
|
136
|
+
result = validate({"host": "localhost", "port": 8080}, AppConfig)
|
|
137
|
+
if result.ok:
|
|
138
|
+
cfg = result.data # fully typed AppConfig instance
|
|
139
|
+
|
|
140
|
+
# Lightweight dict schema (no Pydantic model needed)
|
|
141
|
+
schema = Schema({
|
|
142
|
+
"host": field(str, required=True),
|
|
143
|
+
"port": field(int, required=True),
|
|
144
|
+
"debug": field(bool, required=False, default=False),
|
|
145
|
+
})
|
|
146
|
+
result = schema.validate({"host": "localhost", "port": 8080})
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
### Config conversion and export
|
|
152
|
+
|
|
153
|
+
```python
|
|
154
|
+
from infrakit.core.config import convert_file, convert_dict, export_file, export_dict
|
|
155
|
+
|
|
156
|
+
# Convert between formats
|
|
157
|
+
convert_file("config.yaml", "config.ini")
|
|
158
|
+
output, warnings = convert_dict(data, from_format="yaml", to_format="env")
|
|
159
|
+
|
|
160
|
+
# Sanitize config for sharing (replaces all values with YOUR_VALUE_HERE)
|
|
161
|
+
export_file("config.yaml", ".env.example", to_format="env")
|
|
162
|
+
safe = export_dict({"PORT": 8080, "SECRET": "abc"}, to_format="env")
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
87
167
|
### Logger
|
|
88
168
|
|
|
89
169
|
```python
|
|
@@ -116,6 +196,8 @@ log.info("started on port %d", 8080)
|
|
|
116
196
|
|
|
117
197
|
## LLM Client
|
|
118
198
|
|
|
199
|
+
> Requires `pip install python-infrakit-dev[llm]`
|
|
200
|
+
|
|
119
201
|
A unified client for **OpenAI** and **Gemini** with key rotation, rate limiting, quota tracking, and async/batch generation.
|
|
120
202
|
|
|
121
203
|
```python
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"""
|
|
2
|
+
infrakit
|
|
3
|
+
~~~~~~~~
|
|
4
|
+
A comprehensive Python developer infrastructure toolkit.
|
|
5
|
+
|
|
6
|
+
Quick imports::
|
|
7
|
+
|
|
8
|
+
# Logging
|
|
9
|
+
from infrakit import setup, get_logger
|
|
10
|
+
|
|
11
|
+
# Config
|
|
12
|
+
from infrakit import load, validate
|
|
13
|
+
|
|
14
|
+
# LLM
|
|
15
|
+
from infrakit import LLMClient
|
|
16
|
+
|
|
17
|
+
# Dependencies
|
|
18
|
+
from infrakit import deps
|
|
19
|
+
|
|
20
|
+
# Scaffolding
|
|
21
|
+
from infrakit import scaffolder
|
|
22
|
+
|
|
23
|
+
# Profiling
|
|
24
|
+
from infrakit import time
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
from infrakit.core.logger.setup import setup, get_logger, reset
|
|
28
|
+
from infrakit.core.config import (
|
|
29
|
+
load,
|
|
30
|
+
load_env,
|
|
31
|
+
validate,
|
|
32
|
+
Schema,
|
|
33
|
+
field,
|
|
34
|
+
convert_file,
|
|
35
|
+
convert_dict,
|
|
36
|
+
export_file,
|
|
37
|
+
export_dict,
|
|
38
|
+
export_string,
|
|
39
|
+
)
|
|
40
|
+
from infrakit import deps, scaffolder, time
|
|
41
|
+
|
|
42
|
+
try:
|
|
43
|
+
from infrakit.llm import LLMClient, LLMResponse, Prompt, QuotaConfig
|
|
44
|
+
_LLM_AVAILABLE = True
|
|
45
|
+
except ImportError:
|
|
46
|
+
_LLM_AVAILABLE = False
|
|
47
|
+
|
|
48
|
+
__version__ = "0.1.4"
|
|
49
|
+
|
|
50
|
+
__all__ = [
|
|
51
|
+
"__version__",
|
|
52
|
+
# logging
|
|
53
|
+
"setup",
|
|
54
|
+
"get_logger",
|
|
55
|
+
"reset",
|
|
56
|
+
# config
|
|
57
|
+
"load",
|
|
58
|
+
"load_env",
|
|
59
|
+
"validate",
|
|
60
|
+
"Schema",
|
|
61
|
+
"field",
|
|
62
|
+
"convert_file",
|
|
63
|
+
"convert_dict",
|
|
64
|
+
"export_file",
|
|
65
|
+
"export_dict",
|
|
66
|
+
"export_string",
|
|
67
|
+
# subpackages
|
|
68
|
+
"deps",
|
|
69
|
+
"scaffolder",
|
|
70
|
+
"time",
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
if _LLM_AVAILABLE:
|
|
74
|
+
__all__ += ["LLMClient", "LLMResponse", "Prompt", "QuotaConfig"]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""infrakit.cli.commands — subcommand groups."""
|
|
2
|
+
|
|
3
|
+
from infrakit.cli.commands.config import config_app
|
|
4
|
+
from infrakit.cli.commands.logger import logger_app
|
|
5
|
+
from infrakit.cli.commands.module import module_app
|
|
6
|
+
from infrakit.cli.commands.time import time_app
|
|
7
|
+
from infrakit.cli.commands.deps import deps_app
|
|
8
|
+
from infrakit.cli.commands.llm import app as llm_app
|
|
9
|
+
from infrakit.cli.commands.init import cmd_init
|
|
10
|
+
|
|
11
|
+
__all__ = [
|
|
12
|
+
"config_app",
|
|
13
|
+
"logger_app",
|
|
14
|
+
"module_app",
|
|
15
|
+
"time_app",
|
|
16
|
+
"deps_app",
|
|
17
|
+
"llm_app",
|
|
18
|
+
"cmd_init",
|
|
19
|
+
]
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"""
|
|
2
|
+
infrakit.core
|
|
3
|
+
~~~~~~~~~~~~~
|
|
4
|
+
Core infrastructure: config management and structured logging.
|
|
5
|
+
|
|
6
|
+
Quick imports::
|
|
7
|
+
|
|
8
|
+
from infrakit.core import setup, get_logger
|
|
9
|
+
from infrakit.core import load, validate
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from infrakit.core.logger.setup import setup, get_logger, reset
|
|
13
|
+
from infrakit.core.config import (
|
|
14
|
+
load,
|
|
15
|
+
load_env,
|
|
16
|
+
cast_value,
|
|
17
|
+
detect_format,
|
|
18
|
+
validate,
|
|
19
|
+
Schema,
|
|
20
|
+
field,
|
|
21
|
+
convert_file,
|
|
22
|
+
convert_dict,
|
|
23
|
+
export_file,
|
|
24
|
+
export_dict,
|
|
25
|
+
export_string,
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
__all__ = [
|
|
29
|
+
# logger
|
|
30
|
+
"setup",
|
|
31
|
+
"get_logger",
|
|
32
|
+
"reset",
|
|
33
|
+
# config
|
|
34
|
+
"load",
|
|
35
|
+
"load_env",
|
|
36
|
+
"cast_value",
|
|
37
|
+
"detect_format",
|
|
38
|
+
"validate",
|
|
39
|
+
"Schema",
|
|
40
|
+
"field",
|
|
41
|
+
"convert_file",
|
|
42
|
+
"convert_dict",
|
|
43
|
+
"export_file",
|
|
44
|
+
"export_dict",
|
|
45
|
+
"export_string",
|
|
46
|
+
]
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"""
|
|
2
|
+
infrakit.core.config
|
|
3
|
+
~~~~~~~~~~~~~~~~~~~~~
|
|
4
|
+
Configuration loading, validation, conversion, and export.
|
|
5
|
+
|
|
6
|
+
Quick imports::
|
|
7
|
+
|
|
8
|
+
from infrakit.core.config import load, load_env, validate, Schema, field
|
|
9
|
+
from infrakit.core.config import convert_file, convert_dict
|
|
10
|
+
from infrakit.core.config import export_file, export_dict, export_string
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from infrakit.core.config.loader import (
|
|
14
|
+
load,
|
|
15
|
+
load_env,
|
|
16
|
+
cast_value,
|
|
17
|
+
cast_dict,
|
|
18
|
+
detect_format,
|
|
19
|
+
ConfigLoadError,
|
|
20
|
+
UnsupportedFormatError,
|
|
21
|
+
MissingDependencyError,
|
|
22
|
+
)
|
|
23
|
+
from infrakit.core.config.validator import (
|
|
24
|
+
validate,
|
|
25
|
+
Schema,
|
|
26
|
+
field,
|
|
27
|
+
FieldSpec,
|
|
28
|
+
FieldError,
|
|
29
|
+
ValidationResult,
|
|
30
|
+
ConfigValidationError,
|
|
31
|
+
)
|
|
32
|
+
from infrakit.core.config.converter import (
|
|
33
|
+
convert_file,
|
|
34
|
+
convert_dict,
|
|
35
|
+
ConversionError,
|
|
36
|
+
ConversionWarning,
|
|
37
|
+
)
|
|
38
|
+
from infrakit.core.config.exporter import (
|
|
39
|
+
export_file,
|
|
40
|
+
export_dict,
|
|
41
|
+
export_string,
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
__all__ = [
|
|
45
|
+
# loader
|
|
46
|
+
"load",
|
|
47
|
+
"load_env",
|
|
48
|
+
"cast_value",
|
|
49
|
+
"cast_dict",
|
|
50
|
+
"detect_format",
|
|
51
|
+
"ConfigLoadError",
|
|
52
|
+
"UnsupportedFormatError",
|
|
53
|
+
"MissingDependencyError",
|
|
54
|
+
# validator
|
|
55
|
+
"validate",
|
|
56
|
+
"Schema",
|
|
57
|
+
"field",
|
|
58
|
+
"FieldSpec",
|
|
59
|
+
"FieldError",
|
|
60
|
+
"ValidationResult",
|
|
61
|
+
"ConfigValidationError",
|
|
62
|
+
# converter
|
|
63
|
+
"convert_file",
|
|
64
|
+
"convert_dict",
|
|
65
|
+
"ConversionError",
|
|
66
|
+
"ConversionWarning",
|
|
67
|
+
# exporter
|
|
68
|
+
"export_file",
|
|
69
|
+
"export_dict",
|
|
70
|
+
"export_string",
|
|
71
|
+
]
|
|
@@ -1,20 +1,27 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "python-infrakit-dev"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.5"
|
|
4
4
|
description = "A comprehensive Python developer infrastructure toolkit"
|
|
5
5
|
readme = "README.md"
|
|
6
|
-
requires-python = ">=3.
|
|
6
|
+
requires-python = ">=3.10"
|
|
7
7
|
dependencies = [
|
|
8
|
-
"google-genai>=1.69.0",
|
|
9
8
|
"isort>=8.0.1",
|
|
10
|
-
"openai>=2.30.0",
|
|
11
9
|
"pydantic>=2.12.5",
|
|
12
10
|
"python-dotenv>=1.2.2",
|
|
13
11
|
"pyyaml>=6.0.3",
|
|
14
|
-
"tqdm>=4.67.3",
|
|
15
12
|
"typer>=0.24.1",
|
|
16
13
|
]
|
|
17
14
|
|
|
15
|
+
[project.optional-dependencies]
|
|
16
|
+
llm = [
|
|
17
|
+
"google-genai>=1.69.0",
|
|
18
|
+
"openai>=2.30.0",
|
|
19
|
+
"tqdm>=4.67.3",
|
|
20
|
+
]
|
|
21
|
+
all = [
|
|
22
|
+
"python-infrakit-dev[llm]",
|
|
23
|
+
]
|
|
24
|
+
|
|
18
25
|
[dependency-groups]
|
|
19
26
|
dev = [
|
|
20
27
|
"mypy>=1.19.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"""infrakit.cli — command-line interface for infrakit."""
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"""infrakit.cli.commands — subcommand groups."""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_infrakit_dev-0.1.3/infrakit → python_infrakit_dev-0.1.5/tests}/core/config/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_infrakit_dev-0.1.3 → python_infrakit_dev-0.1.5}/tests/core/logger/test_formatters.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|