A testing library for Speckle models
Project description
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
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 maple_spec-0.1.1.tar.gz.
File metadata
- Download URL: maple_spec-0.1.1.tar.gz
- Upload date:
- Size: 20.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3aed4d93195b2f597a4c6b43a1d3437697efbaea9b17dc46150e112d2bff8e62
|
|
| MD5 |
ac68f2a1a6f870df90ffe2e8e933388b
|
|
| BLAKE2b-256 |
c85d79d13537c25a0af567961c110aea8b9eec62b3d06592f65325857356c33b
|
File details
Details for the file maple_spec-0.1.1-py3-none-any.whl.
File metadata
- Download URL: maple_spec-0.1.1-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c3619193748b16bce87f7450a617e985eb41456b913f673dc4f09f56ba53e18
|
|
| MD5 |
a181d5f4c0f47572fb88f87d2c4a8b93
|
|
| BLAKE2b-256 |
b4d21e20ae17831f8d54d9ef3afb2dfa001608bc401474f0fe02891f6c0b4b6f
|