-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pincode based distance and Enhancements for Streamlit App #8
base: main
Are you sure you want to change the base?
Conversation
Update availability.py
-- added pincode vased distance calculation -- added empty email if no slots are available
love this @manujosephv this fixes #11, as age is logical. |
but getting 👉 full tracebackFile "/home/aahnik/Desktop/vaccine_availability/.venv/lib/python3.9/site-packages/streamlit/script_runner.py", line 337, in _run_script
exec(code, module.__dict__)
File "/home/aahnik/Desktop/vaccine_availability/streamlit_app.py", line 77, in <module>
main()
File "/home/aahnik/Desktop/vaccine_availability/streamlit_app.py", line 53, in main
df = cached_availability(next_n_days, district_ids, min_age_limit, pincode_search, free_paid)
File "/home/aahnik/Desktop/vaccine_availability/.venv/lib/python3.9/site-packages/streamlit/caching.py", line 573, in wrapped_func
return get_or_create_cached_value()
File "/home/aahnik/Desktop/vaccine_availability/.venv/lib/python3.9/site-packages/streamlit/caching.py", line 557, in get_or_create_cached_value
return_value = func(*args, **kwargs)
File "/home/aahnik/Desktop/vaccine_availability/streamlit_app.py", line 10, in cached_availability
df= get_availability(next_n_days, district_ids, min_age_limit, pincode_search)
File "/home/aahnik/Desktop/vaccine_availability/availability.py", line 51, in get_availability
data = get_data(URL)
File "/home/aahnik/Desktop/vaccine_availability/.venv/lib/python3.9/site-packages/cachetools/func.py", line 66, in wrapper
v = func(*args, **kwargs)
File "/home/aahnik/Desktop/vaccine_availability/.venv/lib/python3.9/site-packages/decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "/home/aahnik/Desktop/vaccine_availability/.venv/lib/python3.9/site-packages/retry/api.py", line 73, in retry_decorator
return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,
File "/home/aahnik/Desktop/vaccine_availability/.venv/lib/python3.9/site-packages/retry/api.py", line 33, in __retry_internal
return f()
File "/home/aahnik/Desktop/vaccine_availability/availability.py", line 37, in get_data
data = json.loads(response.text)['centers']
File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None |
-- added options to show empty slots -- added option to send/not send empty emails
@bhavsarpratik have resolved the merge conflicts. And fixed the api pull issue. It is now working |
on more investigation... the requests are going through from my local, but not from the Github Action. Not sure why |
hi @manujosephv, the JSON decode error is resolved after the changes. thanks! 46 is greater than 45, so it should show all slots with min age 45 ... right ? it shows nothing, but if I do this, then slots are shown. |
hi @manujosephv, it would be more logical to have a download pdf button. df.to_html() # will give HTML of the dataframe
import pdfkit as pdf
# pip install pdfkit
# sudo apt install wkhtmltopdf
pdf.from_file("/path/to/html.html","/path/to/pdf.pdf") the user of this app will be common human, and csv is for machines to read. if a programmer wants data, they will take from the official API, not after downloading csv from this app. |
key changes: