Skip to main content

A tiny python API wrapper for onvista.de financial website.

Project description

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())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyonvista-0.8.3.tar.gz (6.3 kB view hashes)

Uploaded Source

Built Distribution

pyonvista-0.8.3-py3-none-any.whl (6.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page