# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['pydeflate', 'pydeflate.deflate', 'pydeflate.get_data', 'pydeflate.tools']

package_data = \
{'': ['*'], 'pydeflate': ['.pydeflate_data/*']}

install_requires = \
['BeautifulSoup4>=4.11.1,<5.0.0',
 'country-converter>=0.8.0,<0.9.0',
 'numpy>=1.24.1,<2.0.0',
 'pandas-datareader>=0.10.0,<0.11.0',
 'pandas>=1.5.2,<2.0.0',
 'pyarrow>=11,<12',
 'requests>=2.28.1,<3.0.0',
 'weo>=0.7.4,<0.8.0',
 'xlrd>=2.0.1,<3.0.0']

setup_kwargs = {
    'name': 'pydeflate',
    'version': '1.3.0',
    'description': 'Package to convert current prices figures to constant prices and vice versa',
    'long_description': 'The pydeflate Package\n=====================\n\n|pypi|\n|Documentation Status|\n|black|\n|Downloads|\n|Coverage|\n\n\n**Pydeflate** is a Python package to convert flows data to constant\nprices. This can be done from any source currency to any desired base\nyear and currency. **Pydeflate** can also be used to convert constant\ndata to current prices and to convert from one currency to another (in\ncurrent and constant prices). Users can choose the source of the\nexchange and deflator/prices data (IMF, World Bank or OECD DAC).\n\n-  Free software: MIT license\n-  Documentation: https://pydeflate.readthedocs.io.\n\nInstallation\n------------\n\npydeflate can be installed from PyPI. From the command line:\n\n::\n\n   pip install pydeflate --upgrade\n\nAlternatively, the source code is available on\n`GitHub <https://github.com/jm-rivera/pydeflate>`__.\n\nUsage\n-----\n\nBasic usage\n~~~~~~~~~~~\n\nConvert data expressed in current USD prices to constant EUR prices for\na given base year:\n\n::\n\n   import pydeflate\n   import pandas as pd\n\n   # example data\n   data = {\'iso_code\': [\'FRA\',\'USA\', \'GTM\'],\n           \'year\': [2017, 2017, 2017],\n           \'value\': [50, 100, 200]}\n\n   # create an example dataframe, in current USD prices\n   df = pd.DataFrame.from_dict(data)\n\n   # convert to EUR 2015 constant prices\n   df_constant = pydeflate.deflate(\n       df = df,\n       base_year = 2015,\n       source = \'wb\',\n       method = \'gdp\',\n       source_currency = "USA", # since data is in USD\n       target_currency = "EMU", # we want the result in constant EUR\n       id_column = "iso_code",\n       id_type = "ISO3", # specifying this is optional in most cases\n       date_column = "year",\n       source_col = "value",\n       target_col = "value_constant",\n   ) \n           \n   print(df_constant)\n\nThis results in a dataframe containing a new column ``value_constant``\nin 2015 constant prices. In the background, pydeflate takes into\naccount:\n\n-  changes in princes, through a gdp deflator in this case\n-  changes in exchange rates overtime\n\nPydeflate can also handle data that is expressed in local currency\nunits. In that case, users can specify ``LCU`` as the source currency.\n\n::\n\n   import pydeflate\n   import pandas as pd\n\n   #example data\n   data = {\'country\': [\'United Kingdom\',\'United Kingdom\', \'Japan\'],\n           \'date\': [2011, 2015, 2015],\n           \'value\': [100, 100, 100]}\n\n   #create an example dataframe, in current local currency units \n   df = pd.DataFrame.from_dict(data)\n\n   #convert to USD 2018 constant prices\n   df_constant = pydeflate.deflate(\n       df = df,\n       base_year = 2018,\n       source = \'imf\',\n       method = \'pcpi\',\n       source_currency = "LCU", #since data is in LCU\n       target_currency = "USA", #to get data in USD\n       id_column = "iso_code",\n       date_column = "date",\n       source_col = "value",\n       target_col = "value", #to not create a new column\n   ) \n           \n   print(df_constant)\n\nUsers can also convert a dataset expressed in constant prices to current\nprices using pydeflate. To avoid introducing errors, users should know\nwhich methodology/ data was used to create constant prices by the\noriginal source. The basic usage is the same as before, but the\n``to_current`` parameter is set to ``True``.\n\nFor example, to convert DAC data expressed in 2016 USD constant prices\nto current US dollars:\n\n::\n\n   import pydeflate\n   import pandas as pd\n\n   #example data\n   data = {\'dac_code\': [302, 4, 4],\n           \'date\': [2010, 2016, 2018],\n           \'value\': [100, 100, 100]}\n\n   #create an example dataframe, in current local currency units \n   df = pd.DataFrame.from_dict(data)\n\n   #convert to USD 2018 constant prices\n   df_current = pydeflate.deflate(\n       df = df,\n       base_year = 2016,\n       source = \'oecd_dac\', \n       source_currency = "USA", #since data is in USD constant\n       target_currency = "LCU", #to get the current LCU figures\n       id_column = "dac_code",\n       id_type = "DAC",\n       date_column = "date",\n       source_col = "value",\n       target_col = "value_current", \n       to_current = True,   \n   ) \n           \n   print(df_current)\n\nData source and method options\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nA ``source`` and a ``method`` for the exchange and price/gdp deflators\nmust be chosen. The appropriate combination depends on the objectives of\nthe project or the nature of the original data.\n\nIn terms of price or GDP deflators, pydeflate provides the following\n``methods``:\n\n-  World Bank (“wb”):\n\n   -  ``gdp``: in order to use GDP deflators.\n   -  ``gdp_linked``: to use the World Bank’s GDP deflator series which\n      has been linked to produce a consistent time series to counteract\n      breaks in series over time due to changes in base years, sources\n      or methodologies.\n   -  ``cpi``: to use Consumer Price Index data\n\n-  International Monetary Fund World Economic Outlook (“imf”):\n\n   -  ``gdp``: in order to use GDP deflators.\n   -  ``pcpi``: in order to use Consumer Price Index data.\n   -  ``pcpie``: to use end-of-period Consumer Price Index data\n      (e.g.\xa0for December each year).\n\n-  OECD Development Assistance Committee (“oecd_dac”):\n\n   -  ``None``: for consistency with how the DAC calculates deflators,\n      only their methodology is accepted/used with this data.\n\nThe source of the exchange rate data depends on the source selected.\nBoth ``imf`` and ``wb`` use data from the International Monetary Fund\n(``LCU per US$, yearly average``). The OECD Development Assistance\nCommittee data uses different exchange rates. When ``oecd_dac`` is\nselected as the source, the OECD DAC exchange rates (``LCU per US$``)\nare used. Exchange rates between two non USD currency pairs are derived\nfrom the LCU to USD exchange rates selected.\n\nAdditional features\n~~~~~~~~~~~~~~~~~~~\n\nPydeflate relies on data from the World Bank, IMF and OECD for its\ncalculations. This data is updated periodically. If the version of the\ndata stored in the user’s computer is older than 50 days, pydeflate will\nshow a warning on import.\n\nUsers can always update the underlying data by using:\n\n::\n\n   import pydeflate\n\n   pydeflate.update_all_data()\n\nPydeflate also provides users with a tool to exchange figures from one\ncurrency to another, without applying any deflators. This should only be\nused on numbers expressed in current prices, however.\n\nFor example, to convert numbers in current Local Currency Units (LCU) to\ncurrent Canadian Dollars:\n\n::\n\n   import pydeflate\n   import pandas as pd\n\n   #example data\n   data = {\'iso_code\': [\'GBR\',\'CAN\', \'JPN\'],\n           \'date\': [2011, 2015, 2015],\n           \'value\': [100, 100, 100]}\n\n   #create an example dataframe, in current local currency units \n   df = pd.DataFrame.from_dict(data)\n\n   #convert to USD 2018 constant prices\n   df_can = pydeflate.exchange(\n       df = df,\n       source_currency = "LCU", #since data is in LCU\n       target_currency = "CAN", #to get data in Canadian Dollars\n       rates_source = \'wb\', #this is the same as IMF exchange rates\n       value_column = \'value\',\n       target_column = \'value_CAN\',\n       id_column = "iso_code",\n       id_type = "ISO3"\n       date_column = "date",\n   ) \n           \n   print(df_can)\n\nCredits\n-------\n\nThis package relies on data from the following sources:\n\n-  OECD DAC: https://www.oecd.org/dac/ (Official Development assistance\n   data (DAC1), DAC deflators, and exchange rates used by the DAC)\n-  IMF World Economic Outlook: https://www.imf.org/en/Publications/WEO\n   (GDP and price deflators)\n-  World Bank DataBank: https://databank.worldbank.org/home.aspx\n   (exchange rates, GDP and price deflators)\n\nThis data is provided based on the terms and conditions set by the\noriginal sources\n\n.. |pypi| image:: https://img.shields.io/pypi/v/pydeflate.svg\n   :target: https://pypi.python.org/pypi/pydeflate\n.. |Documentation Status| image:: https://readthedocs.org/projects/pydeflate/badge/?version=latest\n   :target: https://pydeflate.readthedocs.io/en/latest/?version=latest\n.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg\n   :target: https://github.com/psf/black\n.. |Downloads| image:: https://pepy.tech/badge/pydeflate/month\n   :target: https://pepy.tech/project/pydeflate\n\n.. |Coverage| image:: https://codecov.io/gh/jm-rivera/pydeflate/branch/main/graph/badge.svg?token=uwKI5DyO3w\n   :target: https://codecov.io/gh/jm-rivera/pydeflate\n\n\nGbemisola Joel-Osoba provided extensive feedback and testing of version 1.\n',
    'author': 'Jorge Rivera',
    'author_email': 'jorge.rivera@one.org',
    'maintainer': 'None',
    'maintainer_email': 'None',
    'url': 'https://github.com/jm-rivera/pydeflate',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'python_requires': '>=3.10,<4.0',
}


setup(**setup_kwargs)
