Skip to content

Commit 5023fff

Browse files
author
Shlomi Kushchi
authored
Merge pull request #279 from alpacahq/remove_alpha_vantage
Remove the alpha vantage integration from this package
2 parents 93af35a + d27bb4b commit 5023fff

20 files changed

+1
-2473
lines changed

β€ŽREADME.mdβ€Ž

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ The Alpaca SDK will check the environment for a number of variables that can be
6666
| APCA_RETRY_CODES=429,504 | 429,504 | comma-separated HTTP status code for which retry is attempted |
6767
| POLYGON_WS_URL | wss://socket.polygon.io/stocks | Endpoint for streaming polygon data. You likely don't need to change this unless you want to proxy it for example |
6868
| POLYGON_KEY_ID | | Your Polygon key, if it's not the same as your Alpaca API key. Most users will not need to set this to access Polygon. |
69-
| ALPHAVANTAGE_API_KEY=<key_id> | | Your Alpha Vantage API key. You can get [one for free here](https://www.alphavantage.co/support/#api-key). |
7069

7170
## REST
7271

@@ -426,67 +425,6 @@ dict[symbol -> `Financials`] if `symbol` is a list of string.
426425
### polygon/REST.news(symbol)
427426
Returns a `NewsList` entity for the symbol.
428427

429-
430-
---
431-
# Alpha Vantage API Service
432-
433-
In addition to Polygon is Alpha Vantage, for users without a live account (paper trading) or want to use the unique features of AV data. You can get a free key [here](https://www.alphavantage.co/support/#api-key) and the documentation is [here](https://www.alphavantage.co/documentation/). Premium keys are also available [here](https://www.alphavantage.co/premium/#intro)
434-
This python SDK wraps their API service and seamlessly integrates it with the Alpaca
435-
API. `alpaca_trade_api.REST.alpha_vantage` will be the `REST` object for Alpha Vantage.
436-
437-
The example below gives AAPL daily OHLCV data in a DataFrame format.
438-
439-
```py
440-
import alpaca_trade_api as tradeapi
441-
442-
api = tradeapi.REST()
443-
aapl = api.alpha_vantage.historic_quotes('AAPL', adjusted=True, output_format='pandas')
444-
```
445-
446-
## alpha_vantage/REST
447-
It is initialized through the alpaca `REST` object.
448-
449-
### alpha_vantage/REST.get(params=None)
450-
Customizable endpoint, where you can pass all keywords/parameters from the documentation:https://www.alphavantage.co/documentation/#
451-
452-
Returns the specific customized data.
453-
454-
### alpha_vantage/REST.historic_quotes(symbol, adjusted=False, outputsize='full', cadence='daily', output_format=None)
455-
Returns a `csv`, `json`, or `pandas` object of historical OHLCV data.
456-
457-
### alpha_vantage/REST.intraday_quotes(symbol, interval='5min', outputsize='full', output_format=None)
458-
Returns a `csv`, `json`, or `pandas` object of intraday OHLCV data.
459-
460-
### alpha_vantage/REST.current_quote(symbol)
461-
Returns a `json` object with the current OHLCV data of the selected symbol.
462-
463-
### alpha_vantage/REST.last_quote(symbol)
464-
Returns a `json` object with the current OHLCV data of the selected symbol (same as `current_quote`).
465-
466-
### alpha_vantage/REST.search_endpoint(keywords, datatype='json')
467-
Returns a `csv`, `json`, or `pandas` object that contains the best-matching symbols and market information based on keywords of your choice.
468-
469-
### alpha_vantage/REST.company(symbol, datatype='json')
470-
Same as `search_endpoint`.
471-
472-
### alpha_vantage/REST.historic_fx_quotes(from_symbol, to_symbol, outputsize='full', cadence='daily', output_format=None)
473-
Returns a `csv`, `json`, or `pandas` object of historical OHLCV data for the currency pair.
474-
475-
### alpha_vantage/REST.intraday_fx_quotes(from_symbol, to_symbol, interval='5min', outputsize='full', output_format=None)
476-
Returns a `csv`, `json`, or `pandas` object of intraday OHLCV data for the currency pair.
477-
478-
### alpha_vantage/REST.exchange_rate(from_currency, to_currency)
479-
Returns a `json` object with the current OHLCV data of the selected currency pair (digital or physical)
480-
481-
### alpha_vantage/REST.historic_cryptocurrency_quotes(self, symbol, market, cadence='daily', output_format=None)
482-
Returns a `csv`, `json`, or `pandas` object of historical OHLCV data for the cryptocurrency pair.
483-
484-
### alpha_vantage/REST.techindicators(self, techindicator='SMA', output_format='json', **kwargs)
485-
Returns a `csv`, `json`, or `pandas` object with the data from the techindicator of choice.
486-
487-
### alpha_vantage/REST.sector()
488-
Returns a `json` of the currency sector performances.
489-
490428
## Support and Contribution
491429

492430
For technical issues particular to this module, please report the

β€Žalpaca_trade_api/alpha_vantage/__init__.pyβ€Ž

Lines changed: 0 additions & 1 deletion
This file was deleted.

β€Žalpaca_trade_api/alpha_vantage/rest.pyβ€Ž

Lines changed: 0 additions & 155 deletions
This file was deleted.

β€Žalpaca_trade_api/common.pyβ€Ž

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,6 @@ def get_polygon_credentials(alpaca_key: str = None) -> str:
9595
return key_id
9696

9797

98-
def get_alpha_vantage_credentials(alpha_vantage_key: str = None) -> str:
99-
key_id = alpha_vantage_key or os.environ.get('ALPHAVANTAGE_API_KEY')
100-
if key_id is None:
101-
raise ValueError('Key ID must be given to access Alpha Vantage API'
102-
' (env: ALPHAVANTAGE_API_KEY)')
103-
return key_id
104-
105-
10698
def get_api_version(api_version: str) -> str:
10799
api_version = api_version or os.environ.get('APCA_API_VERSION')
108100
if api_version is None:

β€Žalpaca_trade_api/rest.pyβ€Ž

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
Aggs, Trade, Quote, Watchlist, PortfolioHistory
1717
)
1818
from . import polygon
19-
from . import alpha_vantage
2019

2120
logger = logging.getLogger(__name__)
2221
Positions = List[Position]
@@ -82,7 +81,6 @@ def __init__(self,
8281
'APCA_RETRY_CODES', '429,504').split(',')]
8382
self.polygon = polygon.REST(
8483
self._key_id, 'staging' in self._base_url)
85-
self.alpha_vantage = alpha_vantage.REST(self._key_id)
8684

8785
def _request(self,
8886
method,

β€Žrequirements/requirements.txtβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ requests>2,<3
33
urllib3>1.24,<1.26
44
websocket-client>=0.56.0,<1
55
websockets>=8.0,<9
6-
alpha_vantage>=2,<3
6+

β€Žsetup.pyβ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
packages=[
3535
'alpaca_trade_api',
3636
'alpaca_trade_api.polygon',
37-
'alpaca_trade_api.alpha_vantage',
3837
],
3938
install_requires=REQUIREMENTS,
4039
tests_require=REQUIREMENTS_TEST,

β€Žtests/test_alpha_vantage/__init__.pyβ€Ž

Whitespace-only changes.

β€Žtests/test_alpha_vantage/test_data/global_quoteβ€Ž

Lines changed: 0 additions & 14 deletions
This file was deleted.

β€Žtests/test_alpha_vantage/test_data/mock_batch_quotesβ€Ž

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
Β (0)