Coder Social home page Coder Social logo

carterlavigne2722 / allyinvest.py Goto Github PK

View Code? Open in Web Editor NEW

This project forked from anthonymorast/allyinvest.py

0.0 0.0 0.0 411 KB

A blackbox Ally Invest/TradeKing API Python interface for application developers.

License: MIT License

Python 100.00%

allyinvest.py's Introduction

AllyInvest.py

A blackbox Ally Invest/TradeKing API interface for application developers.

AllyInvest.py is a part of the PyPi repository and can be installed via

  pip install AllyInvestPy

AllyAPI.py A Python3 class that allows access to all of the functionality in the Ally/TradeKing API.

This package attempts to stay on top of changes to the API and allow an easy to user interface with the Ally Invest API. The API does no formatting for the user. A response format of 'xml' or 'json' can be specified and the API responses will be returned as the raw XML or JSON, respectively.

This API was built with the developer in mind and should allow a developer to build applications around the Ally Invest API without having to deal with accessing and managing the requests and responses.

Documentation

Doxygen was used to generate documentation for this interface. The generated documentation can be found here.

Perhaps the most useful documentation is of the AllyAPI class as this documentation shows which functionality is available and describes how to use each function.

Usage

Details coming soon. Some basic usage can be found in example.py until then.

TODO

  • Documentation
    • URLs.py and examples.py
  • Implement missing functionality
    • Right now, the API implements many of the calls listed on Ally's documentation page but there are many not yet implemented (due to time constraints). Below is a list.
    • Adding the functionality is pretty straight forward, some more details are below.
  • Test
    • Everything
    • Add unit tests

Adding New API Functionality

To add a new API function the API URL has to be added to the URLs class in URLs.py. Note that the request endpoint is already stored in the class e.g.

https://api.tradeking.com/v1/

Therefore, only anything after /v1/ needs to be added as a URL. A method to obtain the full URL must be implemented as well, examples abound in the URLs class.

After the URL is added, implementing the POST or GET is very simple. There are two private methods in the AllyAPI class that allow easily retrieving data provided only the URL. these are __get_data(self, url) and __to_format(self, response).

To add the new functionality, just create a method call in the AllyAPI class that uses your new URL and returns/calls the __get_date(...) method. This will return the raw XML or JSON response from the user depending on the format set up when creating the AllyAPI class instance.

Missing Functionality

  • ORDER/TRADE
    • GET accounts/:id/orders
    • POST accounts/:id/orders
    • POST accounts/:id/orders/preview
  • MARKET
    • GET market/options/search
    • GET market/options/strikes
    • GET market/options/expirations
    • GET market/timesales
  • WATCHLIST
    • GET watchlists
    • POST watchlists
    • GET watchlists/:id
    • DELETE watchlists/:id
    • POST watchlists/:id/symbols
    • DELETE watchlists/:id/symbols
  • STREAMING OPERATIONS
    • MARKET
      • GET market/quotes

allyinvest.py's People

Contributors

anthonymorast avatar

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.