Skip to main content

commonlib-reader

Connector package for Equinor Commonlib api.

See the changelog for release history.

Current features:

  • Reading any code table with the Code class
  • Reading library definitions and attribute definitions with the Library and AttributeDefinition classes
  • Reading projects with the Project class
  • Getting facility data using the Facility class
  • IMS source lookup tables for facilities
  • Getting Tag category, Tag type, Tag format, and Tag format element data. See tag.py
  • Getting units of measure definitions.

Use

Try it out by running the demo.

Libraries and codes

A Library defines a code table and its attribute schema; a Code is one entry in that table. Use package-provided specialized readers when available, such as Facility, Discipline, Unit, TagType, TagCategory, and TagFormat; otherwise use the generic Code reader.

Libraries

Use Library to discover available code tables and inspect their definitions.

from commonlib_reader import Library

library_names = Library.get_names()
discipline_library = Library.get("Discipline")
attribute_definitions = discipline_library.attribute_definitions
is_scoped = discipline_library.is_scope_specific
scope_type = discipline_library.scope_type

Library.get_all() supports name and scope filters. Each AttributeDefinition provides its name, description, required status, identity participation, validation regular expression, and referenced library name.

Check is_scope_specific and scope_type before retrieving codes. For example, when scope_type is "Facility" and is_scope_specific is True, pass the facility installation code, such as "TROC", as scope.

Code tables

Use Code.get_codes() to retrieve entries from any CommonLib code table. Filter by installation scope or code name when needed.

from commonlib_reader import Code

disciplines = Code.get_codes("Discipline", scope="TROC")
administration = Code.get_codes("Discipline", scope="TROC", name="A")

Each entry provides name, description, identity, is_valid, attributes, and other CommonLib metadata. Use Code.get_names() or Code.get_name_and_desc() when only dropdown-friendly names or name/description data is required.

Projects

Use Project.get_all() to retrieve projects and optionally filter by name or abbreviation.

from commonlib_reader import Project

projects = Project.get_all(name="M.IGLED.6I.X.0010")
matching_projects = Project.get_all(abbreviation="IGLED")

Installing

Install package from pypi using pip install commonlib_reader

Developing / testing

uv is preferred for developers. Clone and install with required packages for testing and coverage: uv sync

For testing with coverage run: uv run pytest --cov --cov-report=html

Metadata

Release files for commonlib-reader 1.4.1

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

Source distribution (sdist)

Source distribution for commonlib-reader 1.4.1
File Size Uploaded Provenance Actions
commonlib_reader-1.4.1.tar.gz 16.4 kB Without provenance Details for commonlib_reader-1.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for commonlib-reader 1.4.1
File Interpreter ABI Platform Actions
commonlib_reader-1.4.1-py3-none-any.whl Python 3 none any Details for commonlib_reader-1.4.1-py3-none-any.whl

Total release size: 37.5 kB

Release files / commonlib_reader-1.4.1.tar.gz

Download URL commonlib_reader-1.4.1.tar.gz
Size 16.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6f9695d2d99a272ac3599dd9d9226ab1393c368205728f9f8ae5c1871cb1d3cf
BLAKE2b-256 checksum
How to use checksums
6c638b61e5a3fd000a5e978fd0177d6ab9033eccffab780541af8e0ed04af3ec
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 / commonlib_reader-1.4.1-py3-none-any.whl

Download URL commonlib_reader-1.4.1-py3-none-any.whl
Size 21.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
06808c2d0de2e40953130793acc0cac151b4cc9e5888fb523912bfe61842beb4
BLAKE2b-256 checksum
How to use checksums
0b086db9008c874646d3e2aed62a5c559a9b345749610b5c652597cacfcb351b
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 commonlib-reader 1.4.1

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.

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