Skip to content

Commit

Permalink
Add History Methods to README & renamed some methods
Browse files Browse the repository at this point in the history
  • Loading branch information
arechiga-code committed Mar 7, 2018
1 parent 17f5974 commit 952abe2
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,34 @@ MSFT{

## Available methods

###History API

- ``add_ticker(ticker)``
- ``add_tickers(tickers)`` -- takes argument as array (['ticker1', 'ticker2', ...]) or individual parameters (ticker1, ticker2, ...)
- ``remove_ticker(tickers)``
- ``get_tickers()``
- ``get_period()``
- ``get_startDate()``
- ``get_endDate()``
- ``change_period(periods)``-- takes argument as array (['period1', 'period2']) or individual parameters ('period1', 'period2')
- ``change_startTime(start)``
- ``change_endTime(end)``
- ``get_dataset()``
- ``update_dataset()``
- ``change_frequency(frequency, num_between=1)`` -- frequency can be daily, weekly, or monthly. num_between is the step between dates (Not required. Default is 1)
- ``get_date()`` -- if ticker(s) provided only returns data for those ticker(s)
- ``get_open()`` -- if ticker(s) provided only returns data for those ticker(s)
- ``get_high()`` -- if ticker(s) provided only returns data for those ticker(s)
- ``get_low()`` -- if ticker(s) provided only returns data for those ticker(s)
- ``get_close()`` -- if ticker(s) provided only returns data for those ticker(s)
- ``get_adj_close()`` -- if ticker(s) provided only returns data for those ticker(s)
- ``get_volume()`` -- if ticker(s) provided only returns data for those ticker(s)
- ``get_combo(ticker="ticker",field="high")`` -- Either ticker or field MUST be given (both is valid). If no ticker is provided returns data for all tickers. If no field is provided returns data for all fields.


### Simple API
- ``change_ticker(ticker)``
- ``get_ticker()``
- ``get_price()``
- ``get_volume()``
- ``get_ask()``
Expand Down Expand Up @@ -184,8 +210,10 @@ MSFT{
- ``get_twoHundredDayAverageChangePercent()``

### Advanced API
- ``get_customData()``
- ``add_ticker(ticker)``
- ``add_tickers(tickers)`` -- takes list of tickers as argument (or add_tickers(ticker1,ticker2,...))
- ``get_tickers(tickers)``
- ``remove_tickers(tickers)``
- ``add_price()``
- ``add_volume()``
Expand Down Expand Up @@ -252,7 +280,7 @@ MSFT{
## Feedback, Issues, and Features:
### Feedback
I'd love to get some feedback from users. I want to know how you are using InVaIN so I can focus on updating it in ways that improve your experience. If you'd like to do so you can email me at *[email protected]* **(NOTE: Email abuse will result in your email address being BLOCKED AND/OR REMOVAL OF YOUR ACCESS to InVaIN's data retrieval services)** <br/>
In that vien, I just wanted to outline some guidelines for submitting issues on github.
In that vein, I just wanted to outline some guidelines for submitting issues on github.

### Bugs
If you experience any bugs when running the package please submit an issue with a description of the issue. Bugs will take priority over all other issues.
Expand Down
2 changes: 1 addition & 1 deletion invain/Advanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def remove_ticker(self, ticker):
except ValueError as err:
print(err.args,"\n Non-Fatal Error")

def get_ticker(self):
def get_tickers(self):
return self.ticker;

# Add Fields to Custom Field List
Expand Down
4 changes: 2 additions & 2 deletions invain/History.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def remove_ticker(self, ticker):
except ValueError as err:
print(err.args,"\n Non-Fatal Error")

def get_ticker(self):
def get_tickers(self):
return self.ticker

#Returns list of datetimes instead of unix timestamps
Expand Down Expand Up @@ -163,7 +163,7 @@ def get_open(self, ticker=None):
#Check if ticker is provided; if ticker is provided and is a list of tickers, return data for those tickers, otherwise return data for that ticker, or if no ticker is provided return data for all tickers
return {key : self.hist_data[key]['Open'] for key in self.hist_data} if ticker is None else {key : self.hist_data[key]['Open'] for key in ticker} if is_sequence(ticker) else {ticker : self.hist_data[ticker]['Open']}

def get_highs(self, ticker=None):
def get_high(self, ticker=None):
#Check if ticker is provided; if ticker is provided and is a list of tickers, return data for those tickers, otherwise return data for that ticker, or if no ticker is provided return data for all tickers
return {key : self.hist_data[key]['High'] for key in self.hist_data} if ticker is None else {key : self.hist_data[key]['High'] for key in ticker} if is_sequence(ticker) else {ticker : self.hist_data[ticker]['High']}

Expand Down

0 comments on commit 952abe2

Please sign in to comment.