Skip to main content

Perform compliance analysis on materials data stored in Granta MI.

Project description

Project Overview

PyGranta BoM Analytics is part of the larger PyAnsys effort to facilitate the use of Ansys technologies directly from 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 the ansys-grantami-bomanalytics package with this code:

pip install ansys-grantami-bomanalytics

Alternatively, clone and install this package with this code:

git clone https://github.com/pyansys/grantami-bomanalytics
cd grantami-bomanalytics
pip install .

Documentation

The PyGranta BoM Analytics Documentation provides comprehensive installation and usage information.

Usage

Here’s a brief example of how to use PyGranta BoM Analytics:

# 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(['EU 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

For information on testing, see the Contributing section of the documentation.

License

PyGranta BoM Analytics is provided under the terms of the MIT license. You can find this license in the LICENSE file at the root of the repository.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

File details

Details for the file ansys_grantami_bomanalytics-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ansys_grantami_bomanalytics-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 48b4f6e7161958b3d3e5055286b8fbb4de0a736a70261f458d0d69221a02083e
MD5 ce4b87465d6172b4f1aba35ae71bdbb3
BLAKE2b-256 daacd0fc1c64ca965e29cdad8e0a37f393c5ca9a2dbf34e20a2c550ad3cfb1c1

See more details on using hashes here.

Supported by

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