Metadata-Version: 2.4
Name: tagmapper
Version: 0.9.1
Summary: Python wrapper for Equinor SPD tag mapping database
Author: Åsmund Våge Fannemel
Author-email: asmf@equinor.com
Requires-Python: >=3.10.0,<4.0
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: Programming Language :: Python :: 3.14
Requires-Dist: certifi (>=2025.1.31)
Requires-Dist: commonlib-reader (>=1.1.0,<2.0.0)
Requires-Dist: eq-api-connector (>=1.0.0,<2.0.0)
Requires-Dist: pandas (>=2.2.2,<3.0.0)
Requires-Dist: pyyaml (>=6.0.2,<7.0.0)
Description-Content-Type: text/markdown

# tagmapper-sdk [![SNYK dependency check](https://github.com/equinor/tagmapper-sdk/actions/workflows/snyk.yml/badge.svg)](https://github.com/equinor/tagmapper-sdk/actions/workflows/snyk.yml)
Python package to get timeseries and constant value mappings for data models from SDP tag mapping library.

It supports SDP defined models for Separators and Wells as well as generic models with or without a defined schema.

Authentication is done using Azure credentials and bearer tokens. Access to Equinor internal network, e.g., office network or VPN Location_All, is required to access data.


## Use
1. See [demo](examples/demo_spd_classes.py). Or try the following simple code.  
    ```python
    from tagmapper import Well

    w = Well("NO 30/6-E-2")
    w.print_report()
    ```

2. Getting a generic model with no schema from API:  
   See [demo](examples/demo_get_models.py). Example usage:
     ```python
     from tagmapper import Model

     available_models = Model.get_model_names()
     model_owner = available_models[0]["model_owner"]
     model_name = available_models[0]["model_name"]
     object_names = Model.get_object_names(model_owner=model_owner, model_name=model_name)

     # Fetch a model from api
     mod = Model.get_model(
     model_owner=model_owner,
     model_name=model_name,
     object_name=object_names[0])
     mod.print_report()
     ```

## Installing
Install from pypi using pip.  
``
pip install tagmapper
``


## Developing
Clone repo and run ``poetry install`` to install dependencies.


## Testing and code coverage
Run tests and check coverage using pytest-cov
``poetry run pytest --cov=. --cov-report=xml:coverage.xml``



Compare coverage with modified lines against main branch
``diff-cover coverage.xml --compare-branch=origin/main``


