Spaces:
Sleeping
Sleeping
Upload 5.py
Browse files
5.py
CHANGED
|
@@ -3,7 +3,6 @@ from datetime import datetime
|
|
| 3 |
import re
|
| 4 |
import gradio as gr
|
| 5 |
import requests
|
| 6 |
-
from io import BytesIO, StringIO
|
| 7 |
|
| 8 |
# URL of the CSV file
|
| 9 |
CSV_URL = "https://huggingface.co/spaces/mhammad/Khanfar/raw/main/docs/your_data.csv"
|
|
@@ -40,7 +39,8 @@ def read_csv_from_url(url, start_date, end_date):
|
|
| 40 |
# Check if رقم المركبة and نوع المركبه are both "كاش"
|
| 41 |
if row['رقم المركبة'].strip() == 'كاش' and row['نوع المركبه'].strip() == 'كاش':
|
| 42 |
cash_amount += float(re.findall(r'(\d+(\.\d+)?) شيكل', row['تقرير نهائي'])[0][0])
|
| 43 |
-
|
|
|
|
| 44 |
|
| 45 |
def start_processing(start_date_str, end_date_str):
|
| 46 |
start_date = datetime.strptime(start_date_str, '%d.%m.%Y')
|
|
|
|
| 3 |
import re
|
| 4 |
import gradio as gr
|
| 5 |
import requests
|
|
|
|
| 6 |
|
| 7 |
# URL of the CSV file
|
| 8 |
CSV_URL = "https://huggingface.co/spaces/mhammad/Khanfar/raw/main/docs/your_data.csv"
|
|
|
|
| 39 |
# Check if رقم المركبة and نوع المركبه are both "كاش"
|
| 40 |
if row['رقم المركبة'].strip() == 'كاش' and row['نوع المركبه'].strip() == 'كاش':
|
| 41 |
cash_amount += float(re.findall(r'(\d+(\.\d+)?) شيكل', row['تقرير نهائي'])[0][0])
|
| 42 |
+
total_amount = sum(info['total_money'] for info in mechanics_work.values())
|
| 43 |
+
return mechanics_work, total_amount
|
| 44 |
|
| 45 |
def start_processing(start_date_str, end_date_str):
|
| 46 |
start_date = datetime.strptime(start_date_str, '%d.%m.%Y')
|