Skip to content

Commit 88ae193

Browse files
Resolved issue #225
1 parent 9a94bab commit 88ae193

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

prometheus_api_client/__init__.py

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
1+
12
"""A collection of tools to collect and manipulate prometheus metrics."""
23

34
__title__ = "prometheus-connect"
45
__version__ = "0.5.7"
56

6-
from .prometheus_connect import * # noqa F403
7-
from .metric import Metric # noqa F401
8-
from .metrics_list import MetricsList # noqa F401
9-
from .metric_snapshot_df import MetricSnapshotDataFrame # noqa F401
10-
from .metric_range_df import MetricRangeDataFrame # noqa F401
7+
def __getattr__(name):
8+
if name == "PrometheusConnect":
9+
from .prometheus_connect import PrometheusConnect
10+
return PrometheusConnect
11+
elif name == "Metric":
12+
from .metric import Metric
13+
return Metric
14+
elif name == "MetricsList":
15+
from .metrics_list import MetricsList
16+
return MetricsList
17+
elif name == "MetricSnapshotDataFrame":
18+
from .metric_snapshot_df import MetricSnapshotDataFrame
19+
return MetricSnapshotDataFrame
20+
elif name == "MetricRangeDataFrame":
21+
from .metric_range_df import MetricRangeDataFrame
22+
return MetricRangeDataFrame
23+
raise AttributeError(f"module {__name__} has no attribute {name}")

0 commit comments

Comments
 (0)