-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refact to consider schema as a ext. service
- Loading branch information
1 parent
a7c1b95
commit 470583b
Showing
5 changed files
with
52 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,30 @@ | ||
import os | ||
from datetime import datetime | ||
import pyarrow | ||
|
||
def DefaultOutputFolder(): | ||
return os.path.join(os.path.dirname(__file__), "../../data/") | ||
|
||
def DefaultTimestampStr() -> str: | ||
current = datetime.now().timestamp() | ||
return str(int(current)) | ||
return str(int(current)) | ||
|
||
def DefaultQuotesAPISchema(): | ||
api_header = [ | ||
"code", | ||
"codein", | ||
"name", | ||
"high", | ||
"low", | ||
"varBid", | ||
"pctChange", | ||
"bid", | ||
"ask", | ||
"timestamp", | ||
"create_date"] | ||
|
||
schema = [] | ||
for field in api_header: | ||
schema += [(field, pyarrow.string())] | ||
|
||
return pyarrow.schema(schema) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,2 @@ | ||
ENDPOINT_LIST_AVALIABLE_PARITYS = "https://economia.awesomeapi.com.br/json/available" | ||
ENDPOINT_QUOTES_AWESOME_API = "https://economia.awesomeapi.com.br/last/" | ||
QUOTES_API_SCHEMA = [ | ||
"code", | ||
"codein" | ||
"name", | ||
"high", | ||
"low", | ||
"varBid", | ||
"pctChange", | ||
"bid", | ||
"ask", | ||
"timestamp", | ||
"create_date" | ||
] |