{"id":13387465,"url":"https://github.com/micropyramid/forex-python","last_synced_at":"2025-04-13T21:28:36.508Z","repository":{"id":38101998,"uuid":"59342145","full_name":"MicroPyramid/forex-python","owner":"MicroPyramid","description":"Foreign exchange rates, Bitcoin price index and currency conversion using ratesapi.io","archived":false,"fork":false,"pushed_at":"2023-09-03T18:27:36.000Z","size":120,"stargazers_count":676,"open_issues_count":43,"forks_count":200,"subscribers_count":48,"default_branch":"master","last_synced_at":"2025-04-06T18:11:22.344Z","etag":null,"topics":["bitcoin","currency","currency-converter","currency-exchange-rates","package","python"],"latest_commit_sha":null,"homepage":"http://forex-python.readthedocs.io/en/latest/usage.html","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MicroPyramid.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-05-21T04:43:37.000Z","updated_at":"2025-04-04T07:48:45.000Z","dependencies_parsed_at":"2024-01-23T21:17:30.910Z","dependency_job_id":"93a70e77-3471-4cc4-95d2-621931a385c0","html_url":"https://github.com/MicroPyramid/forex-python","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicroPyramid%2Fforex-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicroPyramid%2Fforex-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicroPyramid%2Fforex-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicroPyramid%2Fforex-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MicroPyramid","download_url":"https://codeload.github.com/MicroPyramid/forex-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248784787,"owners_count":21161179,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bitcoin","currency","currency-converter","currency-exchange-rates","package","python"],"created_at":"2024-07-30T12:01:20.605Z","updated_at":"2025-04-13T21:28:36.489Z","avatar_url":"https://github.com/MicroPyramid.png","language":"Python","readme":"forex-python\n============\n\n.. image:: https://travis-ci.org/MicroPyramid/forex-python.svg?branch=master\n   :target: https://travis-ci.org/MicroPyramid/forex-python\n   :alt: travis-ci\n\n.. image:: https://coveralls.io/repos/github/MicroPyramid/forex-python/badge.svg?branch=master\n   :target: https://coveralls.io/github/MicroPyramid/forex-python?branch=master\n   :alt: coveralls\n\n.. image:: https://landscape.io/github/MicroPyramid/forex-python/master/landscape.svg?style=flat\n   :target: https://landscape.io/github/MicroPyramid/forex-python/master\n   :alt: Code Health\n\n.. image:: https://img.shields.io/badge/python-2.7%2C%203.3%2C%203.4%2C%203.5-blue.svg\n   :target: https://pypi.python.org/pypi/forex-python\n   :alt: pypi\n\nForex Python is a Free Foreign exchange rates and currency conversion.\n\n**Note: Install latest forex-python==1.6 to avoid RatesNotAvailableError**\n\n.. image:: https://runcode-app-public.s3.amazonaws.com/images/dark_btn.png\n   :target: https://runcode.io\n   :alt: RunCode\n\n\nFeatures of Forex Python:\n---------\n- List all currency rates.\n- BitCoin price for all currencies.\n- Converting amount to BitCoins.\n- Get historical rates for any day since 1999.\n- Conversion rate for one currency(ex; USD to INR).\n- Convert amount from one currency to other.('USD 10$' to INR).\n- Currency symbols.\n- Currency names.\n\nCurrency Source:\n-----------------\n\nhttps://theforexapi.com is a free API for current and historical foreign exchange rates published by European Central Bank.\nThe rates are updated daily 3PM CET.\n\nBitCoin Price Source:\n---------------------\nBitcoin prices calculated every minute. For more information visit [CoinDesk](http://www.coindesk.com).\n\nInstallation\n--------------\n\n- Install using python package\n\n\t.. code-block:: python\n\n\t\t\tpip install forex-python\n\n\t\t\t\tOr directly cloning the repo:\n\n\t\t\tpython setup.py install\n\nUsage Examples:\n------------------\n\n- Initialize class\n\n\t.. code-block:: python\n\n\t\t\tpython\n\t\t\t\u003e\u003e\u003e from forex_python.converter import CurrencyRates\n\t\t\t\u003e\u003e\u003e c = CurrencyRates()\n\n- list all latest currency rates for \"USD\"\n\n\t.. code-block:: python\n\n\t\t\tpython\n\t\t\t\u003e\u003e\u003e c.get_rates('USD')\n\t\t\t{u'IDR': 13625.0, u'BGN': 1.7433, u'ILS': 3.8794, u'GBP': 0.68641, u'DKK': 6.6289, u'CAD': 1.3106, u'JPY': 110.36, u'HUF': 282.36, u'RON': 4.0162, u'MYR': 4.081, u'SEK': 8.3419, u'SGD': 1.3815, u'HKD': 7.7673, u'AUD': 1.3833, u'CHF': 0.99144, u'KRW': 1187.3, u'CNY': 6.5475, u'TRY': 2.9839, u'HRK': 6.6731, u'NZD': 1.4777, u'THB': 35.73, u'EUR': 0.89135, u'NOK': 8.3212, u'RUB': 66.774, u'INR': 67.473, u'MXN': 18.41, u'CZK': 24.089, u'BRL': 3.5473, u'PLN': 3.94, u'PHP': 46.775, u'ZAR': 15.747}\n\n- Get conversion rate from USD to INR\n\n\t.. code-block:: python\n\n\t\t\tpython\n\t\t\t\u003e\u003e\u003e c.get_rate('USD', 'INR')\n\t\t\t67.473\n\n- Convert amount from USD to INR\n\n\t.. code-block:: python\n\n\t\t\tpython\n\t\t\t\u003e\u003e\u003e c.convert('USD', 'INR', 10)\n\t\t\t674.73\n\n- Force use of Decimal\n\n\t.. code-block:: python\n\n\t\t\tpython\n\t\t\t\u003e\u003e\u003e from forex_python.converter import CurrencyRates\n\t\t\t\u003e\u003e\u003e c = CurrencyRates(force_decimal=True)\n\t\t\t\u003e\u003e\u003e c.convert('USD', 'INR', Decimal('10.45'))\n\t\t\t705.09\n\t\t\t\u003e\u003e\u003e c.convert('USD', 'INR', 10)\n\t\t\tDecimalFloatMismatchError: convert requires amount parameter is of type Decimal when use_decimal=True\n\n- Detect use of Decimal\n\n\t.. code-block:: python\n\n\t\t\tpython\n\t\t\t\u003e\u003e\u003e from forex_python.converter import CurrencyRates\n\t\t\t\u003e\u003e\u003e c = CurrencyRates()\n\t\t\t\u003e\u003e\u003e c.convert('USD', 'INR', Decimal('10.45'))\n\t\t\t705.09\n\t\t\t\u003e\u003e\u003e c.convert('USD', 'INR', 10)\n\t\t\t674.73\n\n- Get latest Bitcoin price.\n\n\t.. code-block:: python\n\n\t\t\tpython\n\t\t\t\u003e\u003e\u003e from forex_python.bitcoin import BtcConverter\n\t\t\t\u003e\u003e\u003e b = BtcConverter() # force_decimal=True to get Decimal rates\n\t\t\t\u003e\u003e\u003e b.get_latest_price('USD')\n\t\t\t533.913\n\n\n- Convert Amount to Bitcoins based on latest exchange price.\n\n\t.. code-block:: python\n\n\t\t\tpython\n\t\t\t\u003e\u003e\u003e b.convert_to_btc(400, 'USD')\n\t\t\t0.7492699301118473\n\n\n- Get currency symbol using currency code\n\n\t.. code-block:: python\n\n\t\t\tpython\n\t\t\t\u003e\u003e\u003e from forex_python.converter import CurrencyCodes\n\t\t\t\u003e\u003e\u003e c = CurrencyCodes()\n\t\t\t\u003e\u003e\u003e print c.get_symbol('GBP')\n\t\t\t£\n\n\nYou can view the complete `Documentation Here`_\n\nVisit our Python Development page `Here`_\n\nWe welcome your feedback and support, raise `github ticket`_ if you want to report a bug. Need new features? `Contact us here`_\n\n.. _contact us here: https://micropyramid.com/contact-us/\n.. _github ticket: https://github.com/MicroPyramid/forex-python/issues\n.. _Documentation Here: http://forex-python.readthedocs.org/en/latest/?badge=latest\n.. _Here: https://micropyramid.com/python-development-services/\n","funding_links":[],"categories":["\u003ca id=\"2110ded2aa5637fa933cc674bc33bf21\"\u003e\u003c/a\u003e工具"],"sub_categories":["\u003ca id=\"63fd2c592145914e99f837cecdc5a67c\"\u003e\u003c/a\u003e新添加的1"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicropyramid%2Fforex-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicropyramid%2Fforex-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicropyramid%2Fforex-python/lists"}