-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ubuntu
committed
Sep 25, 2024
1 parent
e1c5b90
commit 7ef94e4
Showing
6 changed files
with
53 additions
and
125 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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"""Testing Aynchronous Extraction""" | ||
|
||
import sys | ||
|
||
from any_parser import AnyParser | ||
|
||
sys.path.append(".") | ||
sys.path.append("..") | ||
sys.path.append("../..") | ||
|
||
# define API key and file path | ||
API_KEY = "U1xoe4F7qQ9MGJkiMFtR240r3r2iF6NQaAMUEYYc" | ||
FILE_PATH = "./sample_data/stoxx_index_guide_0003.pdf" | ||
|
||
# create instance of AnyParser | ||
ap = AnyParser(API_KEY) | ||
|
||
# asynchronous extract job (extraction and result fetching are separate) | ||
file_id = ap.async_extract(FILE_PATH) | ||
|
||
# fetch results (5s polling) | ||
md = ap.async_fetch(file_id=file_id) | ||
print(md) |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
"""Testing Syncrhonous Extraction""" | ||
|
||
import sys | ||
|
||
from any_parser import AnyParser | ||
|
||
sys.path.append(".") | ||
sys.path.append("..") | ||
sys.path.append("../..") | ||
|
||
# define API key and file path | ||
API_KEY = "U1xoe4F7qQ9MGJkiMFtR240r3r2iF6NQaAMUEYYc" | ||
FILE_PATH = "./sample_data/stoxx_index_guide_0003.pdf" | ||
|
||
# create instance of AnyParser | ||
ap = AnyParser(API_KEY) | ||
|
||
# synchronous extract job (extraction and result fetching together) | ||
md_output, total_time = ap.extract(FILE_PATH) | ||
print(md_output) | ||
print(total_time) |