Skip to content
Closed
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
428 changes: 270 additions & 158 deletions reference.md

Large diffs are not rendered by default.

31 changes: 22 additions & 9 deletions src/sayari/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@
search,
shared_errors,
shared_types,
source,
supply_chain,
trade,
traversal,
)
from .attributes import AddAttribute, AttributeProperties, AttributeResponse, AttributeResponseData, UpdateAttribute
from .auth import AuthResponse
from .auth import Audience, AuthResponse
from .base_types import CountQualifier, CustomFieldValue, PaginatedResponse, QualifiedCount
from .client import AsyncSayari, Sayari
from .entity import EntitySummaryResponse, GetEntityResponse
Expand Down Expand Up @@ -230,19 +229,20 @@
CreateResolvedProjectEntityRequest,
FacetBucket,
FacetsResponse,
FieldMatchQuality,
GroupedAttribute,
GroupedAttributeValue,
Location,
MatchCount,
MatchProfileEnum,
MatchStrengthEnum,
MatchedAttributes,
ProductBucket,
ProductCount,
ProductMapping,
ProjectEntitiesResponse,
ProjectEntityExistsResponseData,
ProjectEntityIdResponse,
ProjectEntityMatchExplanation,
ProjectEntityMatchResponse,
ProjectEntityResponse,
ProjectEntitySupplyChainSummaryResponse,
Expand All @@ -268,6 +268,12 @@
UpstreamInfo,
)
from .project_entity_attributes import (
CreateProjectEntityAttributeRequest,
CreateProjectEntityAttributeResponse,
CreateProjectEntityAttributeResponseData,
ProjectEntityAttribute,
ProjectEntityAttributeValue,
ProjectEntityAttributesResponse,
UpdateProjectEntityAttributeRequest,
UpdateProjectEntityAttributeResponse,
UpdateProjectEntityAttributeResponseData,
Expand Down Expand Up @@ -327,6 +333,8 @@
RateLimitResponse,
Unauthorized,
UnauthorizedResponse,
UnprocessableContent,
UnprocessableContentResponse,
)
from .shared_types import (
ClientName,
Expand Down Expand Up @@ -365,7 +373,6 @@
SourceCountInfo,
Status,
)
from .source import GetSourceResponse, ListSourcesResponse, Source
from .supply_chain import (
TradeTraversalComponent,
TradeTraversalData,
Expand Down Expand Up @@ -427,6 +434,7 @@
"AttributeValues",
"Attributes",
"AttributesResponse",
"Audience",
"AuthResponse",
"BadGateway",
"BadGatewayResponse",
Expand Down Expand Up @@ -463,6 +471,9 @@
"CountryData",
"CountryInfo",
"CountryProperties",
"CreateProjectEntityAttributeRequest",
"CreateProjectEntityAttributeResponse",
"CreateProjectEntityAttributeResponseData",
"CreateProjectEntitySupplyChainSnapshotRequest",
"CreateProjectEntitySupplyChainSnapshotResponse",
"CreateProjectRequest",
Expand Down Expand Up @@ -493,6 +504,7 @@
"EventInfo",
"FacetBucket",
"FacetsResponse",
"FieldMatchQuality",
"FilterList",
"FinanceType",
"FinancesData",
Expand Down Expand Up @@ -528,7 +540,6 @@
"GetProjectEntitiesResponse",
"GetProjectsResponse",
"GetRecordResponse",
"GetSourceResponse",
"GroupedAttribute",
"GroupedAttributeValue",
"HistoryInfo",
Expand All @@ -544,15 +555,13 @@
"InternalServerError",
"InternalServerErrorResponse",
"Language",
"ListSourcesResponse",
"Location",
"MatchCount",
"MatchExplanation",
"MatchProfileEnum",
"MatchQuality",
"MatchStrength",
"MatchStrengthEnum",
"MatchedAttributes",
"MeasurementData",
"MeasurementInfo",
"MeasurementProperties",
Expand Down Expand Up @@ -628,8 +637,12 @@
"ProjectEntitiesFilter",
"ProjectEntitiesResponse",
"ProjectEntity",
"ProjectEntityAttribute",
"ProjectEntityAttributeValue",
"ProjectEntityAttributesResponse",
"ProjectEntityExistsResponseData",
"ProjectEntityIdResponse",
"ProjectEntityMatchExplanation",
"ProjectEntityMatchResponse",
"ProjectEntityResponse",
"ProjectEntitySupplyChainSnapshotByIdResponse",
Expand Down Expand Up @@ -714,7 +727,6 @@
"ShortestPathResponse",
"SingleProjectEntityResponse",
"SortField",
"Source",
"SourceCountInfo",
"SourceField",
"SourceId",
Expand Down Expand Up @@ -760,6 +772,8 @@
"Unauthorized",
"UnauthorizedResponse",
"Unit",
"UnprocessableContent",
"UnprocessableContentResponse",
"UpdateAttribute",
"UpdateEntityTagsResponse",
"UpdateProjectEntityAttributeRequest",
Expand Down Expand Up @@ -799,7 +813,6 @@
"search",
"shared_errors",
"shared_types",
"source",
"supply_chain",
"trade",
"traversal",
Expand Down
4 changes: 2 additions & 2 deletions src/sayari/auth/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file was auto-generated by Fern from our API Definition.

from .types import AuthResponse
from .types import Audience, AuthResponse

__all__ = ["AuthResponse"]
__all__ = ["Audience", "AuthResponse"]
3 changes: 2 additions & 1 deletion src/sayari/auth/types/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This file was auto-generated by Fern from our API Definition.

from .audience import Audience
from .auth_response import AuthResponse

__all__ = ["AuthResponse"]
__all__ = ["Audience", "AuthResponse"]
5 changes: 5 additions & 0 deletions src/sayari/auth/types/audience.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file was auto-generated by Fern from our API Definition.

import typing

Audience = typing.Union[typing.Literal["sayari.com", "uk.sayari.com"], typing.Any]
4 changes: 0 additions & 4 deletions src/sayari/base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from .resolution.client import ResolutionClient
from .resource.client import ResourceClient
from .search.client import SearchClient
from .source.client import SourceClient
from .supply_chain.client import SupplyChainClient
from .trade.client import TradeClient
from .traversal.client import TraversalClient
Expand All @@ -42,7 +41,6 @@
from .resolution.client import AsyncResolutionClient
from .resource.client import AsyncResourceClient
from .search.client import AsyncSearchClient
from .source.client import AsyncSourceClient
from .supply_chain.client import AsyncSupplyChainClient
from .trade.client import AsyncTradeClient
from .traversal.client import AsyncTraversalClient
Expand Down Expand Up @@ -140,7 +138,6 @@ def __init__(
self.resolution = ResolutionClient(client_wrapper=self._client_wrapper)
self.resource = ResourceClient(client_wrapper=self._client_wrapper)
self.search = SearchClient(client_wrapper=self._client_wrapper)
self.source = SourceClient(client_wrapper=self._client_wrapper)
self.supply_chain = SupplyChainClient(client_wrapper=self._client_wrapper)
self.trade = TradeClient(client_wrapper=self._client_wrapper)
self.traversal = TraversalClient(client_wrapper=self._client_wrapper)
Expand Down Expand Up @@ -238,7 +235,6 @@ def __init__(
self.resolution = AsyncResolutionClient(client_wrapper=self._client_wrapper)
self.resource = AsyncResourceClient(client_wrapper=self._client_wrapper)
self.search = AsyncSearchClient(client_wrapper=self._client_wrapper)
self.source = AsyncSourceClient(client_wrapper=self._client_wrapper)
self.supply_chain = AsyncSupplyChainClient(client_wrapper=self._client_wrapper)
self.trade = AsyncTradeClient(client_wrapper=self._client_wrapper)
self.traversal = AsyncTraversalClient(client_wrapper=self._client_wrapper)
Expand Down
5 changes: 5 additions & 0 deletions src/sayari/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ class SayariEnvironment(enum.Enum):
"""
Sayari development - utilized for internal testing before promotion to production
"""

PRODUCTION_UK = "https://api.uk.sayari.com"
"""
Sayari production - UK environment
"""
8 changes: 4 additions & 4 deletions src/sayari/negative_news/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def negative_news(
Risk category filter for targeted screening. Each topic represents a distinct risk domain (e.g., `environmental` for environmental violations, `financial` for financial misconduct).

until : typing.Optional[dt.date]
Date cutoff for article inclusion in `YYYY-MM-DD` format. If provided, only articles published before this date will be included in results.
Date cutoff for article inclusion in `YYYY-MM-DD` format. If provided, only articles published after this date will be included in results.

request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Expand All @@ -70,7 +70,7 @@ def negative_news(
)
client.negative_news.negative_news(
name="Gazprom",
topic="sanctions",
topic="sanctions_and_regulatory",
until=datetime.date.fromisoformat(
"2024-10-01",
),
Expand Down Expand Up @@ -178,7 +178,7 @@ async def negative_news(
Risk category filter for targeted screening. Each topic represents a distinct risk domain (e.g., `environmental` for environmental violations, `financial` for financial misconduct).

until : typing.Optional[dt.date]
Date cutoff for article inclusion in `YYYY-MM-DD` format. If provided, only articles published before this date will be included in results.
Date cutoff for article inclusion in `YYYY-MM-DD` format. If provided, only articles published after this date will be included in results.

request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Expand All @@ -203,7 +203,7 @@ async def negative_news(
async def main() -> None:
await client.negative_news.negative_news(
name="Gazprom",
topic="sanctions",
topic="sanctions_and_regulatory",
until=datetime.date.fromisoformat(
"2024-10-01",
),
Expand Down
11 changes: 4 additions & 7 deletions src/sayari/negative_news/types/topics.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,17 @@

Topics = typing.Union[
typing.Literal[
"basic",
"environmental",
"social",
"overview",
"environmental_and_social",
"cybersecurity",
"disruption",
"criminal",
"reputational",
"financial",
"regulatory",
"sanctions_and_regulatory",
"legal",
"misconduct",
"political",
"terrorism",
"sanctions",
"all",
],
typing.Any,
]
6 changes: 4 additions & 2 deletions src/sayari/project_entity/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@
CreateResolvedProjectEntityRequest,
FacetBucket,
FacetsResponse,
FieldMatchQuality,
GroupedAttribute,
GroupedAttributeValue,
Location,
MatchCount,
MatchProfileEnum,
MatchStrengthEnum,
MatchedAttributes,
ProductBucket,
ProductCount,
ProductMapping,
ProjectEntitiesResponse,
ProjectEntityExistsResponseData,
ProjectEntityIdResponse,
ProjectEntityMatchExplanation,
ProjectEntityMatchResponse,
ProjectEntityResponse,
ProjectEntitySupplyChainSummaryResponse,
Expand Down Expand Up @@ -62,19 +63,20 @@
"CreateResolvedProjectEntityRequest",
"FacetBucket",
"FacetsResponse",
"FieldMatchQuality",
"GroupedAttribute",
"GroupedAttributeValue",
"Location",
"MatchCount",
"MatchProfileEnum",
"MatchStrengthEnum",
"MatchedAttributes",
"ProductBucket",
"ProductCount",
"ProductMapping",
"ProjectEntitiesResponse",
"ProjectEntityExistsResponseData",
"ProjectEntityIdResponse",
"ProjectEntityMatchExplanation",
"ProjectEntityMatchResponse",
"ProjectEntityResponse",
"ProjectEntitySupplyChainSummaryResponse",
Expand Down
6 changes: 4 additions & 2 deletions src/sayari/project_entity/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,20 @@
from .create_resolved_project_entity_request import CreateResolvedProjectEntityRequest
from .facet_bucket import FacetBucket
from .facets_response import FacetsResponse
from .field_match_quality import FieldMatchQuality
from .grouped_attribute import GroupedAttribute
from .grouped_attribute_value import GroupedAttributeValue
from .location import Location
from .match_count import MatchCount
from .match_profile_enum import MatchProfileEnum
from .match_strength_enum import MatchStrengthEnum
from .matched_attributes import MatchedAttributes
from .product_bucket import ProductBucket
from .product_count import ProductCount
from .product_mapping import ProductMapping
from .project_entities_response import ProjectEntitiesResponse
from .project_entity_exists_response_data import ProjectEntityExistsResponseData
from .project_entity_id_response import ProjectEntityIdResponse
from .project_entity_match_explanation import ProjectEntityMatchExplanation
from .project_entity_match_response import ProjectEntityMatchResponse
from .project_entity_response import ProjectEntityResponse
from .project_entity_supply_chain_summary_response import ProjectEntitySupplyChainSummaryResponse
Expand Down Expand Up @@ -60,19 +61,20 @@
"CreateResolvedProjectEntityRequest",
"FacetBucket",
"FacetsResponse",
"FieldMatchQuality",
"GroupedAttribute",
"GroupedAttributeValue",
"Location",
"MatchCount",
"MatchProfileEnum",
"MatchStrengthEnum",
"MatchedAttributes",
"ProductBucket",
"ProductCount",
"ProductMapping",
"ProjectEntitiesResponse",
"ProjectEntityExistsResponseData",
"ProjectEntityIdResponse",
"ProjectEntityMatchExplanation",
"ProjectEntityMatchResponse",
"ProjectEntityResponse",
"ProjectEntitySupplyChainSummaryResponse",
Expand Down
2 changes: 1 addition & 1 deletion src/sayari/project_entity/types/attribute_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


class AttributeValues(UniversalBaseModel):
resolve: bool
match_resolution: bool
values: typing.List[str]

if IS_PYDANTIC_V2:
Expand Down
5 changes: 5 additions & 0 deletions src/sayari/project_entity/types/field_match_quality.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file was auto-generated by Fern from our API Definition.

import typing

FieldMatchQuality = typing.Union[typing.Literal["high", "medium", "low", "na"], typing.Any]
Loading