Skip to content

Commit 74ac574

Browse files
Add function to list all entities of a specific type (#120)
1 parent d48a026 commit 74ac574

35 files changed

Lines changed: 763 additions & 125 deletions

.flake8

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[flake8]
2+
max_line_length = 120

.github/workflows/pull_request.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ jobs:
66
- uses: actions/checkout@v3
77
- run: /root/.local/bin/poetry install
88
- run: /root/.local/bin/poetry run black --check .
9+
- run: /root/.local/bin/poetry run flake8
10+
- run: /root/.local/bin/poetry run isort -c .
911
- run: /root/.local/bin/poetry run mypy .
1012
- run: /root/.local/bin/poetry run pydocstyle
1113

.isort.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[settings]
2+
profile = black

poetry.lock

Lines changed: 91 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ python-dateutil = "^2.8.2"
1717
requests = "^2.28.1"
1818
simplejson = "^3.17.6"
1919
typing-extensions = "^4.3.0"
20+
more-itertools = "^8.14.0"
2021

2122
[tool.poetry.dev-dependencies]
2223
black = "^22.6.0"
23-
pydocstyle = "^6.1.1"
2424

2525
[tool.poetry.group.dev.dependencies]
2626
mypy = "^0.981"
@@ -31,4 +31,6 @@ pytest = "^7.1.3"
3131
hypothesis = "^6.54.6"
3232
jsonschema = "^4.16.0"
3333
types-jsonschema = "^4.16.1"
34-
34+
isort = "^5.10.1"
35+
flake8 = "^5.0.4"
36+
pydocstyle = "^6.1.1"

src/elimity_insights_client/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
being defined in the local system timezone.
66
"""
77

8+
from elimity_insights_client._domain_graph_schema import (
9+
AttributeType,
10+
DomainGraphSchema,
11+
EntityType,
12+
RelationshipAttributeType,
13+
Type,
14+
)
815
from elimity_insights_client._elimity_insights_client import (
916
AttributeAssignment,
1017
BooleanValue,
@@ -24,13 +31,6 @@
2431
TimeValue,
2532
Value,
2633
)
27-
from elimity_insights_client._domain_graph_schema import (
28-
AttributeType,
29-
DomainGraphSchema,
30-
EntityType,
31-
RelationshipAttributeType,
32-
Type,
33-
)
3434

3535
__all__ = [
3636
"AttributeAssignment",

src/elimity_insights_client/_decode_domain_graph_schema.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
from typing import List
22

3-
from typing_extensions import TypedDict, NotRequired
3+
from typing_extensions import NotRequired, TypedDict
44

55
from elimity_insights_client._domain_graph_schema import (
6-
DomainGraphSchema,
76
AttributeType,
8-
RelationshipAttributeType,
7+
DomainGraphSchema,
98
EntityType,
9+
RelationshipAttributeType,
1010
Type,
1111
)
1212
from elimity_insights_client._util import map_list

src/elimity_insights_client/_elimity_insights_client.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,15 @@
22
from datetime import datetime
33
from enum import Enum, auto
44
from itertools import chain
5-
from typing import Optional, Union, Iterable, Tuple, Dict
5+
from typing import Dict, Iterable, Optional, Tuple, Union
66
from zlib import compressobj
77

8-
from requests import request, Response
8+
from requests import Response, request
99

1010
from elimity_insights_client._decode_domain_graph_schema import (
1111
decode_domain_graph_schema,
1212
)
13-
from elimity_insights_client._domain_graph_schema import (
14-
DomainGraphSchema,
15-
)
13+
from elimity_insights_client._domain_graph_schema import DomainGraphSchema
1614
from elimity_insights_client._util import encode_datetime, encoder
1715

1816

src/elimity_insights_client/_util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from datetime import datetime
2-
from simplejson import JSONEncoder
3-
from typing import TypeVar, Callable, List
2+
from typing import Callable, List, TypeVar
43

54
from dateutil.tz import tzlocal
65
from dateutil.utils import default_tzinfo
6+
from simplejson import JSONEncoder
77

88
encoder = JSONEncoder(iterable_as_array=True)
99
local_timezone = tzlocal()

src/elimity_insights_client/api/_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
"""Endpoints for API interactions with an Elimity Insights server."""
22

33
from dataclasses import dataclass
4-
from typing import List, TypeVar, cast, Type, Optional
4+
from typing import List, Optional, Type, TypeVar, cast
55

66
from requests import request
77

88
from elimity_insights_client._util import encoder, map_list
99
from elimity_insights_client.api._decode_query_results_page import (
10-
decode_query_results_page,
1110
QueryResultsPageDict,
11+
decode_query_results_page,
1212
)
1313
from elimity_insights_client.api._decode_source import SourceDict, decode_source
14+
from elimity_insights_client.api._encode_query import encode_query
1415
from elimity_insights_client.api.query import Query
1516
from elimity_insights_client.api.query_results_page import QueryResultsPage
16-
from elimity_insights_client.api._encode_query import encode_query
1717
from elimity_insights_client.api.source import Source
1818

1919

0 commit comments

Comments
 (0)