Unofficial Robinhood API client library for Python
Project description
robinhood
Unofficial Robinhood API client library for Python
Installation
pipenv install jc.robinhood
Usage
import json
import robinhood as rh
CONFIG_FILENAME = 'config.json'
with open(CONFIG_FILENAME) as f:
config = json.load(f)
device_token = config['robinhood']['device_token']
username = config['robinhood']['username']
password = config['robinhood']['password']
if device_token == '':
device_token = rh.generate_device_token()
print()
robinhood = rh.Robinhood(device_token, username, password)
config['robinhood']['device_token'] = device_token
with open(CONFIG_FILENAME, 'w') as f:
json.dump(config, f, indent='\t')
f.write('\n')
else:
robinhood = rh.Robinhood(device_token, username, password)
print()
print('Positions:')
print()
for position in robinhood.get_positions():
print(f"{position['symbol']} ({position['quantity']})")
print()
Contributing
You will need Pipenv. On Mac, you can install Pipenv using Homebrew. To install Homebrew, run
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Then, to install Pipenv, run
brew install pipenv
To install dependencies, move into the project folder and run
pipenv install
To run tests, fill out the config.json
file with your Robinhood
username
and password
and then run
pipenv run test
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
jc.robinhood-1.0.2.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for jc.robinhood-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f79bed8c497a26c44d629fe117026d009a12af93e2c6873e8171878d7ea78981 |
|
MD5 | ada148240e7bef05244c719092dd79e4 |
|
BLAKE2b-256 | 6199885d048522c042e374d9e682fc877eda9153b89a9079ea5d7bd5c6479e67 |