Skip to main content

A Python package to get prices based on Purchasing Power Parity (PPP)

Project description

PPPfy - Purchasing Power Parity Adjustments

Overview

PPPfy is a Python package that provides tools for adjusting prices across different countries based on Purchasing Power Parity (PPP). The package includes functionality to convert a price from a source country's currency into its PPP equivalent in another country's currency, using historical PPP data.

Installation

Install the package using pip:

pip install pppfy

Features

  • Get Price Mapping: Calculate the PPP-adjusted price from a source country to one or more destination countries.
  • Get Country PPP: Retrieve the PPP factor for a specific country and year.

Usage

Importing the Module

You can import the Converter class from the pppfy package like this:

from pppfy.converter import Converter

Creating an Instance

Create an instance of the Converter class. Optionally, specify a path to a different PPP data file:

c = Converter()

Getting PPP Adjusted Price Mapping

To get the PPP-adjusted price from the USA to another country, you can use the get_price_mapping method:

ppp_adjusted_prices = c.get_price_mapping(source_country="US", source_price=79, destination_country="IN")
print(ppp_adjusted_prices)

This method returns a dictionary containing the PPP-adjusted price, the ISO2 code of the destination country, and the year of the PPP data used.

Retrieving Country PPP Data

To get the PPP factor for a specific country and year:

ppp_factor = c.get_country_ppp(country_iso2_code="IN", year=2021)
print(ppp_factor)

Contributing

Contributions to pppfy are welcome! Please feel free to submit pull requests or raise issues on the repository.

License

This project is licensed under the GNU Affero General Public License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pppfy-1.0.1.tar.gz (78.0 kB view hashes)

Uploaded Source

Built Distribution

pppfy-1.0.1-py3-none-any.whl (76.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page