Maple
Automate your model Quality Check with Speckle and Maple
About
Maple is a library designed to write simple code that can check different attributes of a Model in Speckle.
Using Maple you can write test specs that check any parameter
or quantity inside the project model.
Maple can be integrated into Speckle Automate to run the quality check tests on a continuous integration and ensure project standards. See Maple-Automate-CI to check the full implementation of maple in Speckle Automate.
Get started
For a more detailed guide check out Getting started
Install the library from PyPi
pip install maple-spec
Then, create your main.py to test your specs locally
# main.py
import maple as mp
def spec_a():
mp.it("checks window height is greater than 2600 mm")
mp.get('category', 'Windows')\
.where('speckle_type',
'Objects.Other.Instance:Objects.Other.Revit.RevitInstance')\
.its('Height')\
.should('be.greater', 2600)
# Use the project and model id of one of your projects
mp.init_model(project_id="24fa0ed1c3", model_id="2696b4a381")
mp.run(spec_a)
For this to work out of the box, you should have the Speckle Manager
installed and your account set-up, so Maple can fetch the data from your stream.
If not, alternatively you can set an environment variable called SPECKLE_TOKEN with a Speckle token that can read from streams, for example:
SPECKLE_TOKEN="your-secret-token"
Finally run the file with python like so:
python main.py
Development guide
Create a development virtual environment:
python -m venv venv
source ./venv/bin/activate
Install the dev dependencies
pip install pytest
Testing
Run pytest
Building
Ensure build is installed:
python -m pip install --upgrade build
To build a wheel run:
python -m build
Metadata
Release files for maple-spec 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| maple_spec-0.1.6.tar.gz | 23.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| maple_spec-0.1.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 40.0 kB
Release files / maple_spec-0.1.6.tar.gz
| Download URL | maple_spec-0.1.6.tar.gz |
|---|---|
| Size | 23.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7cb93412286246ea4ab14fd46edebfac875e3b3dd03b1a48f4a7f1aecb008dd5
|
|
BLAKE2b-256 checksum How to use checksums |
38eb3d3b3cd63b085d2a0f7f0797ba78944c9d951e2b6f039097396dbd4f5c10
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.23
|
Release files / maple_spec-0.1.6-py3-none-any.whl
| Download URL | maple_spec-0.1.6-py3-none-any.whl |
|---|---|
| Size | 16.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a9ddaa5b2207502d4bafd70f2a8ef424d331b56113db3707d9e1061233201310
|
|
BLAKE2b-256 checksum How to use checksums |
2f7fa60c57f31259e55579ff1f87565d381dd8d871bdb9c5bd2efdc9cab68919
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.23
|