Perform compliance analysis on materials data stored in Granta MI.
Project description
Project Overview
This project is part of the larger PyAnsys effort to facilitate the use of Ansys technologies directly from within Python.
The Granta MI Restricted Substances solution includes a REST API for evaluating compliance of products, assemblies, specifications and materials against legislations. This package abstracts automatically- generated code into an easy-to-use client library.
Installation
Install ansys-grantami-bomanalytics with:
pip install ansys-grantami-bomanalytics
Alternatively, clone and install with:
git clone https://github.com/pyansys/grantami-bomanalytics
cd grantami-bomanalytics
pip install .
Documentation
See Granta MI BoM Analytics Documentation for more details.
Usage
Here’s a brief example of how the package works:
# Connect and query the Granta service.
>>> from pprint import pprint
>>> from ansys.grantami.bomanalytics import Connection, queries
>>> cxn = Connection("http://my_grantami_server/mi_servicelayer").with_autologon().connect()
>>> query = (
... queries.MaterialImpactedSubstancesQuery()
... .with_material_ids(['plastic-abs-pvc-flame'])
... .with_legislations(['REACH - The Candidate List'])
... )
# Print out the result from the query.
>>> result = cxn.run(query)
>>> pprint(result.impacted_substances)
[<ImpactedSubstance: {"cas_number": 10108-64-2, "percent_amount": 1.9}>,
<ImpactedSubstance: {"cas_number": 107-06-2, "percent_amount": None}>,
<ImpactedSubstance: {"cas_number": 115-96-8, "percent_amount": 15.0}>,
...
Testing
See Contributing for more details.
License
The library is provided under the terms of the MIT license, you can find the license text in the LICENSE file at the root of the repository.
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 Distributions
Built Distribution
File details
Details for the file ansys_grantami_bomanalytics-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: ansys_grantami_bomanalytics-1.0.1-py3-none-any.whl
- Upload date:
- Size: 41.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9f73ee3dacf826cca67f6daaf93bb8f1b1b0fb163e134c736e57fa6b97f4556 |
|
MD5 | 924a71c340976bffb5ffd77f7c9f0ab3 |
|
BLAKE2b-256 | 14f47aecd944e2d2094338f2a22c2b74835297702fa1b67a98477ce2301574ef |