GithubHelp home page GithubHelp logo

darwinex / darwinexapis Goto Github PK

View Code? Open in Web Editor NEW
23.0 10.0 11.0 2.73 MB

Python package that enables access to the entire Darwinex Data Offering (DARWIN, FX, Stock, Commodity, Index and Cryptocurrency assets) from one Wrapper Library.

Home Page: https://pypi.org/project/darwinexapis/

License: BSD 3-Clause "New" or "Revised" License

Python 99.84% Shell 0.16%
darwinex darwinex-api algorithmic-trading quant-trading data-science quant-modelling quant-research

darwinexapis's People

Contributors

darwinex avatar eriz11 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

darwinexapis's Issues

Problem with 'end' and 'flush' kwargs on logger commands

Traceback (most recent call last): File "/opt/anaconda3/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3331, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "<ipython-input-4-cd477610cd18>", line 1, in <module> _p = darwinexInfo._Get_Historical_Quotes_(_symbols=['PLF', 'THA']) File "/opt/anaconda3/lib/python3.7/site-packages/darwinexapis/API/InfoAPI/DWX_Info_API.py", line 59, in _Get_Historical_Quotes_ end='', flush=True) File "/opt/anaconda3/lib/python3.7/logging/__init__.py", line 1390, in warning self._log(WARNING, msg, args, **kwargs) TypeError: _log() got an unexpected keyword argument 'end'

Problem with API example darwinexapis/darwinexapis/EXAMPLE_SCRIPTS/DarwinAPIClassesExample.py

Hi,
I am experimenting with your API package for Python and using your exemple script DarwinAPIClassesExample.py.

I have activated the following code in the example:

Let's create the access token variable:
AUTH_CREDS = {'access_token': 'fe1e00f4-bdf6-313d-915b-3ac4eea325d1',
'consumer_key': 'IR5UvEGyEMK8combIVBLbcof_WMa',
'consumer_secret': 'WKcuZy981a14pmvyj1cPTK6cjo4a',
'refresh_token': '1e109063-4a36-3565-86d6-d9d46c2e7467',}

darwinexInfo = DWX_Info_API(AUTH_CREDS, _version=2.0, _demo=True)

DWX_Info_API:
darwinUniverse = darwinexInfo.Get_DARWIN_Universe(_status='ACTIVE', _iterate=True, _perPage=50)
pprint.pprint(darwinUniverse)
darwinUniverse.to_csv('/Users/Dan/darwin-api-tutorials-master/PYTHON/NOTEBOOKS/12_quant_workflow_algo_trading_darwin_api/darwinUniverse.csv')

When I run the code, I receive the following message:

[INIT] - Creating AUTH creds...
[INIT] - Access token will be created again at 1599829976.2918148 UNIX timestamp
[INIT] - Creating AUTH creds...
[INIT] - Access token will be created again at 1599829976.292811 UNIX timestamp
[DarwinInfoAPI] Getting first 50 DARWINs..

[DECORATOR] - The expiration time has NOT reached yet > Continue...
**** FULL URL ENDPOINT ****: https://api.darwinex.com/darwininfo/2.0/products?status=ACTIVE&page=0&per_page=50
<Response [403]>
{"fault":{"code":900908,"message":"Resource forbidden ","description":"Access failure for API: /darwininfo/2.0, version: 2.0 status: (900908) - Resource forbidden "}}

It appears that I need "Authorization: Bearer ACCESS_TOKEN", but I do not know how to do that.
I have provided the authorization tokens above that is newly created on https://www.darwinex.com/data/darwin-api.

I would very much appreciate your assistance.

Problem with InfoAPI from example file 'DarwinAPIClassesExample.py'

Good morning, I'm trying the example downloaded from https://github.com/darwinex/darwinexapis/tree/master/darwinexapis/EXAMPLE_SCRIPTS, named 'DarwinAPIClassesExample.py'.
I'm facing the following problem:
**[INIT] - Creating AUTH creds...
[INIT] - Access token will be created again at 1642757397.0541043 UNIX timestamp
[DarwinInfoAPI] Getting first 50 DARWINs..
[DECORATOR] - The expiration time has NOT reached yet > Continue...
**** FULL URL ENDPOINT **: https://api.darwinex.com/darwininfo/2.0/products?status=ACTIVE&page=0&per_page=50
<Response [403]>
{"fault":{"code":900908,"message":"Resource forbidden ","description":"Access failure for API: /darwininfo/2.0, version: 2.0 status: (900908) - Resource forbidden "}}

In particular, I'm trying this slice of code:
darwinUniverse = darwinexInfo.Get_DARWIN_Universe(_status='ACTIVE', _iterate=True, _perPage=50)
pprint.pprint(darwinUniverse)

I have provided the authorization tokens newly created from https://www.darwinex.com/data/darwin-api, but the problem remains.
AUTH_CREDS = {'access_token': 'a5d75de1-7212-3427-a29a-2f38be8cd8e0',
'consumer_key': 'GgkHUcgExTgcJ_rAlpar2Ziki9Ia',
'consumer_secret': 'XJvbUKZWLsTruqxSPxRdfsmQSF8a',
'refresh_token': '6aa3cd7c-b3de-3819-93b5-3f47f428e1f6'}

Could you please help me?
Thank you for the continuous support and regards,
Manuel Girlanda.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.