Skip to content

Commit 49e61c3

Browse files
committed
Add docs and towncrier.
* Add sphinx and some other deps to make sphinx work better * Update ci pipeline name to build * Update gitignore to better ignore mypy
1 parent 10b3777 commit 49e61c3

19 files changed

+938
-159
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: ci
1+
name: build
22

33
on:
44
pull_request:

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,4 @@ target/
6969
.idea/
7070
.python-version
7171
.DS_Store
72-
.mypy_cache/*
72+
*.mypy_cache/*

README.md

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

README.rst

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
.. image:: https://i.imgur.com/74CYw5g.png
2+
:target: https://github.com/robinhood-unofficial/Robinhood
3+
:alt: robinhood-logo
4+
5+
-------------------------------------------------------------
6+
7+
pyrh - Unofficial Robinhood API
8+
###############################
9+
10+
.. image:: https://github.com/robinhood-unofficial/Robinhood/workflows/build/badge.svg?branch=master
11+
:target: https://github.com/robinhood-unofficial/Robinhood/workflows/build/
12+
:alt: build
13+
14+
.. image:: https://img.shields.io/gitter/room/J-Robinhood/Lobby
15+
:target: https://gitter.im/J-Robinhood/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
16+
:alt: Gitter
17+
18+
.. image:: https://img.shields.io/github/license/robinhood-unofficial/Robinhood
19+
:target: https://github.com/robinhood-unofficial/Robinhood/blob/master/LICENSE
20+
:alt: GitHub
21+
22+
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
23+
:target: https://github.com/psf/black
24+
:alt: Code style: black
25+
26+
Python Framework to make trades with Unofficial Robinhood API. Supports Python 3.6+
27+
28+
Quickstart
29+
**********
30+
31+
.. code-block:: python
32+
33+
from pyrh import Robinhood
34+
35+
rh = Robinhood()
36+
rh.login(username="YOUR_EMAIL", password="YOUR_PASSWORD")
37+
rh.print_quote("AAPL")
38+
39+
How To Install:
40+
***************
41+
42+
.. code-block::
43+
44+
pip install pyrh
45+
46+
Current Features
47+
****************
48+
49+
* Placing buy orders (\ ``Robinhood.place_buy_order``\ )
50+
* Placing sell order (\ ``Robinhood.place_sell_order``\ )
51+
* Fetch and cancel orders (\ ``Robinhood.order_history`` and ``Robinhood.cancel_order``\ )
52+
* Quote information (\ ``Robinhood.quote_data``\ )
53+
* User portfolio data (\ ``Robinhood.portfolios``\ )
54+
* User positions data (\ ``Robinhood.positions``\ )
55+
* More coming soon
56+
57+
Running example.ipynb_
58+
**********************
59+
60+
.. _example.ipynb: https://github.com/robinhood-unofficial/Robinhood/blob/master/notebooks/example.ipynb
61+
62+
* Install jupyter
63+
.. code-block::
64+
65+
$ python --version # python 3.3+ for venv functionality
66+
Python 3.7.6
67+
$ python -m venv pyrh_env
68+
$ source pyrh_env/bin/activate
69+
(pyrh_env) $ pip install pyrh
70+
(pyrh_env) $ pip install jupyter
71+
(pyrh_env) $ jupyter notebook
72+
73+
Then navigate to the example file linked above and run it.
74+
75+
Data returned
76+
*************
77+
* Quote data
78+
79+
* Ask Price
80+
* Ask Size
81+
* Bid Price
82+
* Bid Size
83+
* Last trade price
84+
* Previous close
85+
* Previous close date
86+
* Adjusted previous close
87+
* Trading halted
88+
* Updated at
89+
* Historical Price
90+
91+
* User portfolio data
92+
93+
* Adjusted equity previous close
94+
* Equity
95+
* Equity previous close
96+
* Excess margin
97+
* Extended hours equity
98+
* Extended hours market value
99+
* Last core equity
100+
* Last core market value
101+
* Market value
102+
* Order history
103+
* Dividend history
104+
105+
* User positions data
106+
107+
* Securities owned
108+
109+
* News
110+
111+
Related
112+
*******
113+
114+
* `robinhood-ruby <https://github.com/rememberlenny/robinhood-ruby>`_ - RubyGem for interacting with Robinhood API
115+
* `robinhood-node <https://github.com/aurbano/robinhood-node>`_ - NodeJS module to make trades with Robinhood Private API
116+
* See the original `blog post <https://medium.com/@rohanpai25/reversing-robinhood-free-accessible-automated-stock-trading-f40fba1e7d8b>`_.

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/changelog.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.. _changelog:
2+
3+
Changelog
4+
#########
5+
6+
.. towncrier release notes start
7+
8+
pyrh 2.0 (2020-03-18)
9+
=====================
10+
- Fixed 2fa connection issues
11+
- Last version to support python 2
12+
13+
pyrh 1.0.1 (2017-11-07)
14+
=======================
15+
- Added custom exception

docs/conf.py

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
import sys
14+
from pathlib import Path
15+
16+
17+
# curr_file = Path(__file__).parent
18+
# sys.path.append(curr_file.joinpath("..").resolve())
19+
# sys.path.append(curr_file.joinpath("../..").resolve())
20+
21+
22+
def get_version():
23+
import toml
24+
25+
toml_path = Path(__file__).parent.joinpath("..", "pyproject.toml")
26+
27+
with open(toml_path, "r") as file:
28+
pyproject = toml.load(file)
29+
30+
return pyproject["tool"]["poetry"]["version"]
31+
32+
33+
# -- Project information -----------------------------------------------------
34+
35+
project = "pyrh"
36+
copyright = "2020, Unofficial Robinhood Python API"
37+
author = "Unofficial Robinhood Python API"
38+
39+
# The full version, including alpha/beta/rc tags
40+
release = get_version()
41+
42+
43+
# -- General configuration ---------------------------------------------------
44+
45+
# Add any Sphinx extension module names here, as strings. They can be
46+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
47+
# ones.
48+
extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon", "sphinx.ext.intersphinx"]
49+
50+
# Add any paths that contain templates here, relative to this directory.
51+
templates_path = ["_templates"]
52+
53+
# List of patterns, relative to source directory, that match files and
54+
# directories to ignore when looking for source files.
55+
# This pattern also affects html_static_path and html_extra_path.
56+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
57+
58+
59+
# -- Options for HTML output -------------------------------------------------
60+
61+
# The theme to use for HTML and HTML Help pages. See the documentation for
62+
# a list of builtin themes.
63+
#
64+
html_theme = "sphinx_rtd_theme"
65+
66+
# Add any paths that contain custom static files (such as style sheets) here,
67+
# relative to this directory. They are copied after the builtin static files,
68+
# so a file named "default.css" will overwrite the builtin "default.css".
69+
html_static_path = ["_static"]
70+
71+
# source_suffix = '.rst'
72+
source_suffix = [".rst"]
73+
74+
# intersphinx
75+
intersphinx_mapping = {
76+
"requests": ("https://requests.readthedocs.io/en/master/", None),
77+
}

0 commit comments

Comments
 (0)