simpleapps-com-augur-api 0.8.10__py3-none-any.whl
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.
- augur_api/__init__.py +43 -0
- augur_api/client.py +453 -0
- augur_api/core/__init__.py +40 -0
- augur_api/core/config.py +75 -0
- augur_api/core/errors.py +173 -0
- augur_api/core/http_client.py +426 -0
- augur_api/core/schemas.py +105 -0
- augur_api/py.typed +0 -0
- augur_api/services/__init__.py +13 -0
- augur_api/services/agr_info/__init__.py +47 -0
- augur_api/services/agr_info/client.py +326 -0
- augur_api/services/agr_info/schemas.py +123 -0
- augur_api/services/agr_site/__init__.py +79 -0
- augur_api/services/agr_site/client.py +384 -0
- augur_api/services/agr_site/schemas.py +268 -0
- augur_api/services/agr_work/__init__.py +7 -0
- augur_api/services/agr_work/client.py +32 -0
- augur_api/services/agr_work/schemas.py +11 -0
- augur_api/services/avalara/__init__.py +17 -0
- augur_api/services/avalara/client.py +64 -0
- augur_api/services/avalara/schemas.py +34 -0
- augur_api/services/base.py +54 -0
- augur_api/services/basecamp2/__init__.py +65 -0
- augur_api/services/basecamp2/client.py +568 -0
- augur_api/services/basecamp2/schemas.py +227 -0
- augur_api/services/brand_folder/__init__.py +31 -0
- augur_api/services/brand_folder/client.py +206 -0
- augur_api/services/brand_folder/schemas.py +133 -0
- augur_api/services/commerce/__init__.py +56 -0
- augur_api/services/commerce/client.py +298 -0
- augur_api/services/commerce/schemas.py +167 -0
- augur_api/services/customers/__init__.py +69 -0
- augur_api/services/customers/client.py +437 -0
- augur_api/services/customers/schemas.py +273 -0
- augur_api/services/gregorovich/__init__.py +31 -0
- augur_api/services/gregorovich/client.py +151 -0
- augur_api/services/gregorovich/schemas.py +42 -0
- augur_api/services/items/__init__.py +302 -0
- augur_api/services/items/client.py +1223 -0
- augur_api/services/items/schemas.py +722 -0
- augur_api/services/joomla/__init__.py +59 -0
- augur_api/services/joomla/client.py +333 -0
- augur_api/services/joomla/schemas.py +286 -0
- augur_api/services/legacy/__init__.py +66 -0
- augur_api/services/legacy/client.py +391 -0
- augur_api/services/legacy/schemas.py +115 -0
- augur_api/services/logistics/__init__.py +34 -0
- augur_api/services/logistics/client.py +116 -0
- augur_api/services/logistics/schemas.py +65 -0
- augur_api/services/nexus/__init__.py +89 -0
- augur_api/services/nexus/client.py +589 -0
- augur_api/services/nexus/schemas.py +171 -0
- augur_api/services/open_search/__init__.py +58 -0
- augur_api/services/open_search/client.py +285 -0
- augur_api/services/open_search/schemas.py +146 -0
- augur_api/services/orders/__init__.py +51 -0
- augur_api/services/orders/client.py +299 -0
- augur_api/services/orders/schemas.py +195 -0
- augur_api/services/p21_apis/__init__.py +83 -0
- augur_api/services/p21_apis/client.py +420 -0
- augur_api/services/p21_apis/schemas.py +130 -0
- augur_api/services/p21_core/__init__.py +29 -0
- augur_api/services/p21_core/client.py +395 -0
- augur_api/services/p21_core/schemas.py +221 -0
- augur_api/services/p21_pim/__init__.py +51 -0
- augur_api/services/p21_pim/client.py +319 -0
- augur_api/services/p21_pim/schemas.py +128 -0
- augur_api/services/p21_sism/__init__.py +60 -0
- augur_api/services/p21_sism/client.py +334 -0
- augur_api/services/p21_sism/schemas.py +92 -0
- augur_api/services/payments/__init__.py +97 -0
- augur_api/services/payments/client.py +508 -0
- augur_api/services/payments/schemas.py +166 -0
- augur_api/services/pricing/__init__.py +43 -0
- augur_api/services/pricing/client.py +175 -0
- augur_api/services/pricing/schemas.py +146 -0
- augur_api/services/resource.py +141 -0
- augur_api/services/shipping/__init__.py +17 -0
- augur_api/services/shipping/client.py +68 -0
- augur_api/services/shipping/schemas.py +38 -0
- augur_api/services/slack/__init__.py +23 -0
- augur_api/services/slack/client.py +74 -0
- augur_api/services/slack/schemas.py +35 -0
- augur_api/services/smarty_streets/__init__.py +19 -0
- augur_api/services/smarty_streets/client.py +82 -0
- augur_api/services/smarty_streets/schemas.py +32 -0
- augur_api/services/ups/__init__.py +17 -0
- augur_api/services/ups/client.py +72 -0
- augur_api/services/ups/schemas.py +41 -0
- augur_api/services/vmi/__init__.py +157 -0
- augur_api/services/vmi/client.py +586 -0
- augur_api/services/vmi/schemas.py +285 -0
- simpleapps_com_augur_api-0.8.10.dist-info/METADATA +177 -0
- simpleapps_com_augur_api-0.8.10.dist-info/RECORD +96 -0
- simpleapps_com_augur_api-0.8.10.dist-info/WHEEL +4 -0
- simpleapps_com_augur_api-0.8.10.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""Avalara service exports."""
|
|
2
|
+
|
|
3
|
+
from augur_api.services.avalara.client import (
|
|
4
|
+
AvalaraClient,
|
|
5
|
+
RatesResource,
|
|
6
|
+
)
|
|
7
|
+
from augur_api.services.avalara.schemas import (
|
|
8
|
+
RatesParams,
|
|
9
|
+
TaxRate,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
"AvalaraClient",
|
|
14
|
+
"RatesParams",
|
|
15
|
+
"RatesResource",
|
|
16
|
+
"TaxRate",
|
|
17
|
+
]
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"""Avalara service client for tax rate calculations."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import TYPE_CHECKING, Any
|
|
6
|
+
|
|
7
|
+
from augur_api.core.schemas import BaseResponse
|
|
8
|
+
from augur_api.services.avalara.schemas import (
|
|
9
|
+
TaxRate,
|
|
10
|
+
)
|
|
11
|
+
from augur_api.services.base import BaseServiceClient
|
|
12
|
+
from augur_api.services.resource import BaseResource
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from augur_api.core.http_client import HTTPClient
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class RatesResource(BaseResource):
|
|
19
|
+
"""Resource for /rates endpoints."""
|
|
20
|
+
|
|
21
|
+
def __init__(self, http: HTTPClient) -> None:
|
|
22
|
+
"""Initialize the resource."""
|
|
23
|
+
super().__init__(http, "/rates")
|
|
24
|
+
|
|
25
|
+
def create(self, data: Any) -> BaseResponse[TaxRate]:
|
|
26
|
+
"""Calculate tax rates for an address.
|
|
27
|
+
|
|
28
|
+
Args:
|
|
29
|
+
data: Address parameters for tax rate calculation.
|
|
30
|
+
|
|
31
|
+
Returns:
|
|
32
|
+
BaseResponse containing tax rate information.
|
|
33
|
+
"""
|
|
34
|
+
response = self._post(data=data)
|
|
35
|
+
return BaseResponse[TaxRate].model_validate(response)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class AvalaraClient(BaseServiceClient):
|
|
39
|
+
"""Client for the Avalara tax service.
|
|
40
|
+
|
|
41
|
+
Provides access to tax rate calculation endpoints.
|
|
42
|
+
|
|
43
|
+
Example:
|
|
44
|
+
>>> from augur_api import AugurAPI
|
|
45
|
+
>>> api = AugurAPI(token="...", site_id="...")
|
|
46
|
+
>>> rates = api.avalara.rates.create(RatesParams(postal_code="98101"))
|
|
47
|
+
>>> print(rates.data.total_rate)
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
def __init__(self, http_client: HTTPClient) -> None:
|
|
51
|
+
"""Initialize the Avalara client.
|
|
52
|
+
|
|
53
|
+
Args:
|
|
54
|
+
http_client: HTTP client for making requests.
|
|
55
|
+
"""
|
|
56
|
+
super().__init__(http_client)
|
|
57
|
+
self._rates: RatesResource | None = None
|
|
58
|
+
|
|
59
|
+
@property
|
|
60
|
+
def rates(self) -> RatesResource:
|
|
61
|
+
"""Access tax rates endpoints."""
|
|
62
|
+
if self._rates is None:
|
|
63
|
+
self._rates = RatesResource(self._http)
|
|
64
|
+
return self._rates
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"""Schemas for the Avalara service."""
|
|
2
|
+
|
|
3
|
+
from augur_api.core.schemas import CamelCaseModel, EdgeCacheParams
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
# Health Check
|
|
7
|
+
class HealthCheckData(CamelCaseModel):
|
|
8
|
+
"""Health check response data."""
|
|
9
|
+
|
|
10
|
+
site_hash: str | None = None
|
|
11
|
+
site_id: str | None = None
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# Rates
|
|
15
|
+
class RatesParams(EdgeCacheParams):
|
|
16
|
+
"""Parameters for tax rate lookup."""
|
|
17
|
+
|
|
18
|
+
line1: str | None = None
|
|
19
|
+
line2: str | None = None
|
|
20
|
+
line3: str | None = None
|
|
21
|
+
city: str | None = None
|
|
22
|
+
region: str | None = None
|
|
23
|
+
postal_code: str | None = None
|
|
24
|
+
country: str | None = None
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class TaxRate(CamelCaseModel):
|
|
28
|
+
"""Tax rate response."""
|
|
29
|
+
|
|
30
|
+
total_rate: float | None = None
|
|
31
|
+
state_rate: float | None = None
|
|
32
|
+
county_rate: float | None = None
|
|
33
|
+
city_rate: float | None = None
|
|
34
|
+
special_rate: float | None = None
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"""Base service client class for all Augur services."""
|
|
2
|
+
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
from augur_api.core.http_client import HTTPClient
|
|
6
|
+
from augur_api.core.schemas import BaseResponse, HealthCheckData
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class BaseServiceClient:
|
|
10
|
+
"""Base client for Augur API services.
|
|
11
|
+
|
|
12
|
+
All service-specific clients inherit from this class to gain
|
|
13
|
+
common functionality like health checks and ping endpoints.
|
|
14
|
+
|
|
15
|
+
Attributes:
|
|
16
|
+
_http: The HTTP client for making requests.
|
|
17
|
+
service_name: Name of the service.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
def __init__(self, http_client: HTTPClient) -> None:
|
|
21
|
+
"""Initialize the service client.
|
|
22
|
+
|
|
23
|
+
Args:
|
|
24
|
+
http_client: The HTTP client for making requests.
|
|
25
|
+
"""
|
|
26
|
+
self._http = http_client
|
|
27
|
+
self.service_name = http_client.service_name
|
|
28
|
+
|
|
29
|
+
def health_check(self) -> BaseResponse[HealthCheckData]:
|
|
30
|
+
"""Check service health.
|
|
31
|
+
|
|
32
|
+
Returns:
|
|
33
|
+
BaseResponse containing HealthCheckData with site_hash and site_id.
|
|
34
|
+
"""
|
|
35
|
+
response = self._http.get("/health-check")
|
|
36
|
+
return BaseResponse[HealthCheckData].model_validate(response)
|
|
37
|
+
|
|
38
|
+
def ping(self) -> BaseResponse[str]:
|
|
39
|
+
"""Ping the service.
|
|
40
|
+
|
|
41
|
+
Returns:
|
|
42
|
+
BaseResponse containing 'pong' string.
|
|
43
|
+
"""
|
|
44
|
+
response = self._http.get("/ping")
|
|
45
|
+
return BaseResponse[str].model_validate(response)
|
|
46
|
+
|
|
47
|
+
def whoami(self) -> BaseResponse[dict[str, Any]]:
|
|
48
|
+
"""Get information about the authenticated user.
|
|
49
|
+
|
|
50
|
+
Returns:
|
|
51
|
+
BaseResponse containing user information.
|
|
52
|
+
"""
|
|
53
|
+
response = self._http.get("/whoami")
|
|
54
|
+
return BaseResponse[dict[str, Any]].model_validate(response)
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"""Basecamp2 service exports."""
|
|
2
|
+
|
|
3
|
+
from augur_api.services.basecamp2.client import (
|
|
4
|
+
Basecamp2Client,
|
|
5
|
+
CommentsResource,
|
|
6
|
+
EventsResource,
|
|
7
|
+
MetricsResource,
|
|
8
|
+
PeopleResource,
|
|
9
|
+
ProjectsResource,
|
|
10
|
+
TodolistsResource,
|
|
11
|
+
TodosResource,
|
|
12
|
+
TodosSummaryResource,
|
|
13
|
+
)
|
|
14
|
+
from augur_api.services.basecamp2.schemas import (
|
|
15
|
+
Comment,
|
|
16
|
+
CommentCreateParams,
|
|
17
|
+
CommentListParams,
|
|
18
|
+
Event,
|
|
19
|
+
EventListParams,
|
|
20
|
+
Metric,
|
|
21
|
+
MetricsListParams,
|
|
22
|
+
Person,
|
|
23
|
+
PersonListParams,
|
|
24
|
+
Project,
|
|
25
|
+
ProjectListParams,
|
|
26
|
+
Todo,
|
|
27
|
+
TodoCreateParams,
|
|
28
|
+
Todolist,
|
|
29
|
+
TodolistListParams,
|
|
30
|
+
TodoListParams,
|
|
31
|
+
TodosSummary,
|
|
32
|
+
TodosSummaryListParams,
|
|
33
|
+
TodoUpdateParams,
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
__all__ = [
|
|
37
|
+
"Basecamp2Client",
|
|
38
|
+
"Comment",
|
|
39
|
+
"CommentCreateParams",
|
|
40
|
+
"CommentListParams",
|
|
41
|
+
"CommentsResource",
|
|
42
|
+
"Event",
|
|
43
|
+
"EventListParams",
|
|
44
|
+
"EventsResource",
|
|
45
|
+
"Metric",
|
|
46
|
+
"MetricsListParams",
|
|
47
|
+
"MetricsResource",
|
|
48
|
+
"PeopleResource",
|
|
49
|
+
"Person",
|
|
50
|
+
"PersonListParams",
|
|
51
|
+
"Project",
|
|
52
|
+
"ProjectListParams",
|
|
53
|
+
"ProjectsResource",
|
|
54
|
+
"Todo",
|
|
55
|
+
"TodoCreateParams",
|
|
56
|
+
"TodoListParams",
|
|
57
|
+
"Todolist",
|
|
58
|
+
"TodolistListParams",
|
|
59
|
+
"TodolistsResource",
|
|
60
|
+
"TodosResource",
|
|
61
|
+
"TodosSummary",
|
|
62
|
+
"TodosSummaryListParams",
|
|
63
|
+
"TodosSummaryResource",
|
|
64
|
+
"TodoUpdateParams",
|
|
65
|
+
]
|