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.3.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for jc.robinhood-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15ebeffe14877c96b9b1e08ee7c300ef9539141795f24bfc98fd72e6e85f143c |
|
MD5 | ccfdc06eef4a7b1d33bc6eff7246caa9 |
|
BLAKE2b-256 | 4285ea1a2382d67d3941f6b08736532035d56770929f894e5658633cf30bb844 |