Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Insights server.

## Usage

### Custom source interactions
### Importing data to custom sources

The following snippet shows how to authenticate as a custom source and create a connector log at an Elimity Insights
server. You can generate a source identifier and token by visiting the custom source's detail page in Elimity Insights
Expand All @@ -26,14 +26,14 @@ if __name__ == "__main__":
client.create_connector_logs(logs)
```

### Agent interactions
### Other API interactions

This module also provides a client for agent interactions with Elimity Insights. The snippet below shows how to
authenticate as an agent and list sources at an Elimity Insights server. You can generate a token identifier and
This module also provides a client for other API interactions with Elimity Insights. The snippet below shows how to
authenticate with an API token and list sources at an Elimity Insights server. You can generate a token identifier and
secret by visiting the 'API tokens' page in Elimity Insights and clicking the 'CREATE API TOKEN' button.

```python3
from elimity_insights_client.agent.api import Config, sources
from elimity_insights_client.api import Config, sources

if __name__ == "__main__":
config = Config(token_id="1", token_secret="my-secret-value", url="https://example.elimity.com", verify_ssl=True)
Expand Down
1 change: 0 additions & 1 deletion src/elimity_insights_client/agent/__init__.py

This file was deleted.

4 changes: 4 additions & 0 deletions src/elimity_insights_client/api/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"""Elimity Insights client for API interactions."""
from elimity_insights_client.api._api import Config, query, sources

__all__ = ["Config", "query", "sources"]
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
"""API endpoints for agent interactions with an Elimity Insights server."""
"""Endpoints for API interactions with an Elimity Insights server."""

from dataclasses import dataclass
from typing import List, TypeVar, cast, Type, Optional

from requests import request

from elimity_insights_client._util import encoder, map_list
from elimity_insights_client.agent._decode_query_results_page import (
from elimity_insights_client.api._decode_query_results_page import (
decode_query_results_page,
QueryResultsPageDict,
)
from elimity_insights_client.agent._decode_source import SourceDict, decode_source
from elimity_insights_client.agent.query import Query
from elimity_insights_client.agent.query_results_page import QueryResultsPage
from elimity_insights_client.agent._encode_query import encode_query
from elimity_insights_client.agent.source import Source
from elimity_insights_client.api._decode_source import SourceDict, decode_source
from elimity_insights_client.api.query import Query
from elimity_insights_client.api.query_results_page import QueryResultsPage
from elimity_insights_client.api._encode_query import encode_query
from elimity_insights_client.api.source import Source


@dataclass
class Config:
"""Configuration consisting of agent credentials and connection properties."""
"""Configuration consisting of API credentials and connection properties."""

token_id: str
token_secret: str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing_extensions import TypedDict

from elimity_insights_client._util import map_list
from elimity_insights_client.agent.query_results_page import (
from elimity_insights_client.api.query_results_page import (
QueryResultsPage,
QueryResult,
Entity,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
DomainGraphSchemaDict,
decode_domain_graph_schema,
)
from elimity_insights_client.agent.source import (
from elimity_insights_client.api.source import (
Source,
LastReloadTimestamp,
AbsentLastReloadTimestamp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import List, TypeVar, Callable

from elimity_insights_client._util import encode_datetime, local_timezone
from elimity_insights_client.agent.expression import (
from elimity_insights_client.api.expression import (
BooleanExpression,
ActiveBooleanExpression,
AllBooleanExpression,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from elimity_insights_client.agent._encode_expression import (
from elimity_insights_client.api._encode_expression import (
encode_boolean_expression,
encode_date_expression,
encode_date_time_expression,
encode_number_expression,
encode_string_expression,
encode_time_expression,
)
from elimity_insights_client.agent.query import (
from elimity_insights_client.api.query import (
DirectLinkQuery,
Ordering,
LinkGroupByQuery,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from enum import Enum, auto
from typing import Union, List

from elimity_insights_client.agent.expression import (
from elimity_insights_client.api.expression import (
BooleanExpression,
DateExpression,
DateTimeExpression,
Expand Down
1 change: 0 additions & 1 deletion tests/elimity_insights_client/agent/__init__.py

This file was deleted.

1 change: 1 addition & 0 deletions tests/elimity_insights_client/api/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Unit tests for the Elimity Insights API package."""
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
from json import load
from typing import List

from elimity_insights_client.agent._decode_query_results_page import (
from elimity_insights_client.api._decode_query_results_page import (
decode_query_results_page,
)
from elimity_insights_client.agent.query_results_page import (
from elimity_insights_client.api.query_results_page import (
Entity,
BooleanValue,
NumberValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
Type,
RelationshipAttributeType,
)
from elimity_insights_client.agent._decode_source import decode_source
from elimity_insights_client.agent.source import Source, PresentLastReloadTimestamp
from elimity_insights_client.api._decode_source import decode_source
from elimity_insights_client.api.source import Source, PresentLastReloadTimestamp


def test_decode_source() -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from simplejson import dumps
from jsonschema import validate

from elimity_insights_client.agent._encode_query import encode_query
from elimity_insights_client.agent.query import Query
from elimity_insights_client.api._encode_query import encode_query
from elimity_insights_client.api.query import Query

_health_checks = [HealthCheck.too_slow]

Expand Down