Update Doors_Schedule.py
Browse files- Doors_Schedule.py +4 -4
Doors_Schedule.py
CHANGED
|
@@ -316,7 +316,9 @@ def get_column_name_secondary(user_input_m):
|
|
| 316 |
|
| 317 |
return clmn_name_m
|
| 318 |
|
| 319 |
-
|
|
|
|
|
|
|
| 320 |
# Set your Azure credentials
|
| 321 |
endpoint = "https://tabledetection2.cognitiveservices.azure.com/"
|
| 322 |
key = "5lr94dODMJihbGOMw2Vdz29zXRBiqt528fSGoGmzSJHTrWtHSnRdJQQJ99BEACYeBjFXJ3w3AAALACOGBANH"
|
|
@@ -324,9 +326,7 @@ def extract_tables_model(schedule_file):
|
|
| 324 |
# Create client
|
| 325 |
client = DocumentAnalysisClient(endpoint=endpoint, credential=AzureKeyCredential(key))
|
| 326 |
|
| 327 |
-
|
| 328 |
-
with open(schedule_file, "rb") as f:
|
| 329 |
-
poller = client.begin_analyze_document("prebuilt-layout", document=f)
|
| 330 |
|
| 331 |
# Get result
|
| 332 |
result = poller.result()
|
|
|
|
| 316 |
|
| 317 |
return clmn_name_m
|
| 318 |
|
| 319 |
+
|
| 320 |
+
### byte type not path
|
| 321 |
+
def extract_tables_model(schedule_byte):
|
| 322 |
# Set your Azure credentials
|
| 323 |
endpoint = "https://tabledetection2.cognitiveservices.azure.com/"
|
| 324 |
key = "5lr94dODMJihbGOMw2Vdz29zXRBiqt528fSGoGmzSJHTrWtHSnRdJQQJ99BEACYeBjFXJ3w3AAALACOGBANH"
|
|
|
|
| 326 |
# Create client
|
| 327 |
client = DocumentAnalysisClient(endpoint=endpoint, credential=AzureKeyCredential(key))
|
| 328 |
|
| 329 |
+
poller = client.begin_analyze_document("prebuilt-layout", document=schedule_byte)
|
|
|
|
|
|
|
| 330 |
|
| 331 |
# Get result
|
| 332 |
result = poller.result()
|