Giter Club home page Giter Club logo

pyonvista's Introduction

pyonvista

A tiny python wrapper to the non-public onvista.de REST-Api.

As the API is not public user shall assume that the usage of this package harms the website user agreements. However, this version now avoids any web scrapping for metadata.

You can search for an instrument and get its quote data. The quote data can be limit by resolution and date.

The wrapper now also works with instruments other than stocks. Also for example data from ETF can be requested.

Im not planing to add other API Endpoints at the moment as long as nobody gives me a good reason for this.

Additionally the wrapper now is asynchronous. User should be aware of asyncio or async programming.

Installation

pip install pyonvista

Usage

import asyncio
import aiohttp
import pprint

from pyonvista import PyOnVista

async def main():
    client = aiohttp.ClientSession()
    api = PyOnVista()
    await api.install_client(client)
    async with client:
        instruments = await api.search_instrument("VW")
        instrument = await api.request_instrument(instruments[0])
        quotes = await api.request_quotes(instrument, )
        pprint.pprint(instrument)
        pprint.pprint(quotes[:3])
        # prints a lot of information of VW Stonk
        # try a etf
        instruments = await api.search_instrument(key="IE00B42NKQ00")
        quotes = await api.request_quotes(instruments[0])
    pprint.pprint(quotes[0].instrument)

    await client.close()
    await asyncio.sleep(.1)

if __name__ == '__main__':
    asyncio.run(main())

pyonvista's People

Contributors

cloasdata 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.