tap-belvo 0.3.1__py3-none-any.whl → 0.3.2__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.
Potentially problematic release.
This version of tap-belvo might be problematic. Click here for more details.
- tap_belvo/client.py +29 -91
- tap_belvo/{openapi/BelvoOpenFinanceApiSpec.json → openapi.json} +27522 -18666
- tap_belvo/streams/banking.py +10 -12
- tap_belvo/streams/core.py +14 -16
- tap_belvo/tap.py +11 -7
- {tap_belvo-0.3.1.dist-info → tap_belvo-0.3.2.dist-info}/METADATA +3 -2
- tap_belvo-0.3.2.dist-info/RECORD +15 -0
- tap_belvo/openapi/__init__.py +0 -24
- tap_belvo-0.3.1.dist-info/RECORD +0 -16
- {tap_belvo-0.3.1.dist-info → tap_belvo-0.3.2.dist-info}/WHEEL +0 -0
- {tap_belvo-0.3.1.dist-info → tap_belvo-0.3.2.dist-info}/entry_points.txt +0 -0
- {tap_belvo-0.3.1.dist-info → tap_belvo-0.3.2.dist-info}/licenses/LICENSE +0 -0
tap_belvo/streams/banking.py
CHANGED
|
@@ -2,12 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import sys
|
|
6
|
+
from typing import TYPE_CHECKING, Any
|
|
6
7
|
|
|
7
8
|
from tap_belvo.client import BelvoStream
|
|
8
9
|
from tap_belvo.streams.core import Links
|
|
9
10
|
|
|
10
|
-
if
|
|
11
|
+
if sys.version_info >= (3, 12):
|
|
12
|
+
from typing import override
|
|
13
|
+
else:
|
|
14
|
+
from typing_extensions import override
|
|
15
|
+
|
|
16
|
+
if TYPE_CHECKING:
|
|
11
17
|
from urllib.parse import ParseResult
|
|
12
18
|
|
|
13
19
|
from singer_sdk.helpers.types import Context
|
|
@@ -33,20 +39,12 @@ class Transactions(BelvoStream):
|
|
|
33
39
|
openapi_ref = "Account"
|
|
34
40
|
parent_stream_type = Links
|
|
35
41
|
|
|
42
|
+
@override
|
|
36
43
|
def get_url_params(
|
|
37
44
|
self,
|
|
38
45
|
context: Context | None,
|
|
39
46
|
next_page_token: ParseResult | None,
|
|
40
|
-
) -> dict[str,
|
|
41
|
-
"""Get URL query parameters.
|
|
42
|
-
|
|
43
|
-
Args:
|
|
44
|
-
context: Stream sync context.
|
|
45
|
-
next_page_token: Next page URL, if available.
|
|
46
|
-
|
|
47
|
-
Returns:
|
|
48
|
-
Mapping of URL query parameters.
|
|
49
|
-
"""
|
|
47
|
+
) -> dict[str, Any]:
|
|
50
48
|
params = super().get_url_params(context, next_page_token)
|
|
51
49
|
|
|
52
50
|
if context is not None:
|
tap_belvo/streams/core.py
CHANGED
|
@@ -2,11 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import sys
|
|
6
|
+
from typing import TYPE_CHECKING, Any
|
|
6
7
|
|
|
7
8
|
from tap_belvo.client import BelvoStream
|
|
8
9
|
|
|
9
|
-
if
|
|
10
|
+
if sys.version_info >= (3, 12):
|
|
11
|
+
from typing import override
|
|
12
|
+
else:
|
|
13
|
+
from typing_extensions import override
|
|
14
|
+
|
|
15
|
+
if TYPE_CHECKING:
|
|
10
16
|
from singer_sdk.helpers.types import Context
|
|
11
17
|
|
|
12
18
|
|
|
@@ -19,20 +25,12 @@ class Links(BelvoStream):
|
|
|
19
25
|
replication_key = "created_at"
|
|
20
26
|
openapi_ref = "Link"
|
|
21
27
|
|
|
28
|
+
@override
|
|
22
29
|
def get_child_context(
|
|
23
30
|
self,
|
|
24
|
-
record: dict[str,
|
|
25
|
-
context: Context | None,
|
|
26
|
-
) -> dict[
|
|
27
|
-
"""Return the child context.
|
|
28
|
-
|
|
29
|
-
Args:
|
|
30
|
-
record: The record to get the child context for.
|
|
31
|
-
context: The parent context.
|
|
32
|
-
|
|
33
|
-
Returns:
|
|
34
|
-
The child context.
|
|
35
|
-
"""
|
|
31
|
+
record: dict[str, Any],
|
|
32
|
+
context: Context | None,
|
|
33
|
+
) -> dict[Any, Any]:
|
|
36
34
|
return {"link_id": record["id"]}
|
|
37
35
|
|
|
38
36
|
|
|
@@ -43,7 +41,7 @@ class Institutions(BelvoStream):
|
|
|
43
41
|
path = "/api/institutions"
|
|
44
42
|
primary_keys = ("id",)
|
|
45
43
|
replication_key = None
|
|
46
|
-
openapi_ref = "
|
|
44
|
+
openapi_ref = "InstitutionPublicApi"
|
|
47
45
|
|
|
48
46
|
|
|
49
47
|
class Consents(BelvoStream):
|
|
@@ -53,4 +51,4 @@ class Consents(BelvoStream):
|
|
|
53
51
|
path = "/api/consents"
|
|
54
52
|
primary_keys = ("id",)
|
|
55
53
|
replication_key = None
|
|
56
|
-
openapi_ref = "
|
|
54
|
+
openapi_ref = "Consents"
|
tap_belvo/tap.py
CHANGED
|
@@ -2,11 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
import sys
|
|
6
|
+
|
|
5
7
|
import singer_sdk
|
|
6
8
|
from singer_sdk import typing as th
|
|
7
9
|
|
|
8
10
|
from tap_belvo.streams import banking, core, enrichment, fiscal
|
|
9
11
|
|
|
12
|
+
if sys.version_info >= (3, 12):
|
|
13
|
+
from typing import override
|
|
14
|
+
else:
|
|
15
|
+
from typing_extensions import override
|
|
16
|
+
|
|
10
17
|
|
|
11
18
|
class TapBelvo(singer_sdk.Tap):
|
|
12
19
|
"""Singer tap for Belvo."""
|
|
@@ -41,19 +48,16 @@ class TapBelvo(singer_sdk.Tap):
|
|
|
41
48
|
),
|
|
42
49
|
).to_dict()
|
|
43
50
|
|
|
51
|
+
@override
|
|
44
52
|
def discover_streams(self) -> list[singer_sdk.Stream]:
|
|
45
|
-
"""Return a list of discovered streams.
|
|
46
|
-
|
|
47
|
-
Returns:
|
|
48
|
-
A list of Belvo streams.
|
|
49
|
-
"""
|
|
50
53
|
# TODO(edgarrmondragon): Add tax declarations and tax returns
|
|
51
54
|
# https://github.com/reservoir-data/tap-belvo/issues/76
|
|
52
55
|
return [
|
|
53
56
|
core.Links(self),
|
|
54
57
|
core.Institutions(self),
|
|
55
|
-
# TODO(edgarrmondragon):
|
|
56
|
-
#
|
|
58
|
+
# TODO(edgarrmondragon): The `document_number` field seems to be incorrectly
|
|
59
|
+
# marked as required?
|
|
60
|
+
# https://developers.belvo.com/apis/belvoopenapispec/consents/listconsents
|
|
57
61
|
# core.Consents(self), # noqa: ERA001
|
|
58
62
|
banking.Accounts(self),
|
|
59
63
|
banking.Transactions(self),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tap-belvo
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: Singer tap for Belvo, built with the Meltano SDK for Singer Taps.
|
|
5
5
|
Project-URL: Documentation, https://github.com/reservoir-data/tap-belvo#readme
|
|
6
6
|
Project-URL: Homepage, https://github.com/reservoir-data/tap-belvo
|
|
@@ -18,7 +18,8 @@ Classifier: Programming Language :: Python :: 3.14
|
|
|
18
18
|
Requires-Python: >=3.11
|
|
19
19
|
Requires-Dist: requests-cache==1.*
|
|
20
20
|
Requires-Dist: requests~=2.32.3
|
|
21
|
-
Requires-Dist: singer-sdk~=0.
|
|
21
|
+
Requires-Dist: singer-sdk~=0.50.0
|
|
22
|
+
Requires-Dist: typing-extensions>=4.15; python_full_version < '3.12'
|
|
22
23
|
Description-Content-Type: text/markdown
|
|
23
24
|
|
|
24
25
|
# tap-belvo
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
tap_belvo/__init__.py,sha256=iyiBrJmF2aO9lg9B8vvrJlfGSSg0I2JooKI4TOFqbtY,80
|
|
2
|
+
tap_belvo/__main__.py,sha256=J5_xhlTVBRRUlQ62HlFpgvpDXaeYZqEpb1-eEO0rSJg,110
|
|
3
|
+
tap_belvo/client.py,sha256=9umJFleWiXI2zsWa51bLwl2dAeW7Aax8Ks0FfINHgNA,3663
|
|
4
|
+
tap_belvo/openapi.json,sha256=wK8RCUB9oaHeU3AOc5TGkR_krSMjZplVcYn7vSc33ok,1615007
|
|
5
|
+
tap_belvo/tap.py,sha256=U8RZsAC8gSxAOrjSBgmB7k3ntmVslxXksfmEwdlv4QE,2257
|
|
6
|
+
tap_belvo/streams/__init__.py,sha256=pbZNHP8IAnavfiIpY2vNZevOyieVmjwmjrsNEYEIY1M,935
|
|
7
|
+
tap_belvo/streams/banking.py,sha256=8IYbtUwDoUSjOxFbkEFSDC8QK9urLJyU0JvOJkNjIww,2421
|
|
8
|
+
tap_belvo/streams/core.py,sha256=Kr991miUOD3kNu2eh4GGjBBHHrdRTPDD2FGa3swIhYg,1131
|
|
9
|
+
tap_belvo/streams/enrichment.py,sha256=oiyXvkSK2XRcGjcpfbeTW454eyNGhO-eejdEnuHOFYg,761
|
|
10
|
+
tap_belvo/streams/fiscal.py,sha256=P1kM1TN-Im1XCiTipG-OiKTfbgy0uoW_sg_-D7EnJQo,1603
|
|
11
|
+
tap_belvo-0.3.2.dist-info/METADATA,sha256=fpKNiTHuLZk-1wbyKgnfhiNyM-CF9K6NfY5w4SVqjTo,3501
|
|
12
|
+
tap_belvo-0.3.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
13
|
+
tap_belvo-0.3.2.dist-info/entry_points.txt,sha256=mbs2jnK3SrSgW3kjbO1jMZdQkSAKw-JO8SscyYtN_Pg,57
|
|
14
|
+
tap_belvo-0.3.2.dist-info/licenses/LICENSE,sha256=hYHcZxy5jb9T_KQO1dQVotQfhWsU2XBotWBg6FIgklM,1068
|
|
15
|
+
tap_belvo-0.3.2.dist-info/RECORD,,
|
tap_belvo/openapi/__init__.py
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"""OpenAPI 3.0.0 specification for the Belvo API."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
import json
|
|
6
|
-
import logging
|
|
7
|
-
from functools import cache
|
|
8
|
-
from importlib import resources
|
|
9
|
-
from typing import Any
|
|
10
|
-
|
|
11
|
-
logger = logging.getLogger(__name__)
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
@cache
|
|
15
|
-
def load_openapi() -> dict[str, Any]:
|
|
16
|
-
"""Load the OpenAPI specification from the package.
|
|
17
|
-
|
|
18
|
-
Returns:
|
|
19
|
-
The OpenAPI specification as a dict.
|
|
20
|
-
"""
|
|
21
|
-
logger.info("Loading OpenAPI spec from package")
|
|
22
|
-
filename = "BelvoOpenFinanceApiSpec.json"
|
|
23
|
-
with resources.files(__package__).joinpath(filename).open() as f:
|
|
24
|
-
return json.load(f) # type: ignore[no-any-return]
|
tap_belvo-0.3.1.dist-info/RECORD
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
tap_belvo/__init__.py,sha256=iyiBrJmF2aO9lg9B8vvrJlfGSSg0I2JooKI4TOFqbtY,80
|
|
2
|
-
tap_belvo/__main__.py,sha256=J5_xhlTVBRRUlQ62HlFpgvpDXaeYZqEpb1-eEO0rSJg,110
|
|
3
|
-
tap_belvo/client.py,sha256=pRJ5nXl9TeMVWxehAPW6v4XO8MMf9T-dAByNLW_9jgc,5458
|
|
4
|
-
tap_belvo/tap.py,sha256=X_KGv9yCT81ZNfcN4HccQciYM1D9NqOxbIRJe0tJksI,2216
|
|
5
|
-
tap_belvo/openapi/BelvoOpenFinanceApiSpec.json,sha256=YgJHPPsrmOFdFa-K118xvqvB09TZmJdeIHZFsqLXGN4,1287233
|
|
6
|
-
tap_belvo/openapi/__init__.py,sha256=5A0Z37hBIUzi0G-iSXB7l5St1vvoLmLuSDCKF7LiCLk,636
|
|
7
|
-
tap_belvo/streams/__init__.py,sha256=pbZNHP8IAnavfiIpY2vNZevOyieVmjwmjrsNEYEIY1M,935
|
|
8
|
-
tap_belvo/streams/banking.py,sha256=6lRjaZqLbKjFZyK_Yz3uYpXG6ojNS3vJQsINoLsmLNw,2494
|
|
9
|
-
tap_belvo/streams/core.py,sha256=3sdOZFz8jGWj49HMSup5v-MUyvwzSwM2iFMWxxVZEj4,1202
|
|
10
|
-
tap_belvo/streams/enrichment.py,sha256=oiyXvkSK2XRcGjcpfbeTW454eyNGhO-eejdEnuHOFYg,761
|
|
11
|
-
tap_belvo/streams/fiscal.py,sha256=P1kM1TN-Im1XCiTipG-OiKTfbgy0uoW_sg_-D7EnJQo,1603
|
|
12
|
-
tap_belvo-0.3.1.dist-info/METADATA,sha256=uVYhR7QAZWromg0jQsUDG2HR7u1wD8ZqGIwHoZTVmCk,3432
|
|
13
|
-
tap_belvo-0.3.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
14
|
-
tap_belvo-0.3.1.dist-info/entry_points.txt,sha256=mbs2jnK3SrSgW3kjbO1jMZdQkSAKw-JO8SscyYtN_Pg,57
|
|
15
|
-
tap_belvo-0.3.1.dist-info/licenses/LICENSE,sha256=hYHcZxy5jb9T_KQO1dQVotQfhWsU2XBotWBg6FIgklM,1068
|
|
16
|
-
tap_belvo-0.3.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|