Skip to content

Commit

Permalink
v0.1.25 - saved painel_coivd_base fixed bugs from io_api and plots an…
Browse files Browse the repository at this point in the history
…d delete the publish insta
  • Loading branch information
reinanbr committed Dec 31, 2021
1 parent 8d6bb86 commit 64b318f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
Binary file added base/arial_unicode.ttf
Binary file not shown.
14 changes: 11 additions & 3 deletions covidbr/plot_data/painel.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,19 @@ def painel_covid(data,limit_period:int=15,path_file:str='painel.jpg',
save_cache:bool=True):
city,state = data.city,data.state

#verification of path_img exists#
#verification of path_img or font exists#
#or needed download from a base#
if not os.path.isfile(path_img):
content_img = rq.get(url_img)

content_img = rq.get('https://raw.githubusercontent.com/gpftc/covid_br/main/painel_base_covid.jpeg').content
with open(path_img, 'wb') as file_img:
file_img.write(content_img)
if not os.path.isfile('arial_unicode.ttf'):
content_img = rq.get('https://raw.githubusercontent.com/gpftc/covid_br/main/painel_base_covid.jpeg').content
with open(path_img, 'wb') as file_img:
file_img.write(content_img)
else:
pass



painel_cache = 'cache_painel/'
Expand Down
Binary file removed painel_base_covid.jpeg
Binary file not shown.
2 changes: 1 addition & 1 deletion test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
place = 'juazeiro BA'
data_city = cb.data_from_city(place)

cb.plot_media_cases(data=data_city,limit_period=365)
cb.painel_covid(data=data_city,limit_period=365)

0 comments on commit 64b318f

Please sign in to comment.