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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jc.robinhood-2.0.0.tar.gz.
File metadata
- Download URL: jc.robinhood-2.0.0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6c7c72b66460d4f79e081aec151aefcee772a3c61ec7e353866fadec0db9fc7
|
|
| MD5 |
0e8e5e6d140f4ca353c12a6e6b31fbaf
|
|
| BLAKE2b-256 |
a953b0fa8002a24aaf9d51fc061fa969ed95f5a46f85d005eb62024c54bdd5f0
|
File details
Details for the file jc.robinhood-2.0.0-py3-none-any.whl.
File metadata
- Download URL: jc.robinhood-2.0.0-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6642d8bd6cf8efe452f8af7237893c84d2a8c356776cc809767d7aaecdd3db65
|
|
| MD5 |
bb36a450ed4e16190e52dcd033aba1f5
|
|
| BLAKE2b-256 |
67f7d0d11b9d61a6afa1c5717093022d665eb82d9277674c3ebddfee77c6b1f2
|