Metadata-Version: 2.1
Name: tagmapper
Version: 0.3.3
Summary: Python wrapper for sql tag mapping database
Author: Åsmund Våge Fannemel
Author-email: asmf@equinor.com
Requires-Python: >=3.9.2,<4.0.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: azure-identity (>=1.17.1,<2.0.0)
Requires-Dist: certifi (>=2025.1.31)
Requires-Dist: msal-bearer (>=1.3.0,<2.0.0)
Requires-Dist: pandas (>=2.2.2,<3.0.0)
Requires-Dist: pyodbc (>=5.1.0,<6.0.0)
Requires-Dist: requests (>=2.31.0,<3.0.0)
Requires-Dist: sqlalchemy (>=2.0.28,<3.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)
Prototype python package to get IMS-tag mappings for data models for separators and wells.

Authentication is done using Azure credentials and bearer tokens.


## Use
1. See [demo](examples/demo_well.py). Or try the following simple code.  
    ```python
    from tagmapper import Well
    w = Well("NO 30/6-E-2")  
    ```

2. Fetching the base view (well_attributes_mapped_to_timeseries_base) from the API: <br>
    Refer to examples/demo_api_func.py:<br>
    Fetch data for all facilities:<br>
    ```python
    from tagmapper.base_model import get_data_base_well
    df = get_data_base_well(limit=100000, offset=0) 
    print(df)
    ```
    Fetch data for selected facilities:
    ```python
    from tagmapper.base_model import get_data_base_well
    facility_names = ['STATFJORD B','JOHAN SVERDRUP RP']
    df = get_data_base_well(facility_names, limit=10000, offset=0) # More facilit
    print(df)
    ```


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


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


## Testing
Run tests and check coverage using pytest-cov
``poetry run pytest --cov=tagmapper test/ --cov-report html``

