Skip to main content

A flexible and agile stock market data scraper and server.

Project description

YFrake

Supported Python versions Package version on PyPI Installs per month CodeFactor code quality Scrutinizer build inspection Issues on Github License on GitHub Stars on GitHub

Disclaimer

The current version of YFrake is usable, but not production ready.

Description

YFrake is a flexible and agile stock market data scraper and server [note1]. It enables developers to build powerful apps without having to worry about maximizing network request throughput [note2]. YFrake can be used as a client to directly return market data or as a programmatically controllable server to forward data to web clients. In addition, all network requests by YFrake are non-blocking, which means that your program can continue running your code while network requests are in progress. The best part about YFrake is its built-in swagger API documentation which you can use to perform test queries and examine the returned responses.

Getting Started

Installation

pip install yfrake

How to import

from yfrake import ThreadClient
from yfrake import AsyncClient
from yfrake import Server

ThreadClient example

client = ThreadClient()
client.get('historical_prices', symbol='msft', interval='1d', range='1y')
while client.is_busy():
    # Do other stuff
if client.is_done() and not client.response.error:
    print(client.response.data)

AsyncClient example

async def main():
    resp = await AsyncClient.get_historical_prices(symbol='msft', interval='1d', range='1y')
    if not resp.error:
        print(resp.data)
asyncio.run(main())

Server example

Server.start()  # Default address is 'localhost:8888'
# Do some other stuff
Server.stop()  # Kills all server sub-processes.

[note1]: Stock market data is sourced from Yahoo Finance.
[note2]: You still need to know how to gather coroutines when using asyncio to maximize throughput.

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

YFrake-0.1.11.tar.gz (26.8 kB view hashes)

Uploaded Source

Built Distribution

YFrake-0.1.11-py3-none-any.whl (80.5 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