Oanda REST-v20 API wrapper
OVERVIEW
OANDAPY is a python3 wrapper for Oanda’s REST API v20. This library currently implements the features released under version 3.0.1 of OANDA’s REST API.
Head over to OANDA’s REST API v20 docs to go through their documentation. This repository start on fork from Gustavo Ferreira and have a massive change later
Requirements
This project requires:
Python 3.4 or earlier
git client
virtualenvwrapper/virtualenv for local development
Installation
$ pip install oandapy
Or, you can download the source and
$ git clone git@github.com:rhenter/oandapy.git
$ cd oandapy
$ python setup.py install
USAGE
Create a account on https://www.oanda.com to get a API Access Token.
Import the oandapy module and create an instance with your access token:
>> from oandapy import APIv20
>> from oandapy.exceptions import OandaError
>>
>> access_token = "<OANDA Access token>"
>> oanda = APIv20(environment="practice", access_token=access_token)
>> try:
>> result = con.account.get_accounts()
>> # In case of http status 400
>> except OandaError as exc:
>> print(str(exc))
>>
>> # Use the result as object
>> print(result.as_obj())
MyModel(accounts=[NamelessModel(tags=[], id='000-000-0000000-000')])
>>
>> # Use the result as dict
>> print(result.as_dict())
{'accounts': [{'id': '000-000-0000000-000', 'tags': []}]}
Contributing
Please send pull requests, very much appreciated.
Fork the repository on GitHub.
Create a virtualenv.
Install requirements. pip install -r requirements-dev.txt
Install pre-commit. pre-commit install
Make a branch off of master and commit your changes to it.
Create a Pull Request with your contribution
NOTES
Oanda API REST-v20 is still under development, some functionality have not yet been implemented (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.
DO NOT USE THIS LIBRARY ON PRODUCTION! It is under heavy development and still lacks testing suites. It is also partially documented.
Use this library at your own risk.
Happy hunting on the markets!!
Changelog
0.0.9
Update url on setup.py
0.0.8
Update Sphinx doc
Update docstrings (its not ok yet)
0.0.7
Changes to Pypi view
0.0.6
Refactor: Move FactoryResponse to Core API and fix tests
0.0.5
Update Readme file to get simple examples
0.0.4
Change Setup data
0.0.3
Add Travis and Coveralls support
Remove Enum feature
0.0.2
Update readme fixing typos and changing the introduction
0.0.1 (2018-12-06)
initial release using changes file
Metadata
Release files for oandapy 0.0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| oandapy-0.0.9.tar.gz | 14.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| oandapy-0.0.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.3 kB
Release files / oandapy-0.0.9.tar.gz
| Download URL | oandapy-0.0.9.tar.gz |
|---|---|
| Size | 14.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7f06042254b94a799a152283704937553150ce709af0f398c6b94a0ceda5aa7c
|
|
BLAKE2b-256 checksum How to use checksums |
4b5572eb3496ff7c3af0068974aef3ce513032e78a4a23053692443c3f914ab7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0
|
Release files / oandapy-0.0.9-py3-none-any.whl
| Download URL | oandapy-0.0.9-py3-none-any.whl |
|---|---|
| Size | 17.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9260ce766c2d581ddcc9204abc3a87dfe669b7387ac396c4afdc71d3d362eca1
|
|
BLAKE2b-256 checksum How to use checksums |
78dfe7fffa029dd90f117a20d68d08f833382881a670014c64b79e7ec4bf4099
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0
|
Security for oandapy 0.0.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.