struai 1.0.1__py3-none-any.whl → 1.0.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.
struai/__init__.py CHANGED
@@ -1,9 +1,10 @@
1
1
  """StruAI Python SDK - Drawing Analysis API client.
2
2
 
3
3
  Example:
4
+ >>> import os
4
5
  >>> from struai import StruAI
5
6
  >>>
6
- >>> client = StruAI(api_key="sk-xxx")
7
+ >>> client = StruAI(api_key=os.environ["STRUAI_API_KEY"])
7
8
  >>>
8
9
  >>> # Tier 1: Raw detection ($0.02/page)
9
10
  >>> result = client.drawings.analyze("plans.pdf", page=4)
struai/_client.py CHANGED
@@ -21,7 +21,8 @@ class StruAI(BaseClient):
21
21
  max_retries: Max retry attempts for failed requests. Default 2.
22
22
 
23
23
  Example:
24
- >>> client = StruAI(api_key="sk-xxx")
24
+ >>> import os
25
+ >>> client = StruAI(api_key=os.environ["STRUAI_API_KEY"])
25
26
  >>>
26
27
  >>> # Tier 1: Raw detection
27
28
  >>> result = client.drawings.analyze("structural.pdf", page=4)
@@ -72,7 +73,8 @@ class AsyncStruAI(AsyncBaseClient):
72
73
  """Async StruAI client for drawing analysis API.
73
74
 
74
75
  Example:
75
- >>> async with AsyncStruAI(api_key="sk-xxx") as client:
76
+ >>> import os
77
+ >>> async with AsyncStruAI(api_key=os.environ["STRUAI_API_KEY"]) as client:
76
78
  ... result = await client.drawings.analyze("structural.pdf", page=4)
77
79
  ...
78
80
  ... project = await client.projects.create("Building A")
struai/_version.py CHANGED
@@ -1,2 +1,2 @@
1
1
  """Version information."""
2
- __version__ = "1.0.1"
2
+ __version__ = "1.0.2"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: struai
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: StruAI Drawing Analysis SDK - AI-powered construction drawing analysis
5
5
  Project-URL: Homepage, https://struai.com
6
6
  Project-URL: Documentation, https://docs.struai.com/python
@@ -42,13 +42,20 @@ pip install struai
42
42
 
43
43
  ## Quick Start
44
44
 
45
+ Get an API key from `stru.ai` and set it as an environment variable:
46
+
47
+ ```bash
48
+ export STRUAI_API_KEY="YOUR_API_KEY"
49
+ ```
50
+
45
51
  ```python
52
+ import os
46
53
  from struai import StruAI
47
54
 
48
- client = StruAI(api_key="sk-xxx") # or set STRUAI_API_KEY env var
55
+ client = StruAI(api_key=os.environ["STRUAI_API_KEY"])
49
56
 
50
57
  # Optional: override base URL (http://localhost:8000 or http://localhost:8000/v1)
51
- client = StruAI(api_key="sk-xxx", base_url="http://localhost:8000")
58
+ client = StruAI(api_key=os.environ["STRUAI_API_KEY"], base_url="http://localhost:8000")
52
59
  ```
53
60
 
54
61
  ## Tier 1: Raw Detection ($0.02/page)
@@ -76,6 +83,49 @@ drawing = client.drawings.get("drw_7f8a9b2c")
76
83
  client.drawings.delete("drw_7f8a9b2c")
77
84
  ```
78
85
 
86
+ ## HTTP Endpoints (Reference)
87
+
88
+ All endpoints are under `/v1`. Use `Authorization: Bearer <API_KEY>`.
89
+
90
+ Tier 1 (raw detection):
91
+ - `POST /v1/drawings` — multipart form with `file` (PDF) and `page` (1-indexed)
92
+ - `GET /v1/drawings/{id}`
93
+ - `DELETE /v1/drawings/{id}`
94
+
95
+ Tier 2 (graph + search):
96
+ - `POST /v1/projects`
97
+ - `GET /v1/projects`
98
+ - `GET /v1/projects/{id}`
99
+ - `DELETE /v1/projects/{id}`
100
+ - `POST /v1/projects/{project_id}/sheets` — multipart form with `file` + `page`
101
+ - `GET /v1/projects/{project_id}/jobs/{job_id}`
102
+ - `GET /v1/projects/{project_id}/sheets`
103
+ - `GET /v1/projects/{project_id}/sheets/{sheet_id}`
104
+ - `DELETE /v1/projects/{project_id}/sheets/{sheet_id}`
105
+ - `POST /v1/projects/{project_id}/search`
106
+ - `POST /v1/projects/{project_id}/query`
107
+ - `GET /v1/projects/{project_id}/entities`
108
+ - `GET /v1/projects/{project_id}/entities/{entity_id}`
109
+ - `GET /v1/projects/{project_id}/relationships`
110
+
111
+ Example (raw detection):
112
+
113
+ ```bash
114
+ curl -X POST "https://api.stru.ai/v1/drawings" \
115
+ -H "Authorization: Bearer YOUR_API_KEY" \
116
+ -F "file=@structural.pdf" \
117
+ -F "page=4"
118
+ ```
119
+
120
+ Example (project sheet ingestion):
121
+
122
+ ```bash
123
+ curl -X POST "https://api.stru.ai/v1/projects/{project_id}/sheets" \
124
+ -H "Authorization: Bearer YOUR_API_KEY" \
125
+ -F "file=@structural.pdf" \
126
+ -F "page=4"
127
+ ```
128
+
79
129
  ## Tier 2: Graph + Search ($0.15/page)
80
130
 
81
131
  Full pipeline: detection → LLM enrichment → knowledge graph → semantic search.
@@ -118,9 +168,10 @@ entity = project.entities.get("ent_abc123")
118
168
  ## Async Support
119
169
 
120
170
  ```python
171
+ import os
121
172
  from struai import AsyncStruAI
122
173
 
123
- async with AsyncStruAI(api_key="sk-xxx") as client:
174
+ async with AsyncStruAI(api_key=os.environ["STRUAI_API_KEY"]) as client:
124
175
  # Tier 1
125
176
  result = await client.drawings.analyze("structural.pdf", page=4)
126
177
 
@@ -1,8 +1,8 @@
1
- struai/__init__.py,sha256=3YTAjICfleWQh33O7y-yVqAJ8k9Pn2eU2epzrroKqt4,2274
1
+ struai/__init__.py,sha256=PDKqtP7iT2Gibhm-CR08pjFXwkBnC5LhjvjbISmk-rs,2312
2
2
  struai/_base.py,sha256=JiAxWI1PMmIFVr9v_hBABra8m2fRkEvBp7d2Vc-5IAk,11208
3
- struai/_client.py,sha256=WOcGC7LjaG469shx1YX2GCt0yJs-Ew-vOrxsqUmVmHM,3542
3
+ struai/_client.py,sha256=jc1WBRQIB4qjxC4IgA4CtIjFQ--tORJhTPlIcsV56yc,3626
4
4
  struai/_exceptions.py,sha256=GK0aVnOdkmcFaO16e0lzj9S2NmnTjQiy5H6nH6yDV24,2021
5
- struai/_version.py,sha256=da8k-y4StnRTawPjG6KLx2cylvLgrpCSR6eZl8UgnKA,49
5
+ struai/_version.py,sha256=vO6OYruC7WUn0d2gyxEwUnT-rvPnMZ9JtPv1h8Fu25w,49
6
6
  struai/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  struai/models/__init__.py,sha256=qA_e6ZGG7Uhq9aLX2LeXlnUuV8VE6ur3OCFOPcj1oco,1220
8
8
  struai/models/common.py,sha256=0Ox9PiuyRoyWH5vbSTfjm2nCWt_pblWH7kJso8nMVuE,592
@@ -13,6 +13,6 @@ struai/models/search.py,sha256=UL3RYsAidS1zdV4lKiwNcHcAIjzyi8dgAQodowjzh58,1324
13
13
  struai/resources/__init__.py,sha256=_JT_8OrvVcJ4yHmvZnsqYj4ej8pVg5lKSPKIcgQTCZk,183
14
14
  struai/resources/drawings.py,sha256=b3C7CHS-p8CpGBtKl_dvLeUFDJ3g8HjlLBA4II0HsT4,3957
15
15
  struai/resources/projects.py,sha256=_KRHO6ByBN_W-STlaAhVljLt9F3Yh9xzV5Piahc50FQ,19501
16
- struai-1.0.1.dist-info/METADATA,sha256=pVsCT9ov986VJ3flFsJhCGwMIGrYlO_ITbdoPJ1_gV8,4460
17
- struai-1.0.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
18
- struai-1.0.1.dist-info/RECORD,,
16
+ struai-1.0.2.dist-info/METADATA,sha256=TXK36DlWMFkafqOY5jlYdnQrKm5ATimV1bNakz_otpo,5904
17
+ struai-1.0.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
18
+ struai-1.0.2.dist-info/RECORD,,
File without changes