commonlib-reader 1.1.2__tar.gz → 1.1.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- commonlib_reader-1.1.3/PKG-INFO +41 -0
- {commonlib_reader-1.1.2 → commonlib_reader-1.1.3}/README.md +5 -5
- {commonlib_reader-1.1.2 → commonlib_reader-1.1.3}/pyproject.toml +9 -9
- {commonlib_reader-1.1.2 → commonlib_reader-1.1.3/src}/commonlib_reader/connector.py +10 -4
- commonlib_reader-1.1.2/PKG-INFO +0 -49
- {commonlib_reader-1.1.2 → commonlib_reader-1.1.3/src}/commonlib_reader/__init__.py +0 -0
- {commonlib_reader-1.1.2 → commonlib_reader-1.1.3/src}/commonlib_reader/discipline.py +0 -0
- {commonlib_reader-1.1.2 → commonlib_reader-1.1.3/src}/commonlib_reader/facility.py +0 -0
- {commonlib_reader-1.1.2 → commonlib_reader-1.1.3/src}/commonlib_reader/ims.py +0 -0
- {commonlib_reader-1.1.2 → commonlib_reader-1.1.3/src}/commonlib_reader/tag.py +0 -0
- {commonlib_reader-1.1.2 → commonlib_reader-1.1.3/src}/commonlib_reader/unit.py +0 -0
- {commonlib_reader-1.1.2 → commonlib_reader-1.1.3/src}/commonlib_reader/utils.py +0 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: commonlib-reader
|
|
3
|
+
Version: 1.1.3
|
|
4
|
+
Summary: Reader for Equinor commonlib api.
|
|
5
|
+
Author: Åsmund Våge Fannemel
|
|
6
|
+
Author-email: Åsmund Våge Fannemel <asmf@equinor.com>
|
|
7
|
+
License: MIT
|
|
8
|
+
Requires-Dist: pandas>=2.1.4
|
|
9
|
+
Requires-Dist: requests>=2.32.4
|
|
10
|
+
Requires-Dist: urllib3>=2.5.0
|
|
11
|
+
Requires-Dist: eq-api-connector>=1.0.0,<2.0.0
|
|
12
|
+
Requires-Python: >=3.10, <4.0.0
|
|
13
|
+
Project-URL: Repository, https://github.com/equinor/commonlib-reader.git
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
|
|
16
|
+
# commonlib-reader
|
|
17
|
+
Connector package for Equinor [Commonlib](https://commonlib.equinor.com/) [api](https://commonlibapi.equinor.com/swagger/index.html).
|
|
18
|
+
|
|
19
|
+
Current features:
|
|
20
|
+
- Reading code tables
|
|
21
|
+
- Getting facility data using the [Facility](commonlib_reader/facility.py) class
|
|
22
|
+
- [IMS source ](commonlib_reader/ims.py) lookup tables for facilities
|
|
23
|
+
- Getting Tag category, Tag type, Tag format, and Tag format element data. See [tag.py](commonlib_reader/tag.py)
|
|
24
|
+
- Getting [units of measure](commonlib_reader/ims.py) definitions.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## Use
|
|
28
|
+
Try it out by running the [demo](examples/demo.py).
|
|
29
|
+
|
|
30
|
+
## Installing
|
|
31
|
+
|
|
32
|
+
Install package from pypi using `pip install commonlib_reader`
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
## Developing / testing
|
|
36
|
+
|
|
37
|
+
uv is preferred for developers. Clone and install with required packages for testing and coverage:
|
|
38
|
+
`uv sync`
|
|
39
|
+
|
|
40
|
+
For testing with coverage run:
|
|
41
|
+
`uv run pytest --cov --cov-report=html`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# commonlib-reader
|
|
1
|
+
# commonlib-reader
|
|
2
2
|
Connector package for Equinor [Commonlib](https://commonlib.equinor.com/) [api](https://commonlibapi.equinor.com/swagger/index.html).
|
|
3
3
|
|
|
4
4
|
Current features:
|
|
@@ -19,8 +19,8 @@ Install package from pypi using `pip install commonlib_reader`
|
|
|
19
19
|
|
|
20
20
|
## Developing / testing
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
`
|
|
22
|
+
uv is preferred for developers. Clone and install with required packages for testing and coverage:
|
|
23
|
+
`uv sync`
|
|
24
24
|
|
|
25
|
-
For testing with coverage run:
|
|
26
|
-
`
|
|
25
|
+
For testing with coverage run:
|
|
26
|
+
`uv run pytest --cov --cov-report=html`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "commonlib-reader"
|
|
3
|
-
version = "1.1.
|
|
3
|
+
version = "1.1.3"
|
|
4
4
|
description = "Reader for Equinor commonlib api."
|
|
5
5
|
authors = [
|
|
6
6
|
{ name = "Åsmund Våge Fannemel", email = "asmf@equinor.com" }
|
|
@@ -16,13 +16,13 @@ dependencies = [
|
|
|
16
16
|
"eq-api-connector (>=1.0.0,<2.0.0)"
|
|
17
17
|
]
|
|
18
18
|
|
|
19
|
-
[
|
|
20
|
-
|
|
21
|
-
pytest
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
[dependency-groups]
|
|
20
|
+
dev = [
|
|
21
|
+
"pytest>=7.4.4,<8.0.0",
|
|
22
|
+
"pytest-cov>=7.0.0,<8.0.0",
|
|
23
|
+
"black>=24.1.1,<27.0.0"
|
|
24
|
+
]
|
|
25
25
|
|
|
26
26
|
[build-system]
|
|
27
|
-
requires = ["
|
|
28
|
-
build-backend = "
|
|
27
|
+
requires = ["uv_build>=0.11.16,<0.12"]
|
|
28
|
+
build-backend = "uv_build"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from eq_api_connector import APIConnector
|
|
2
2
|
|
|
3
|
-
_connector = None
|
|
3
|
+
_connector: APIConnector | None = None
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
def get_connector() -> APIConnector:
|
|
@@ -13,17 +13,23 @@ def get_connector() -> APIConnector:
|
|
|
13
13
|
if _connector is None:
|
|
14
14
|
clientID = "728cfddd-b8e9-4ed7-b9a3-8f2fd5b8e79a"
|
|
15
15
|
scopes = ["37d598fc-da0f-46bd-949f-7107918d47a5/user_impersonation"]
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
connector = APIConnector(client_id=clientID, scope=scopes)
|
|
17
|
+
connector.set_url_prod("https://commonlibapi.equinor.com/")
|
|
18
|
+
_connector = connector
|
|
18
19
|
|
|
19
20
|
return _connector
|
|
20
21
|
|
|
21
22
|
|
|
22
|
-
def set_connector(connector: APIConnector):
|
|
23
|
+
def set_connector(connector: APIConnector) -> None:
|
|
23
24
|
"""Set the singleton instance of the APIConnector.
|
|
24
25
|
|
|
25
26
|
Args:
|
|
26
27
|
connector (APIConnector): An instance of the APIConnector class.
|
|
27
28
|
"""
|
|
28
29
|
global _connector
|
|
30
|
+
|
|
31
|
+
if not isinstance(connector, APIConnector):
|
|
32
|
+
raise TypeError(
|
|
33
|
+
f"Connector must be an instance of APIConnector, got {type(connector).__name__}."
|
|
34
|
+
)
|
|
29
35
|
_connector = connector
|
commonlib_reader-1.1.2/PKG-INFO
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: commonlib-reader
|
|
3
|
-
Version: 1.1.2
|
|
4
|
-
Summary: Reader for Equinor commonlib api.
|
|
5
|
-
License: MIT
|
|
6
|
-
Author: Åsmund Våge Fannemel
|
|
7
|
-
Author-email: asmf@equinor.com
|
|
8
|
-
Requires-Python: >=3.10,<4.0.0
|
|
9
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
-
Classifier: Programming Language :: Python :: 3
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
-
Requires-Dist: eq-api-connector (>=1.0.0,<2.0.0)
|
|
17
|
-
Requires-Dist: pandas (>=2.1.4)
|
|
18
|
-
Requires-Dist: requests (>=2.32.4)
|
|
19
|
-
Requires-Dist: urllib3 (>=2.5.0)
|
|
20
|
-
Project-URL: Repository, https://github.com/equinor/commonlib-reader.git
|
|
21
|
-
Description-Content-Type: text/markdown
|
|
22
|
-
|
|
23
|
-
# commonlib-reader [](https://github.com/equinor/commonlib-reader/actions/workflows/snyk.yml)
|
|
24
|
-
Connector package for Equinor [Commonlib](https://commonlib.equinor.com/) [api](https://commonlibapi.equinor.com/swagger/index.html).
|
|
25
|
-
|
|
26
|
-
Current features:
|
|
27
|
-
- Reading code tables
|
|
28
|
-
- Getting facility data using the [Facility](commonlib_reader/facility.py) class
|
|
29
|
-
- [IMS source ](commonlib_reader/ims.py) lookup tables for facilities
|
|
30
|
-
- Getting Tag category, Tag type, Tag format, and Tag format element data. See [tag.py](commonlib_reader/tag.py)
|
|
31
|
-
- Getting [units of measure](commonlib_reader/ims.py) definitions.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
## Use
|
|
35
|
-
Try it out by running the [demo](examples/demo.py).
|
|
36
|
-
|
|
37
|
-
## Installing
|
|
38
|
-
|
|
39
|
-
Install package from pypi using `pip install commonlib_reader`
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
## Developing / testing
|
|
43
|
-
|
|
44
|
-
Poetry is preferred for developers. Clone and install with required packages for testing and coverage:
|
|
45
|
-
`poetry install`
|
|
46
|
-
|
|
47
|
-
For testing with coverage run:
|
|
48
|
-
`poetry run pytest --cov --cov-report=html`
|
|
49
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|