forked from RomelTorres/alpha_vantage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
345 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
from .alphavantage import AlphaVantage as av | ||
|
||
|
||
class CryptoCurrencies(av): | ||
"""This class implements all the crypto currencies api calls | ||
""" | ||
|
||
@av._output_format | ||
@av._call_api_on_func | ||
def get_currency_exchange_rate(self, from_currency, to_currency): | ||
""" Returns the realtime exchange rate for any pair of digital | ||
currency (e.g., Bitcoin) or physical currency (e.g., USD). | ||
Keyword Arguments: | ||
from_currency: The currency you would like to get the exchange rate | ||
for. It can either be a physical currency or digital/crypto currency. | ||
For example: from_currency=USD or from_currency=BTC. | ||
to_currency: The destination currency for the exchange rate. | ||
It can either be a physical currency or digital/crypto currency. | ||
For example: to_currency=USD or to_currency=BTC. | ||
""" | ||
_FUNCTION_KEY = 'CURRENCY_EXCHANGE_RATE' | ||
return _FUNCTION_KEY, 'Realtime Currency Exchange Rate', None | ||
|
||
@av._output_format | ||
@av._call_api_on_func | ||
def get_digital_currency_intraday(self, symbol, market): | ||
""" Returns the intraday (with 5-minute intervals) time series for a | ||
digital currency (e.g., BTC) traded on a specific market | ||
(e.g., CNY/Chinese Yuan), updated realtime. Prices and volumes are | ||
quoted in both the market-specific currency and USD. | ||
Keyword Arguments: | ||
symbol: The digital/crypto currency of your choice. It can be any | ||
of the currencies in the digital currency list. For example: | ||
symbol=BTC. | ||
market: The exchange market of your choice. It can be any of the | ||
market in the market list. For example: market=CNY. | ||
""" | ||
_FUNCTION_KEY = 'DIGITAL_CURRENCY_INTRADAY' | ||
return _FUNCTION_KEY, 'Time Series (Digital Currency Intraday)', 'Meta Data' | ||
|
||
@av._output_format | ||
@av._call_api_on_func | ||
def get_digital_currency_daily(self, symbol, market): | ||
""" Returns the daily historical time series for a digital currency | ||
(e.g., BTC) traded on a specific market (e.g., CNY/Chinese Yuan), | ||
refreshed daily at midnight (UTC). Prices and volumes are quoted in | ||
both the market-specific currency and USD.. | ||
Keyword Arguments: | ||
symbol: The digital/crypto currency of your choice. It can be any | ||
of the currencies in the digital currency list. For example: | ||
symbol=BTC. | ||
market: The exchange market of your choice. It can be any of the | ||
market in the market list. For example: market=CNY. | ||
""" | ||
_FUNCTION_KEY = 'DIGITAL_CURRENCY_DAILY' | ||
return _FUNCTION_KEY, 'Time Series (Digital Currency Daily)', 'Meta Data' | ||
|
||
@av._output_format | ||
@av._call_api_on_func | ||
def get_digital_currency_weekly(self, symbol, market): | ||
""" Returns the weekly historical time series for a digital currency | ||
(e.g., BTC) traded on a specific market (e.g., CNY/Chinese Yuan), | ||
refreshed daily at midnight (UTC). Prices and volumes are quoted in | ||
both the market-specific currency and USD.. | ||
Keyword Arguments: | ||
symbol: The digital/crypto currency of your choice. It can be any | ||
of the currencies in the digital currency list. For example: | ||
symbol=BTC. | ||
market: The exchange market of your choice. It can be any of the | ||
market in the market list. For example: market=CNY. | ||
""" | ||
_FUNCTION_KEY = 'DIGITAL_CURRENCY_WEEKLY' | ||
return _FUNCTION_KEY, 'Time Series (Digital Currency Weekly)', 'Meta Data' | ||
|
||
@av._output_format | ||
@av._call_api_on_func | ||
def get_digital_currency_monthly(self, symbol, market): | ||
""" Returns the monthly historical time series for a digital currency | ||
(e.g., BTC) traded on a specific market (e.g., CNY/Chinese Yuan), | ||
refreshed daily at midnight (UTC). Prices and volumes are quoted in | ||
both the market-specific currency and USD.. | ||
Keyword Arguments: | ||
symbol: The digital/crypto currency of your choice. It can be any | ||
of the currencies in the digital currency list. For example: | ||
symbol=BTC. | ||
market: The exchange market of your choice. It can be any of the | ||
market in the market list. For example: market=CNY. | ||
""" | ||
_FUNCTION_KEY = 'DIGITAL_CURRENCY_MONTHLY' | ||
return _FUNCTION_KEY, 'Time Series (Digital Currency Monthly)', 'Meta Data' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
|
||
setup( | ||
name='alpha_vantage', | ||
version='1.2.1', | ||
version='1.3.1', | ||
author='Romel J. Torres', | ||
author_email='[email protected]', | ||
license='MIT', | ||
|
@@ -35,7 +35,8 @@ | |
], | ||
keywords=['stocks', 'market', 'finance', 'alpha_vantage', 'quotes', | ||
'shares'], | ||
packages=find_packages(exclude=['helpers', 'test_alpha_vantage', 'images']), | ||
packages=find_packages( | ||
exclude=['helpers', 'test_alpha_vantage', 'images']), | ||
package_data={ | ||
'alpha_vantage': [], | ||
} | ||
|
Oops, something went wrong.