Skip to content

Commit

Permalink
csv files zipped
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahrieubland committed May 31, 2024
1 parent 1f4efc0 commit 8e17f14
Show file tree
Hide file tree
Showing 30 changed files with 21 additions and 6 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,14 @@ and check your browser !

## Utiliser Tox pour tester votre code

tox -vv
tox -vv

## Python scripts for testing locally (outside API)
To run the plotly graphs and the folium map locally and generate html files, you can use the script:

python3 pinkbombs/graphs/test_graphs.py

To translate the data and zip the csv files for download, run locally:

python3 pinkbombs/graphs/translate_data.py
python3 pinkbombs/graphs/zip_data.py
Binary file added download/csv/alternatives_text_7.csv.zip
Binary file not shown.
Binary file added download/csv/alternatives_text_7_fr.csv.zip
Binary file not shown.
Binary file not shown.
Binary file added download/csv/carbon_bombs_pie_chart_5.1.csv.zip
Binary file not shown.
Binary file added download/csv/country_pays.csv.zip
Binary file not shown.
Binary file added download/csv/data_isocodes_1.4.csv.zip
Binary file not shown.
Binary file added download/csv/discrease_wild_salmon_1.1.csv.zip
Binary file not shown.
Binary file added download/csv/discrease_wild_salmon_1.1_fr.csv.zip
Binary file not shown.
Binary file added download/csv/escapes_marine_cages_3.5.csv.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added download/csv/mortality_rates_4.4.csv.zip
Binary file not shown.
Binary file added download/csv/mortality_rates_4.4_fr.csv.zip
Binary file not shown.
Binary file modified download/csv/numbers_salmons_farmed_1.0.csv.zip
Binary file not shown.
Binary file not shown.
Binary file added download/csv/production_saumon_page_story.csv.zip
Binary file not shown.
Binary file added download/csv/ras_projects_for_map_2.4.csv.zip
Binary file not shown.
Binary file added download/csv/ras_projects_for_map_2.4_fr.csv.zip
Binary file not shown.
Binary file added download/csv/social_mill_fishing_6.csv.zip
Binary file not shown.
Binary file added download/csv/top_10_companies_producing_2.1.csv.zip
Binary file not shown.
Binary file not shown.
Binary file added download/csv/top_10_countries_producing_1.3.csv.zip
Binary file not shown.
Binary file not shown.
Binary file added download/csv/top_10_ras_companies_2.3.csv.zip
Binary file not shown.
Binary file added download/csv/top_10_ras_companies_2.3_fr.csv.zip
Binary file not shown.
15 changes: 10 additions & 5 deletions pinkbombs/graphs/zip_data.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@

import pandas as pd
import os

data1_0_name = 'numbers_salmons_farmed_1.0'
data1_0_file = "data/"+data1_0_name+".csv"
df_data1_0 = pd.read_csv(data1_0_file)
# Script to read the csv files and save them as zip for download from pinkbombs.org

df_data1_0.to_csv("download/csv/"+data1_0_name+".csv.zip",
compression='zip')
path = "data/"
dir_list = os.listdir(path)

for el in dir_list:
if el[-3:] == 'csv':
df = pd.read_csv(path+el)
df.to_csv("download/csv/"+el+".zip", compression='zip')
print("Files converted: ", el)

0 comments on commit 8e17f14

Please sign in to comment.