Skip to main content

A simple library to convert the currency of one country to other, it supports 153 countries' currency

Project description

Google currency

Disclaimer: This package fetch the result from Google using web scrapping. Owner will not be responsible for any misuse of this package. This is solely for the purpose of learning.

A very simple currency converter.

It can convert the currency of 153 codes.

Since the results are fetched from Google directly, you can trust the results :-D

Installation

To install the library run the below command (This will also install requests)

  • pip install google-currency

Usage

from google_currency import convert  

# Converted without comma like 70000.00 
convert('usd', 'inr', 1000) 

# Converted amount with comma like 70,000.00
convert('usd', 'inr', 1000)

This will return a JSON response like below

{  
	 "converted": true, 
	 "from": "USD", 
	 "to": "INR", 
	 "amount": "74876.00"
}

{  
	 "converted": true, 
	 "from": "USD", 
	 "to": "INR", 
	 "amount": "74,876.00"
}    

Response description

  • converted: Boolean indicating whether the amount is converted or not, if this is false than it means the
    currency code is not valid and the amount is not converted and it will be equal to 0.

  • amount: Converted amount

  • from: Currency code from which the amount is converted.

  • to: Currency code to which the amount is converted.

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

google_currency-1.0.10.tar.gz (5.8 kB view details)

Uploaded Source

File details

Details for the file google_currency-1.0.10.tar.gz.

File metadata

  • Download URL: google_currency-1.0.10.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.9

File hashes

Hashes for google_currency-1.0.10.tar.gz
Algorithm Hash digest
SHA256 b6c7488fc8fa0b24c9c9c27487b4f061e9a78596dbb45b4bbf1cf0f4174a73ba
MD5 530bb9669d877e2b7dd4f95fadceb4e9
BLAKE2b-256 d00b49ebba0bd4f798d99680fda4180cb1d9ec92c26e5b5cc7f4f1c27e5e9efc

See more details on using hashes here.

Supported by

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