Skip to content

Commit a27a1b6

Browse files
committed
improve imports
1 parent b050686 commit a27a1b6

15 files changed

Lines changed: 60 additions & 50 deletions

tests/test_errors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import responses
22
import requests
33

4-
from veryfi.errors import *
5-
from veryfi import *
4+
from veryfi.errors import BadRequest, VeryfiClientError
5+
from veryfi import Client
66
import pytest
77

88

veryfi/_documents/line_items.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import *
1+
from typing import Dict
22

33
from veryfi.client_base import Client
44

@@ -7,7 +7,7 @@ class LineItems:
77
def __init__(self, client: Client):
88
self.client = client
99

10-
def get_line_items(self, document_id):
10+
def get_line_items(self, document_id: int):
1111
"""
1212
Retrieve all line items for a document.
1313
https://docs.veryfi.com/api/receipts-invoices/get-document-line-items/
@@ -17,7 +17,7 @@ def get_line_items(self, document_id):
1717
"""
1818
return self.client._request("GET", f"/documents/{document_id}/line-items/")
1919

20-
def get_line_item(self, document_id, line_item_id):
20+
def get_line_item(self, document_id: int, line_item_id: int):
2121
"""
2222
Retrieve a line item for existing document by ID.
2323
https://docs.veryfi.com/api/receipts-invoices/get-a-line-item/
@@ -53,7 +53,7 @@ def update_line_item(self, document_id: int, line_item_id: int, payload: Dict) -
5353
"PUT", f"/documents/{document_id}/line-items/{line_item_id}", payload
5454
)
5555

56-
def delete_line_items(self, document_id):
56+
def delete_line_items(self, document_id: int):
5757
"""
5858
Delete all line items on an existing document.
5959
https://docs.veryfi.com/api/receipts-invoices/delete-all-document-line-items/
@@ -62,7 +62,7 @@ def delete_line_items(self, document_id):
6262
"""
6363
self.client._request("DELETE", f"/documents/{document_id}/line-items/")
6464

65-
def delete_line_item(self, document_id, line_item_id):
65+
def delete_line_item(self, document_id: int, line_item_id: int):
6666
"""
6767
Delete an existing line item on an existing document.
6868
https://docs.veryfi.com/api/receipts-invoices/delete-a-line-item/

veryfi/_documents/pdf_split.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22
import base64
3-
from typing import *
3+
from typing import Dict, List, Optional
44

55
from veryfi.client_base import Client
66

veryfi/_documents/tags.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from typing import *
21
from veryfi.client_base import Client
32

43

veryfi/_w2s/w2_split.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22
import base64
3-
from typing import *
3+
from typing import Dict, List, Optional
44

55
from veryfi.client_base import Client
66

veryfi/a_docs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22
import base64
3-
from typing import *
3+
from typing import Dict, List, Optional
44

55
from veryfi.client_base import Client
66

veryfi/bank_statements.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22
import base64
3-
from typing import *
3+
from typing import Dict, Optional
44

55
from veryfi.client_base import Client
66

@@ -33,7 +33,7 @@ def process_bank_statement_document_url(
3333

3434
def process_bank_statement_document(
3535
self, file_path: str, file_name: Optional[str] = None, **kwargs
36-
):
36+
) -> Dict:
3737
"""
3838
Process bank statement document from url and extract all the fields from it.
3939
https://docs.veryfi.com/api/bank-statements/process-a-bank-statement/

veryfi/bussines_cards.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22
import base64
3-
from typing import *
3+
from typing import Dict, Optional
44

55
from veryfi.client_base import Client
66

@@ -33,7 +33,7 @@ def process_bussines_card_document_url(
3333

3434
def process_bussines_card_document(
3535
self, file_path: str, file_name: Optional[str] = None, **kwargs
36-
):
36+
) -> Dict:
3737
"""
3838
Process bussiness card from url and extract all the fields from it.
3939
https://docs.veryfi.com/api/business-cards/process-a-business-card/
@@ -55,7 +55,7 @@ def process_bussines_card_document(
5555
request_arguments.update(kwargs)
5656
return self.client._request("POST", endpoint_name, request_arguments)
5757

58-
def get_business_cards(self, **kwargs: Dict):
58+
def get_business_cards(self, **kwargs):
5959
"""
6060
Get list of business card documents.
6161
https://docs.veryfi.com/api/business-cards/get-business-cards/
@@ -66,7 +66,7 @@ def get_business_cards(self, **kwargs: Dict):
6666
endpoint_name = "/business-cards/"
6767
return self.client._request("GET", endpoint_name, {}, kwargs)
6868

69-
def get_business_card(self, document_id: int, **kwargs: Dict):
69+
def get_business_card(self, document_id: int, **kwargs) -> Dict:
7070
"""
7171
Get a business card document.
7272
https://docs.veryfi.com/api/business-cards/get-a-business-card/

veryfi/checks.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22
import base64
3-
from typing import *
3+
from typing import Dict, List, Optional
44

55
from veryfi.client_base import Client
66

@@ -16,7 +16,7 @@ def get_checks(
1616
created_date__lt: Optional[str] = None,
1717
created_date__lte: Optional[str] = None,
1818
**kwargs,
19-
) -> List[Dict]:
19+
):
2020
"""
2121
Get list of checks
2222
https://docs.veryfi.com/api/checks/get-checks/
@@ -59,7 +59,7 @@ def process_check(
5959
self,
6060
file_path: str,
6161
**kwargs,
62-
):
62+
) -> Dict:
6363
"""
6464
Process a check document and extract all the fields from it
6565
https://docs.veryfi.com/api/checks/process-a-check/

veryfi/client.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
class Client(ClientBase, ADocs, BankStatements, BussinesCards, Checks, Documents, W2s, W8s, W9s):
1414
def __init__(
1515
self,
16-
client_id,
17-
client_secret,
18-
username,
19-
api_key,
20-
base_url=ClientBase.BASE_URL,
21-
api_version=ClientBase.API_VERSION,
22-
timeout=ClientBase.API_TIMEOUT,
16+
client_id: str,
17+
client_secret: str,
18+
username: str,
19+
api_key: str,
20+
base_url: str = ClientBase.BASE_URL,
21+
api_version: str = ClientBase.API_VERSION,
22+
timeout: int = ClientBase.API_TIMEOUT,
2323
):
2424
super().__init__(
2525
client_id=client_id,

0 commit comments

Comments
 (0)