Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

maple_spec-0.0.11.tar.gz (20.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

maple_spec-0.0.11-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file maple_spec-0.0.11.tar.gz.

File metadata

  • Download URL: maple_spec-0.0.11.tar.gz
  • Upload date:
  • Size: 20.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for maple_spec-0.0.11.tar.gz
Algorithm Hash digest
SHA256 fb7765e6aa7c4e02ee174d4808133f4eb7957ea96793bd723d2a4c4d2fc86665
MD5 4d187e882a4024b4e89df004259c417d
BLAKE2b-256 50a6fb00ff609aa62f22061e19ddf596cbc98816fe01588a80e58006fc18d8c4

See more details on using hashes here.

File details

Details for the file maple_spec-0.0.11-py3-none-any.whl.

File metadata

  • Download URL: maple_spec-0.0.11-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for maple_spec-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 ed441b4a1cf74381f7d81bb03377fbb9e7f46c840fe20b67c1c6f5b7ac17d165
MD5 7499b17edc4591231db49fb145d3f854
BLAKE2b-256 0150474d281edd8b0d7628438126dd391989a897fc9e15184206188ab1a18f47

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page