Enable graph-based analysis of any Speckle model.
Project description
Speckle2Graph
Purpose of the Library
This is an alpha version, so any feedback of bugs is very appreciated
The library aims to enrich the Speckle-Directed Acyclic Graph (DAG) by adding edges between BIM elements, enabling more specific graph-based analysis.
Currently we support Neo4j only
Prerequisites
- Ensure that the Speckle models were uploaded using the latest versions of the connectors.
- Ensure that your Neo4j instance has the APOC plugin installed. Since Cypher queries are used to insert data and they don't support dynamic labels from parameters, we are forced to use APOC to save time on writing label-assigning queries manually.
Usage
# Install the library (PYPI will be added soon)
!pip install speckle2graph
# Authorize to Speckle
client = SpeckleClient()
client.authenticate_with_token(SPECKLE_TOKEN)
transport = ServerTransport(PROJECT_ID, client)
# Make sure you paste the root of the speckle model, otherwise, the geometries will fail to build.
root = operations.receive(ROOT, remote_transport = transport)
# Build a Graph in 3 lines of code
traversed_object = TraverseRevitDAG(root)
graph_builder = GraphBuilder(traversed_speckle_object=traversed_object)
graph_builder.build()
# Write the graph to a neo4j database
from speckle2graph import Neo4jClientDriverWrapper
from neo4j import GraphDatabase
# Authorize and write the graph to Neo4j for further analysis.
with GraphDatabase.driver(URI, auth=auth) as driver:
driver.verify_connectivity()
neo4j_client_wrapper = Neo4jClientDriverWrapper(
driver=driver,
graph_builder_object=graph_builder
)
neo4j_client_wrapper.write_graph()
Development Roadmap
Will be added soon!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file speckle2graph-0.0.3.tar.gz.
File metadata
- Download URL: speckle2graph-0.0.3.tar.gz
- Upload date:
- Size: 15.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b23a21c3a370bf6d68887ceeae1a244757cbb18a80af12bdc06d244beb0b8aa
|
|
| MD5 |
0d2fae7c29d5cfafc43435f7aad7f9d4
|
|
| BLAKE2b-256 |
58bdb380b437b513ff113eefe953751396f95b141509797cb646d7d8f949a91f
|
File details
Details for the file speckle2graph-0.0.3-py3-none-any.whl.
File metadata
- Download URL: speckle2graph-0.0.3-py3-none-any.whl
- Upload date:
- Size: 17.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8726f85ae3b1984ee14e5d6ea84b39549bf88b121e81232ca554b4176997507
|
|
| MD5 |
27a3da8faa059b619ab6ec7e20501b03
|
|
| BLAKE2b-256 |
ead5bb149951ead6e6ef698c75689b0bf444545c77e564d64cb17985ff380aa1
|