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.2

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.2
File Size Uploaded Provenance Actions
commonlib_reader-1.4.2.tar.gz 16.2 kB Without provenance Details for commonlib_reader-1.4.2.tar.gz

Built distribution (wheel)

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

Total release size: 37.1 kB

Release files / commonlib_reader-1.4.2.tar.gz

Download URL commonlib_reader-1.4.2.tar.gz
Size 16.2 kB
Tags Source
SHA-256 checksum
How to use checksums
fe46dcd0f2161f694bf53819babbb60b00932da85af245b3a72fbf452bdb6b8f
BLAKE2b-256 checksum
How to use checksums
cbed6f9e1204e3d7e715c8c77504f5b9e4f2641cef38272f76b03a8328d62e98
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.2-py3-none-any.whl

Download URL commonlib_reader-1.4.2-py3-none-any.whl
Size 20.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
637d01c2114dd0d873e62e8a585f569984fba2fd610bb206b5f12fdadfbac632
BLAKE2b-256 checksum
How to use checksums
cc7780b457f24c12be3d4e600a6d9f40bff859671d2f5b0562d983371a22959e
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.2

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