@sdk-it/python 0.23.0
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.
- package/README.md +62 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1974 -0
- package/dist/index.js.map +7 -0
- package/dist/lib/generate.d.ts +18 -0
- package/dist/lib/generate.d.ts.map +1 -0
- package/dist/lib/index.d.ts +3 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/python-emitter.d.ts +28 -0
- package/dist/lib/python-emitter.d.ts.map +1 -0
- package/package.json +37 -0
package/README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Python SDK Generator
|
|
2
|
+
|
|
3
|
+
This package generates Python SDKs from OpenAPI specifications. The generated SDKs are type-safe, use Pydantic for data validation, and follow Python best practices.
|
|
4
|
+
|
|
5
|
+
## Generated SDK Features
|
|
6
|
+
|
|
7
|
+
- **Type Safety**: Full type hints using Python's typing system
|
|
8
|
+
- **Data Validation**: Pydantic models for request/response validation
|
|
9
|
+
- **Async Support**: Fully async HTTP client using `httpx`
|
|
10
|
+
- **Error Handling**: Proper exception hierarchy for API errors
|
|
11
|
+
- **Documentation**: Auto-generated docstrings from OpenAPI descriptions
|
|
12
|
+
|
|
13
|
+
## Generated SDK Structure
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
├── requirements.txt # Python dependencies
|
|
17
|
+
├── client.py # Main client class
|
|
18
|
+
├── api/ # API group clients
|
|
19
|
+
│ ├── __init__.py
|
|
20
|
+
│ ├── users_api.py
|
|
21
|
+
│ └── pets_api.py
|
|
22
|
+
├── models/ # Data models
|
|
23
|
+
│ ├── __init__.py
|
|
24
|
+
│ ├── user.py
|
|
25
|
+
│ └── pet.py
|
|
26
|
+
├── inputs/ # Request input models
|
|
27
|
+
│ ├── __init__.py
|
|
28
|
+
│ └── ...
|
|
29
|
+
├── outputs/ # Response output models
|
|
30
|
+
│ ├── __init__.py
|
|
31
|
+
│ └── ...
|
|
32
|
+
└── http/ # HTTP transport layer
|
|
33
|
+
├── __init__.py
|
|
34
|
+
├── dispatcher.py
|
|
35
|
+
├── interceptors.py
|
|
36
|
+
└── responses.py
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
import asyncio
|
|
43
|
+
from your_sdk import Client
|
|
44
|
+
|
|
45
|
+
async def main():
|
|
46
|
+
client = Client(base_url="https://api.example.com")
|
|
47
|
+
|
|
48
|
+
# Make API calls
|
|
49
|
+
users = await client.users.list_users()
|
|
50
|
+
user = await client.users.get_user(user_id="123")
|
|
51
|
+
|
|
52
|
+
if __name__ == "__main__":
|
|
53
|
+
asyncio.run(main())
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Dependencies
|
|
57
|
+
|
|
58
|
+
The generated SDK has minimal dependencies:
|
|
59
|
+
|
|
60
|
+
- `httpx` - Modern async HTTP client
|
|
61
|
+
- `pydantic` - Data validation and serialization
|
|
62
|
+
- `typing-extensions` - Enhanced type hints support
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC"}
|