Skip to content

Commit

Permalink
added readthedocs
Browse files Browse the repository at this point in the history
  • Loading branch information
mmohades committed Feb 20, 2020
1 parent 13448e1 commit cd87b36
Show file tree
Hide file tree
Showing 5 changed files with 188 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ instance/

# Sphinx documentation
docs/_build/
docs/_static
docs/_templates

# PyBuilder
target/
Expand Down Expand Up @@ -212,4 +214,4 @@ ENV/
# mkdocs documentation
/site

# End of https://www.gitignore.io/api/macos,linux,django,python,pycharm
# End of https://www.gitignore.io/api/macos,linux,django,python,pycharm
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
56 changes: 56 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- Project information -----------------------------------------------------

project = 'Venmo'
copyright = '2020, Mark Mohades'
author = 'Mark Mohades'

# The full version, including alpha/beta/rc tags
release = '0.1.0'


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
master_doc = 'index'
74 changes: 74 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
.. Venmo documentation master file
Venmo API
=================================


Introduction
------------

This is a wrapper for the Venmo API. This library provides a Python interface for the Venmo API. It's compatible with Python versions 3.6+.

Usage
-----

In short, you can send money, request for money, get a user's public transactions, get a user's public profile info, etc. The following is an example of initializing and working with it.

.. code-block:: python
from Venmo import VenmoApi
# Get your access token. You will need to complete the 2FA process
access_token = VenmoApi.get_access_token(username='myemail@random.com',
password='your password')
venmo_api = VenmoApi(access_token=access_token)
# Search for users. You get 50 results per page.
users = venmo.user.search_for_users(query="Peter",
page=2)
for user in users:
print(user.username)
# Or, you can pass a callback to make it multi-threaded
def callback(users):
for user in users:
print(user.username)
venmo.user.search_for_users(query="peter",
callback=callback,
page=2,
count=10)
Getting a user's public transactions

.. code-block:: python
def callback(transactions_list):
for transaction in transactions_list:
print(transaction)
# callback is optional
venmo_api.user.get_user_transactions(user_id='0000000000000',
callback=callback)
Getting Started
---------------

Installation
^^^^^^^^^^^^

Documentation
^^^^^^^^^^^^^

Contributing
------------

Contributions of all sizes are welcome. You can also help by `reporting bugs <https://github.com/mmohades/VenmoApi/issues/new>`_.

Venmo Unofficial API Documentation
----------------------------------

You can find and contribute to the `Venmo Unofficial API Documentation <https://github.com/mmohades/VenmoApiDocumentation>`_.


.. toctree::
:maxdepth: 2
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd

0 comments on commit cd87b36

Please sign in to comment.