struai 1.0.1__tar.gz → 1.0.2__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 (29) hide show
  1. struai-1.0.2/CHANGELOG.md +26 -0
  2. {struai-1.0.1 → struai-1.0.2}/PKG-INFO +55 -4
  3. {struai-1.0.1 → struai-1.0.2}/README.md +54 -3
  4. {struai-1.0.1 → struai-1.0.2}/js/README.md +30 -2
  5. {struai-1.0.1 → struai-1.0.2}/js/package.json +1 -1
  6. {struai-1.0.1 → struai-1.0.2}/js/src/index.ts +1 -1
  7. {struai-1.0.1 → struai-1.0.2}/pyproject.toml +1 -1
  8. {struai-1.0.1 → struai-1.0.2}/src/struai/__init__.py +2 -1
  9. {struai-1.0.1 → struai-1.0.2}/src/struai/_client.py +4 -2
  10. {struai-1.0.1 → struai-1.0.2}/src/struai/_version.py +1 -1
  11. struai-1.0.1/CHANGELOG.md +0 -15
  12. {struai-1.0.1 → struai-1.0.2}/.github/workflows/ci.yml +0 -0
  13. {struai-1.0.1 → struai-1.0.2}/.github/workflows/release.yml +0 -0
  14. {struai-1.0.1 → struai-1.0.2}/.gitignore +0 -0
  15. {struai-1.0.1 → struai-1.0.2}/.pre-commit-config.yaml +0 -0
  16. {struai-1.0.1 → struai-1.0.2}/js/.gitignore +0 -0
  17. {struai-1.0.1 → struai-1.0.2}/js/tsconfig.json +0 -0
  18. {struai-1.0.1 → struai-1.0.2}/src/struai/_base.py +0 -0
  19. {struai-1.0.1 → struai-1.0.2}/src/struai/_exceptions.py +0 -0
  20. {struai-1.0.1 → struai-1.0.2}/src/struai/models/__init__.py +0 -0
  21. {struai-1.0.1 → struai-1.0.2}/src/struai/models/common.py +0 -0
  22. {struai-1.0.1 → struai-1.0.2}/src/struai/models/drawings.py +0 -0
  23. {struai-1.0.1 → struai-1.0.2}/src/struai/models/entities.py +0 -0
  24. {struai-1.0.1 → struai-1.0.2}/src/struai/models/projects.py +0 -0
  25. {struai-1.0.1 → struai-1.0.2}/src/struai/models/search.py +0 -0
  26. {struai-1.0.1 → struai-1.0.2}/src/struai/py.typed +0 -0
  27. {struai-1.0.1 → struai-1.0.2}/src/struai/resources/__init__.py +0 -0
  28. {struai-1.0.1 → struai-1.0.2}/src/struai/resources/drawings.py +0 -0
  29. {struai-1.0.1 → struai-1.0.2}/src/struai/resources/projects.py +0 -0
@@ -0,0 +1,26 @@
1
+ # CHANGELOG
2
+
3
+ <!-- version list -->
4
+
5
+ ## v1.0.2 (2026-02-04)
6
+
7
+ ### Bug Fixes
8
+
9
+ - **ci**: Add publish_only option for re-publishing
10
+ ([`0806b1e`](https://github.com/bhoshaga/struai/commit/0806b1eb6dba6d518df9f43a199b9255d1776d6a))
11
+
12
+ - **ci**: Consolidate to single release workflow
13
+ ([`91e94b0`](https://github.com/bhoshaga/struai/commit/91e94b00f5eb6e123adb2cfae01a473ed4cd5cbd))
14
+
15
+
16
+ ## v1.0.1 (2026-02-04)
17
+
18
+ ### Bug Fixes
19
+
20
+ - **ci**: Include publish jobs directly in release workflow
21
+ ([`02436eb`](https://github.com/bhoshaga/struai/commit/02436eb55c63cbaa54eac8ca456a54d30125fada))
22
+
23
+
24
+ ## v1.0.0 (2026-02-04)
25
+
26
+ - Initial Release
@@ -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
 
@@ -10,13 +10,20 @@ pip install struai
10
10
 
11
11
  ## Quick Start
12
12
 
13
+ Get an API key from `stru.ai` and set it as an environment variable:
14
+
15
+ ```bash
16
+ export STRUAI_API_KEY="YOUR_API_KEY"
17
+ ```
18
+
13
19
  ```python
20
+ import os
14
21
  from struai import StruAI
15
22
 
16
- client = StruAI(api_key="sk-xxx") # or set STRUAI_API_KEY env var
23
+ client = StruAI(api_key=os.environ["STRUAI_API_KEY"])
17
24
 
18
25
  # Optional: override base URL (http://localhost:8000 or http://localhost:8000/v1)
19
- client = StruAI(api_key="sk-xxx", base_url="http://localhost:8000")
26
+ client = StruAI(api_key=os.environ["STRUAI_API_KEY"], base_url="http://localhost:8000")
20
27
  ```
21
28
 
22
29
  ## Tier 1: Raw Detection ($0.02/page)
@@ -44,6 +51,49 @@ drawing = client.drawings.get("drw_7f8a9b2c")
44
51
  client.drawings.delete("drw_7f8a9b2c")
45
52
  ```
46
53
 
54
+ ## HTTP Endpoints (Reference)
55
+
56
+ All endpoints are under `/v1`. Use `Authorization: Bearer <API_KEY>`.
57
+
58
+ Tier 1 (raw detection):
59
+ - `POST /v1/drawings` — multipart form with `file` (PDF) and `page` (1-indexed)
60
+ - `GET /v1/drawings/{id}`
61
+ - `DELETE /v1/drawings/{id}`
62
+
63
+ Tier 2 (graph + search):
64
+ - `POST /v1/projects`
65
+ - `GET /v1/projects`
66
+ - `GET /v1/projects/{id}`
67
+ - `DELETE /v1/projects/{id}`
68
+ - `POST /v1/projects/{project_id}/sheets` — multipart form with `file` + `page`
69
+ - `GET /v1/projects/{project_id}/jobs/{job_id}`
70
+ - `GET /v1/projects/{project_id}/sheets`
71
+ - `GET /v1/projects/{project_id}/sheets/{sheet_id}`
72
+ - `DELETE /v1/projects/{project_id}/sheets/{sheet_id}`
73
+ - `POST /v1/projects/{project_id}/search`
74
+ - `POST /v1/projects/{project_id}/query`
75
+ - `GET /v1/projects/{project_id}/entities`
76
+ - `GET /v1/projects/{project_id}/entities/{entity_id}`
77
+ - `GET /v1/projects/{project_id}/relationships`
78
+
79
+ Example (raw detection):
80
+
81
+ ```bash
82
+ curl -X POST "https://api.stru.ai/v1/drawings" \
83
+ -H "Authorization: Bearer YOUR_API_KEY" \
84
+ -F "file=@structural.pdf" \
85
+ -F "page=4"
86
+ ```
87
+
88
+ Example (project sheet ingestion):
89
+
90
+ ```bash
91
+ curl -X POST "https://api.stru.ai/v1/projects/{project_id}/sheets" \
92
+ -H "Authorization: Bearer YOUR_API_KEY" \
93
+ -F "file=@structural.pdf" \
94
+ -F "page=4"
95
+ ```
96
+
47
97
  ## Tier 2: Graph + Search ($0.15/page)
48
98
 
49
99
  Full pipeline: detection → LLM enrichment → knowledge graph → semantic search.
@@ -86,9 +136,10 @@ entity = project.entities.get("ent_abc123")
86
136
  ## Async Support
87
137
 
88
138
  ```python
139
+ import os
89
140
  from struai import AsyncStruAI
90
141
 
91
- async with AsyncStruAI(api_key="sk-xxx") as client:
142
+ async with AsyncStruAI(api_key=os.environ["STRUAI_API_KEY"]) as client:
92
143
  # Tier 1
93
144
  result = await client.drawings.analyze("structural.pdf", page=4)
94
145
 
@@ -12,13 +12,16 @@ npm install struai
12
12
 
13
13
  ## Quick Start
14
14
 
15
+ Get an API key from `stru.ai` and set `STRUAI_API_KEY`.
16
+
15
17
  ```typescript
16
18
  import { StruAI } from 'struai';
17
19
 
18
- const client = new StruAI({ apiKey: 'sk-xxx' });
20
+ // Get an API key from stru.ai and set STRUAI_API_KEY
21
+ const client = new StruAI({ apiKey: process.env.STRUAI_API_KEY! });
19
22
 
20
23
  // Optional: override base URL (http://localhost:8000 or http://localhost:8000/v1)
21
- const local = new StruAI({ apiKey: 'sk-xxx', baseUrl: 'http://localhost:8000' });
24
+ const local = new StruAI({ apiKey: process.env.STRUAI_API_KEY!, baseUrl: 'http://localhost:8000' });
22
25
  ```
23
26
 
24
27
  ## Tier 1: Raw Detection ($0.02/page)
@@ -68,6 +71,31 @@ const entities = await project.entities.list({ type: 'Component', limit: 50 });
68
71
  const entity = await project.entities.get('ent_abc123');
69
72
  ```
70
73
 
74
+ ## HTTP Endpoints (Reference)
75
+
76
+ All endpoints are under `/v1`. Use `Authorization: Bearer <API_KEY>`.
77
+
78
+ Tier 1 (raw detection):
79
+ - `POST /v1/drawings` — multipart form with `file` (PDF) and `page` (1-indexed)
80
+ - `GET /v1/drawings/{id}`
81
+ - `DELETE /v1/drawings/{id}`
82
+
83
+ Tier 2 (graph + search):
84
+ - `POST /v1/projects`
85
+ - `GET /v1/projects`
86
+ - `GET /v1/projects/{id}`
87
+ - `DELETE /v1/projects/{id}`
88
+ - `POST /v1/projects/{project_id}/sheets` — multipart form with `file` + `page`
89
+ - `GET /v1/projects/{project_id}/jobs/{job_id}`
90
+ - `GET /v1/projects/{project_id}/sheets`
91
+ - `GET /v1/projects/{project_id}/sheets/{sheet_id}`
92
+ - `DELETE /v1/projects/{project_id}/sheets/{sheet_id}`
93
+ - `POST /v1/projects/{project_id}/search`
94
+ - `POST /v1/projects/{project_id}/query`
95
+ - `GET /v1/projects/{project_id}/entities`
96
+ - `GET /v1/projects/{project_id}/entities/{entity_id}`
97
+ - `GET /v1/projects/{project_id}/relationships`
98
+
71
99
  ## License
72
100
 
73
101
  MIT
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "struai",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "StruAI Drawing Analysis SDK - AI-powered construction drawing analysis",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -5,7 +5,7 @@
5
5
  * ```typescript
6
6
  * import { StruAI } from 'struai';
7
7
  *
8
- * const client = new StruAI({ apiKey: 'sk-xxx' });
8
+ * const client = new StruAI({ apiKey: process.env.STRUAI_API_KEY });
9
9
  *
10
10
  * // Tier 1: Raw detection
11
11
  * const result = await client.drawings.analyze('structural.pdf', { page: 4 });
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "struai"
7
- version = "1.0.1"
7
+ version = "1.0.2"
8
8
  description = "StruAI Drawing Analysis SDK - AI-powered construction drawing analysis"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -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)
@@ -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")
@@ -1,2 +1,2 @@
1
1
  """Version information."""
2
- __version__ = "1.0.1"
2
+ __version__ = "1.0.2"
struai-1.0.1/CHANGELOG.md DELETED
@@ -1,15 +0,0 @@
1
- # CHANGELOG
2
-
3
- <!-- version list -->
4
-
5
- ## v1.0.1 (2026-02-04)
6
-
7
- ### Bug Fixes
8
-
9
- - **ci**: Include publish jobs directly in release workflow
10
- ([`02436eb`](https://github.com/bhoshaga/struai/commit/02436eb55c63cbaa54eac8ca456a54d30125fada))
11
-
12
-
13
- ## v1.0.0 (2026-02-04)
14
-
15
- - Initial Release
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes