struai 0.0.1__py3-none-any.whl → 0.1.0__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.
@@ -0,0 +1,148 @@
1
+ Metadata-Version: 2.4
2
+ Name: struai
3
+ Version: 0.1.0
4
+ Summary: StruAI Drawing Analysis SDK - AI-powered construction drawing analysis
5
+ Project-URL: Homepage, https://struai.com
6
+ Project-URL: Documentation, https://docs.struai.com/python
7
+ Project-URL: Repository, https://github.com/struai/struai-python
8
+ Project-URL: Issues, https://github.com/struai/struai-python/issues
9
+ Author-email: StruAI <support@struai.com>
10
+ License-Expression: MIT
11
+ Keywords: ai,cad,construction drawings,drawing analysis,knowledge graph,pdf,struai,structural engineering
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Topic :: Scientific/Engineering
22
+ Classifier: Typing :: Typed
23
+ Requires-Python: >=3.9
24
+ Requires-Dist: httpx>=0.25.0
25
+ Requires-Dist: pydantic>=2.0.0
26
+ Provides-Extra: dev
27
+ Requires-Dist: mypy>=1.0; extra == 'dev'
28
+ Requires-Dist: pytest-asyncio>=0.21; extra == 'dev'
29
+ Requires-Dist: pytest>=7.0; extra == 'dev'
30
+ Requires-Dist: ruff>=0.1.0; extra == 'dev'
31
+ Description-Content-Type: text/markdown
32
+
33
+ # StruAI Python SDK
34
+
35
+ Official Python SDK for the StruAI Drawing Analysis API.
36
+
37
+ ## Installation
38
+
39
+ ```bash
40
+ pip install struai
41
+ ```
42
+
43
+ ## Quick Start
44
+
45
+ ```python
46
+ from struai import StruAI
47
+
48
+ client = StruAI(api_key="sk-xxx") # or set STRUAI_API_KEY env var
49
+ ```
50
+
51
+ ## Tier 1: Raw Detection ($0.02/page)
52
+
53
+ Fast geometric detection. Returns annotations in ~1-2 seconds.
54
+
55
+ ```python
56
+ # Analyze a PDF page
57
+ result = client.drawings.analyze("structural.pdf", page=4)
58
+
59
+ print(f"Processed in {result.processing_ms}ms")
60
+ print(f"Page size: {result.dimensions.width}x{result.dimensions.height}")
61
+
62
+ # Access detected annotations
63
+ for leader in result.annotations.leaders:
64
+ texts = [t.text for t in leader.texts_inside]
65
+ print(f"Leader at {leader.arrow_tip}: {', '.join(texts)}")
66
+
67
+ for tag in result.annotations.section_tags:
68
+ label = tag.texts_inside[0].text
69
+ print(f"Section {label}, direction: {tag.direction}")
70
+
71
+ # Retrieve/delete previous results
72
+ drawing = client.drawings.get("drw_7f8a9b2c")
73
+ client.drawings.delete("drw_7f8a9b2c")
74
+ ```
75
+
76
+ ## Tier 2: Graph + Search ($0.15/page)
77
+
78
+ Full pipeline: detection → LLM enrichment → knowledge graph → semantic search.
79
+
80
+ ```python
81
+ # Create a project
82
+ project = client.projects.create(
83
+ name="Building A Structural",
84
+ description="96-page structural drawing set"
85
+ )
86
+
87
+ # Add sheets (async processing)
88
+ job = project.sheets.add("structural.pdf", page=4)
89
+ result = job.wait(timeout=120) # Blocks until complete
90
+ print(f"Created {result.entities_created} entities")
91
+
92
+ # Semantic search
93
+ results = project.search(
94
+ query="W12x26 beam connections at grid A",
95
+ limit=10,
96
+ include_graph_context=True
97
+ )
98
+
99
+ for hit in results.results:
100
+ print(f"{hit.entity.label}: {hit.score:.2f}")
101
+ if hit.graph_context:
102
+ for rel in hit.graph_context.relationships:
103
+ print(f" - {rel.type}: {rel.fact}")
104
+
105
+ # Natural language query
106
+ answer = project.query("What beams connect to column C3?")
107
+ print(answer.answer)
108
+ print(f"Confidence: {answer.confidence:.0%}")
109
+
110
+ # Browse entities
111
+ entities = project.entities.list(type="Component", limit=50)
112
+ entity = project.entities.get("ent_abc123")
113
+ ```
114
+
115
+ ## Async Support
116
+
117
+ ```python
118
+ from struai import AsyncStruAI
119
+
120
+ async with AsyncStruAI(api_key="sk-xxx") as client:
121
+ # Tier 1
122
+ result = await client.drawings.analyze("structural.pdf", page=4)
123
+
124
+ # Tier 2
125
+ project = await client.projects.create(name="Building A")
126
+ job = await project.sheets.add("structural.pdf", page=4)
127
+ result = await job.wait(timeout=120)
128
+ results = await project.search("W12x26 beam connections")
129
+ ```
130
+
131
+ ## Error Handling
132
+
133
+ ```python
134
+ from struai import StruAI, AuthenticationError, RateLimitError, NotFoundError
135
+
136
+ try:
137
+ result = client.drawings.analyze("plans.pdf", page=99)
138
+ except AuthenticationError:
139
+ print("Invalid API key")
140
+ except RateLimitError as e:
141
+ print(f"Rate limited. Retry after {e.retry_after}s")
142
+ except NotFoundError:
143
+ print("Resource not found")
144
+ ```
145
+
146
+ ## License
147
+
148
+ MIT
@@ -0,0 +1,18 @@
1
+ struai/__init__.py,sha256=FsxjwfQOKDXzcnX8TqfWgTOqEbe-rW7zf8hwsqSMq0c,2190
2
+ struai/_base.py,sha256=IPhrlgoqf7RZOh9xy2O6o9qMazEj0-RkI-dXPGzk76U,10795
3
+ struai/_client.py,sha256=AmxmJ0ZSPlYlfqf4WHRaR_PQ1u5m3DCE59pLrf8j-7s,3483
4
+ struai/_exceptions.py,sha256=GK0aVnOdkmcFaO16e0lzj9S2NmnTjQiy5H6nH6yDV24,2021
5
+ struai/_version.py,sha256=PrqPeNLB_vK7o-1a2bBnGr1qOX4JyRedkdthES3yNbw,49
6
+ struai/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ struai/models/__init__.py,sha256=ddFoRRUY32xeHnjI0twEIRtXNh1huyWwggE1sY-y2e4,1144
8
+ struai/models/common.py,sha256=qRehKPxDWPG34_LHhxu7T93Wqz1uRRQzIErQhraYAt4,598
9
+ struai/models/drawings.py,sha256=oTvN0ZID1TdUsR1BkJ-6M87nFbQwsYyePd0xoxKns9I,1634
10
+ struai/models/entities.py,sha256=dlQJqnY1GbVZOy74Rtt7J2JGxtUI7pWyifAO3whmNP0,753
11
+ struai/models/projects.py,sha256=_VYinZrwWCmv3SQy7iZFPBtHcGsZe3XxI1i9SCk0EfY,1654
12
+ struai/models/search.py,sha256=UL3RYsAidS1zdV4lKiwNcHcAIjzyi8dgAQodowjzh58,1324
13
+ struai/resources/__init__.py,sha256=_JT_8OrvVcJ4yHmvZnsqYj4ej8pVg5lKSPKIcgQTCZk,183
14
+ struai/resources/drawings.py,sha256=b3C7CHS-p8CpGBtKl_dvLeUFDJ3g8HjlLBA4II0HsT4,3957
15
+ struai/resources/projects.py,sha256=3HMLbZmhcPQq51uTT3Y21Rx48PDKXF_-ESPDJYBd5tw,19453
16
+ struai-0.1.0.dist-info/METADATA,sha256=hVEKAZoNtYqtqz_c95ouj7GOmY7jKPVvrfn2tYe3iS0,4309
17
+ struai-0.1.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
18
+ struai-0.1.0.dist-info/RECORD,,
@@ -1,17 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: struai
3
- Version: 0.0.1
4
- Summary: StruAI - AI-powered tools
5
- Project-URL: Homepage, https://github.com/bhoshaga/struai
6
- Author-email: bhoshaga <bhoshaga@gmail.com>
7
- License-Expression: MIT
8
- Keywords: ai,struai
9
- Classifier: Development Status :: 1 - Planning
10
- Classifier: License :: OSI Approved :: MIT License
11
- Classifier: Programming Language :: Python :: 3
12
- Requires-Python: >=3.8
13
- Description-Content-Type: text/markdown
14
-
15
- # struai
16
-
17
- Coming soon.
@@ -1,4 +0,0 @@
1
- struai/__init__.py,sha256=1VV3qcV5ZM35mMYdb-FwQIXwmF9iTiB7dguaAQdNpEc,35
2
- struai-0.0.1.dist-info/METADATA,sha256=Bk8MaGENVHMEt6MaRa2hVDcuUTQoc3FUCSMy3zc15as,464
3
- struai-0.0.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
4
- struai-0.0.1.dist-info/RECORD,,
File without changes