Metadata-Version: 2.4
Name: mat3ra-api-client
Version: 2026.3.11.post0
Summary: Mat3ra.com Python Client for RESTful API
Author-email: "Exabyte Inc." <info@mat3ra.com>
License: # LICENSE
        
        Copyright 2019 Exabyte Inc.
        
        Licensed under the Apache License, Version 2.0 (the "License");
        you may not use this file except in compliance with the License.
        You may obtain a copy of the License at
        
           http://www.apache.org/licenses/LICENSE-2.0
        
        Unless required by applicable law or agreed to in writing, software
        distributed under the License is distributed on an "AS IS" BASIS,
        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
        See the License for the specific language governing permissions and
        limitations under the License.
        
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development
Classifier: License :: OSI Approved :: Apache Software License
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: requests>=2.26.0
Requires-Dist: pydantic<3,>=2
Provides-Extra: dev
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: isort; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: pip-tools; extra == "dev"
Provides-Extra: tests
Requires-Dist: coverage[toml]>=5.3; extra == "tests"
Requires-Dist: pytest; extra == "tests"
Requires-Dist: pytest-cov; extra == "tests"
Requires-Dist: mock>=4.0.3; extra == "tests"
Provides-Extra: all
Requires-Dist: mat3ra-api-client[tests]; extra == "all"
Requires-Dist: mat3ra-api-client[dev]; extra == "all"
Dynamic: license-file

[![PyPI version](https://badge.fury.io/py/mat3ra-api-client.svg)](https://badge.fury.io/py/mat3ra-api-client)

This package provides access to Mat3ra.com [RESTful API](https://docs.mat3ra.com/rest-api/overview/).

# Installation

We recommend creating a virtual environment before installing:

```bash
virtualenv my-virtualenv
source my-virtualenv/bin/activate
```

Install using pip:

- from PyPI:

```bash
pip install mat3ra-api-client
```

- from source code in development mode:

```bash
git clone git@github.com:Exabyte-io/api-client.git
cd api-client
pip install -e .
```

# Usage

```python
from mat3ra.api_client import APIClient

# Authenticate with OIDC token
client = APIClient.authenticate()

# Access endpoints
materials = client.materials.list()
```

# Examples

[api-examples](https://github.com/Exabyte-io/api-examples) repository contains examples for performing most-common tasks in the Mat3ra.com platform through its RESTful API in Jupyter Notebook format.

# Testing

The package uses pytest for testing. Tests are organized into unit and integration tests.

## Running Tests

### Unit Tests (No environment setup required)

Run all unit tests:
```bash
pytest tests/py/unit
```

### Integration Tests (Requires API credentials)

Integration tests require the following environment variables to be set:

- `TEST_HOST` - API host (e.g., `platform.mat3ra.com`)
- `TEST_PORT` - API port (e.g., `443`)
- `TEST_ACCOUNT_ID` - Your account ID
- `TEST_AUTH_TOKEN` - Your authentication token
- `TEST_SECURE` - Use HTTPS (optional, default: `False`)
- `TEST_VERSION` - API version (optional, default: `2018-10-01`)

To run integration tests:
```bash
export TEST_HOST=platform.mat3ra.com
export TEST_PORT=443
export TEST_ACCOUNT_ID=your-account-id
export TEST_AUTH_TOKEN=your-auth-token
export TEST_SECURE=true

pytest tests/py/integration
```

### Run All Tests

```bash
pytest tests/py
```

### Run Tests with Coverage

```bash
pytest tests/py/unit --cov=mat3ra.api_client --cov-report=term --cov-report=html
```

**Note:** Integration tests will be automatically skipped if required environment variables are not set.


© 2020 Exabyte Inc.
