Package: waste-flow
waste_flowversion 1.3.2waste_flowis a python package for retrieving and analyzing data concerning the waste management of European countries.InstallingSincewaste_flowis written in python it is compatible with all operating systems: Linux, macOS and Windows. The only prerequisite is python version 3.6 or above which is often installed by default. Simply choose one of the two following methods to install, depending on which package manager you prefer to use.Installing viaconda$ conda install -c conda-forge -c xapple waste_flowInstalling viapip$ python3 -m pip install --user waste_flowTroubleshootingIf you do not havecondaon your system you can refer tothis section.If you do not havepip3on your system you can refer tothis section.If you do not havepython3on your system or have an outdated version, you can refer tothis other section.If none of the above has enabled you to installwaste_flow, please open an issue onthe bug trackerand we will get back to you shortly.UsageBellow are some examples to illustrate the various ways there are to use this package.To retrieve the large dataframe with dry mass for all years and all countries you can do the following from your python interpreter:>>> from waste_flow.analysis import waste_ana
>>> print(waste_ana.dry_mass)If you just want to see how much rubber waste did the UK generate in 2008, you can do the following:>>> from waste_flow.generation import waste_gen
>>> params = ("waste   == 'W073' & "
>>>           "country == 'UK' & "
>>>           "year    == '2008'")
>>> result = waste_gen.long_format.query(params)
>>> print(result)To create the waste generation plots do the following:>>> from waste_flow.viz.gen_by_country import legend
>>> print(legend.plot(rerun=True))
>>> from waste_flow.viz.gen_by_country import countries
>>> for gen_viz in countries.values():
>>>     print(gen_viz.plot(rerun=True))CacheWhen you importwaste_flow, we will check the$WASTE_FLOW_CACHEenvironment variable to see where to download and store the cached data. If this variable is not set, we will default to the platform's temporary directory and clone a repository there. This could result in re-downloading the cache after every reboot.FeaturesThe first time you runwaste_flow, it will automatically download the raw CSVs from the EUROSTAT website to disk and parse the resulting data. On later runs,waste_flowwill simply retrieve this information directly from the disk. This means that the first time you execute the pipeline things will be noticeably slower: this is normal.SourceThe two datasets used in this pipeline are available at the following addresses:https://appsso.eurostat.ec.europa.eu/nui/show.do?dataset=env_wasgen&lang=enhttps://appsso.eurostat.ec.europa.eu/nui/show.do?dataset=env_wastrt&lang=enThese are obtained by starting athttps://ec.europa.eu/eurostat/data/databaseand following "Database by themes -> Environment -> Waste -> Waste treatment"The full name of the datasets are:Generation of waste by waste category, hazardousness and NACE Rev. 2 activity (env_wasgen).Treatment of waste by waste category, hazardousness and waste management operations (env_wastrt).CustomizingThe pipeline is flexible as the user can specify what coefficients they desire or even what custom waste categories they want to create. These input parameters are in the files under thewaste_flow/extra_data_xlsdirectory.VisualizationsThewaste_flowpackage can also generate several types of plots that enable the user to compare and visualize the data.For instance here is a series of graphs comparing the total reported waste generated in wet tonnes between European countries for thenacecategoryC20-C22."Manufacture of chemical, pharmaceutical, rubber and plastic products"Distributing the packageInstructions for distributing and uploadingwaste_flowon PyPI so that it can be installed bypipcanbe found here. The current uploaded version islisted here.Instructions for distributing and uploadingwaste_flowon anaconda so that it can be installed bycondacanbe found here. The current uploaded version islisted here.Two scripts that automate these processes can be found in the following repository:https://github.com/xapple/bumphubDeveloper documentationThe internal documentation of thewaste_flowpython package is available at:http://xapple.github.io/waste_flow/waste_flowThis documentation is simply generated from the source code with this command:$ pdoc3 --html --output-dir docs --force waste_flow