Skip to main content

tagmapper-sdk

Python SDK for retrieving timeseries and constant value mappings for data models from the SDP tag mapping library.

Overview

tagmapper-sdk provides a simple, typed interface to fetch and work with data model mappings. It supports:

  • SDP-defined models for Separators and Wells
  • Generic models with optional schema validation
  • Azure authentication with bearer token management
  • Structured data access with intelligent mapping and reporting

Note: Requires access to Equinor internal network (office network or VPN Location_All)

Installation

Install from PyPI:

pip install tagmapper

Quick Start

Working with Pre-defined Models

The following SDP-defined models are available out-of-the-box:

  • Well – Well data and timeseries mappings
  • Separator – Separator equipment mappings
  • Pipe – Pipe (flowline) mappings
from tagmapper import Well

# Create a well object
w = Well("NO 30/6-E-2")

# Print the default report
w.print_report()

# Print a formatted report
w.print_formatted_report()

See well demo for more examples.

Working with Generic Models

from tagmapper import Model

# List available models
available_models = Model.get_model_names()
model_owner = available_models[0]["model_owner"]
model_name = available_models[0]["model_name"]

# Get object names for a model
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()

See model demo for additional examples.

Looking Up a Facility

Resolve a STID installation code or an existing government facility name:

from tagmapper import resolve_facility_name

facility_name = resolve_facility_name(facility_code="ASGA")

The lookup uses the SPD production /facility-master endpoint and restores the API client's previous environment selection after the request. If the endpoint returns HTTP 404/410 or a server error (5xx), or the request fails with a connection error or timeout, it falls back to CommonLib's governmental facility-name resolver. Authentication and authorization errors are not masked by the fallback. A successful SPD response requires exactly one distinct, non-empty gov_fcty_name matching either the ims_facility code or the government name itself. If the code query returns no rows, the lookup retries using the gov_fcty_name filter. Missing or ambiguous matches raise ValueError.

Development

Prerequisites

  • Python 3.10+
  • uv for dependency management

Setup

Clone the repository and install dependencies:

git clone https://github.com/equinor/tagmapper-sdk.git
cd tagmapper-sdk
uv sync

Testing

Run tests with coverage reporting:

uv run pytest --cov=. --cov-report=xml:coverage.xml

Compare coverage against the main branch:

diff-cover coverage.xml --compare-branch=origin/main

Contributing

Contributions are welcome! Please ensure:

  • All tests pass: uv run pytest
  • Code coverage remains above the current baseline
  • Changes are well-documented with clear commit messages

Metadata

Release files for tagmapper 0.9.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tagmapper 0.9.6
File Size Uploaded Provenance Actions
tagmapper-0.9.6.tar.gz 16.7 kB Without provenance Details for tagmapper-0.9.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tagmapper 0.9.6
File Interpreter ABI Platform Actions
tagmapper-0.9.6-py3-none-any.whl Python 3 none any Details for tagmapper-0.9.6-py3-none-any.whl

Total release size: 37.6 kB

Release files / tagmapper-0.9.6.tar.gz

Download URL tagmapper-0.9.6.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c7c6c48c62ea440f673cf8765b21fd542d65a49f70d0dfc74c9cb9de6b11bf04
BLAKE2b-256 checksum
How to use checksums
5372c05a0b0b5178e69385702110e5e8d67421bffa67ac2ce0d8118063c5fc87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.3.3 CPython/3.13.7 Darwin/27.2.0

Release files / tagmapper-0.9.6-py3-none-any.whl

Download URL tagmapper-0.9.6-py3-none-any.whl
Size 20.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b9f4bf0da5c05d5b0438abcc4277b4bc95d959aecb983b681108ca4571500332
BLAKE2b-256 checksum
How to use checksums
59d862fb131d05242ff847bb8c34fa8a3ac3374a132fe2ab18ac999330e63f0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.3.3 CPython/3.13.7 Darwin/27.2.0

Security for tagmapper 0.9.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.9.6 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page