Skip to content

Commit

Permalink
Merge db9ff43 into 3c22c08
Browse files Browse the repository at this point in the history
  • Loading branch information
rhenter committed Dec 6, 2018
2 parents 3c22c08 + db9ff43 commit c493c6f
Show file tree
Hide file tree
Showing 17 changed files with 523 additions and 166 deletions.
82 changes: 79 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,79 @@
*.pyc
.ropeproject
_build/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/
docs/build/

# PyBuilder
target/

#Ipython Notebook
.ipynb_checkpoints

# environment
.env
.venv

*.iml
.idea
.vscode
node_modules
target
*.log
*.swp
*.sqlite3
releases
.cache
.idea/
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
repos:
- repo: git@github.com:pre-commit/pre-commit-hooks
rev: v2.0.0
hooks:
- id: debug-statements
- id: trailing-whitespace
- id: check-merge-conflict
- id: check-executables-have-shebangs
- id: check-ast
- id: check-byte-order-marker
- id: check-json
- id: check-symlinks
- id: check-vcs-permalinks
- id: check-xml
- id: detect-aws-credentials
args: ['--allow-missing-credentials']
- id: detect-private-key
- id: forbid-new-submodules
- id: flake8
args: ['--exclude=docs/*,*migrations*', '--ignore=E501']
7 changes: 7 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Changelog
---------

0.0.1 (2018-12-06)
------------------

* initial release using changes file
File renamed without changes.
51 changes: 36 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,38 @@
# vim:ft=make
#
.PHONY: all init test coverage find_todo find_fixme count clean generate_docs
clean: clean-eggs clean-build
@find . -iname '*.pyc' -delete
@find . -iname '*.pyo' -delete
@find . -iname '*~' -delete
@find . -iname '*.swp' -delete
@find . -iname '*ropeproject' -delete
@find . -iname '__pycache__' -delete

all: test
clean-eggs:
@find . -name '*.egg' -print0|xargs -0 rm -rf --
@rm -rf .eggs/

init:
pip install -r requirements.txt
clean-build:
@rm -fr build/
@rm -fr dist/
@rm -fr *.egg-info

test:
nosetests
lint:
pre-commit run -av

pip-install:
pip install -r requirements-dev.txt

pip-upgrade:
pip install --upgrade -r requirements-dev.txt

coverage:
# @python3 -m nose --with-coverage --cover-erase --cover-package=oandapy tests.test_oanda || true
coverage run --source=oandapy make test

cov-report:
py.test -vv --cov-report=html tests

test: pip-install
py.test -vv -s

find_todo:
@grep --color=always -PnRe "(#|\"|\').*TODO" oandapy || true

Expand All @@ -23,12 +42,14 @@ find_fixme:
count:
@find . -type f \( -name "*.py" -o -name "*.rst" \) | xargs wc -l

clean:
rm -f .coverage
rm -rf oandapy.egg-info
find . -type f -name '*.pyc' -delete
find . -type d -name '__pycache__' | xargs rm -rf
find . -type d -name '*.ropeproject' | xargs rm -rf
build: test
python setup.py sdist
python setup.py bdist_wheel

release: build
git tag `python setup.py -q version`
git push origin `python setup.py -q version`
twine upload dist/*

generate_docs:
@sphinx-apidoc -f -o doc/oandapy oandapy
78 changes: 0 additions & 78 deletions README.md

This file was deleted.

96 changes: 96 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
Oanda REST-v20 API wrapper
==========================

|PyPI latest| |PyPI Version| |Coverage Status| |Travis Build Status| |Code Health| |PyPI License|

NOTE`: DO NOT USE THIS LIBRARY ON PRODUCTION!
It is under heavy development and still lacks testing suites. It is also partially documented.


OVERVIEW
--------

`OANDAPY <https://github.com/gustavooferreira/oandapy>`_ is a python3 wrapper for Oanda's REST API v20.
This library currently implements the features released under `version 3.0.1 <http://developer.oanda.com/rest-live-v20/release-notes/>`_ of OANDA's REST API.

Head over to `OANDA's REST API v20 docs <http://developer.oanda.com/rest-live-v20/introduction>`_ to go through their documentation.

Requirements
------------

This project requires:

* Python 3.4 or earlier
* git client
* virtualenvwrapper/virtualenv for local development


Installation
------------

Right now, this library has not yet been pushed to pypi, so as of now you can't use pip to install it. (But will be soon in pypi)

.. code-block:: bash
$ git clone git@github.com:gustavooferreira/oandapy.git
$ cd oandapy
$ python setup.py install
USAGE
-----

1. Create a account on `<https://www.oanda.com>`_ to get a API Access Token.
2. Import the oandapy module and create an instance with your access token:

.. code-block:: python
from oandapy import APIv20
from oandapy.exceptions import OandaError
access_token = ""
con = APIv20(environment="practice", access_token=access_token)
try:
result = con.account.get_accounts()
for acc in result.accounts:
print(acc.aid)
except oanda.OandaError as exc:
print(str(exc))
Contributing
------------

Please send pull requests, very much appreciated.


1. Fork the `repository <https://github.com/gustavooferreira/oandapy>`_ on GitHub.
2. Create a virtualenv.
3. Install requirements. ``pip install -r requirements-dev.txt``
4. Install pre-commit. ``pre-commit install``
5. Make a branch off of master and commit your changes to it.
6. Create a Pull Request with your contribution


NOTES
-----

* Oanda API REST-v20 is still under development, some functionality have not yet been implemented (Streaming, Pricing History, Forex Labs), but I will keep an eye on it, and as soon as it gets implemented I will update this library accordingly.
* Use this library at your own risk.
* Happy hunting on the markets!!


.. |Travis Build Status| image:: https://travis-ci.org/gustavooferreira/oandapy.svg?branch=master
:target: https://travis-ci.org/gustavooferreira/oandapy.svg?branch=master
.. |Coverage Status| image:: https://coveralls.io/repos/github/gustavooferreira/oandapy/badge.svg?branch=master
:target: https://coveralls.io/github/gustavooferreira/oandapy?branch=master
.. |Code Health| image:: https://landscape.io/github/gustavooferreira/oandapy/master/landscape.svg?style=flat
:target: https://landscape.io/github/gustavooferreira/oandapy/master
.. |PyPI Version| image:: https://img.shields.io/pypi/pyversions/oandapy.svg?maxAge=2592000
:target: https://pypi.python.org/pypi/oandapy
.. |PyPI License| image:: https://img.shields.io/pypi/l/oandapy.svg?maxAge=2592000
:target: https://github.com/gustavooferreira/oandapy/blob/master/LICENCE
.. |PyPI latest| image:: https://img.shields.io/pypi/v/oandapy.svg?maxAge=360
:target: https://pypi.python.org/pypi/oandapy
File renamed without changes.
17 changes: 0 additions & 17 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,23 +245,6 @@

# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
Expand Down
4 changes: 4 additions & 0 deletions oandapy/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .oanda import APIv20 # noqa
from .version import __version__ # noqa

__all__ = ['APIv20', '__version__']

0 comments on commit c493c6f

Please sign in to comment.