Skip to main content

This library is a wrapper around the finance libraries in order to give out a data model different from raw pandas and be usable in production services

Project description

stock_utilities

This repo will manage utilities for stock data and stock option The idea is to fetch data from multiple sources and use them from a single point and have a library that is typesafe

The used provider are:

  • YFinance

Example

import datetime
import praw
import stock_utilities

data = stock_utilities.stock_data.StockData(
    "GME", stock_utilities.proxy.YFinanceProvider
)
print(data.get_last_price())
data = stock_utilities.stock_data.StockData(
    "GME", stock_utilities.proxy.YFinanceProvider
)
history = data.get_stock_price_history(
    interval=datetime.timedelta(days=1), period=datetime.timedelta(days=5)
)
assert len(history), 5

history_option = data.get_next_friday_option_chain()
print(history_option.calls[-1])
print(
    history_option.calls[-1].delta(),
    history_option.calls[-1].gamma(),
    history_option.calls[-1].vega(),
)


combined_providers = stock_utilities.proxy.combine_providers(
    [stock_utilities.proxy.YFinanceProvider, stock_utilities.proxy.RedditFetcher]
)

reddit = praw.Reddit(
   client_id="XXX",
   client_secret="XXX",
   user_agent="XXX",
)
new_client = stock_utilities.stock_data.StockData(
   "GME", combined_providers, reddit_client=reddit
)

print(new_client.get_reddit_threads(["wallstreetbets"]))

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

stock_utilities-0.1.4.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stock_utilities-0.1.4-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file stock_utilities-0.1.4.tar.gz.

File metadata

  • Download URL: stock_utilities-0.1.4.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.7.5 Linux/5.4.0-70-generic

File hashes

Hashes for stock_utilities-0.1.4.tar.gz
Algorithm Hash digest
SHA256 1dd0bc9db532aa43c7b2d89588421f43ce3d5bdc549fbd4cae06a126006d9071
MD5 b1b73fb36d5784e3317575d7fb64d4b2
BLAKE2b-256 7b668d1e617bb8c6162a9268d7b4dca8909416d586f9dcf15e2e9f671c5ad08f

See more details on using hashes here.

File details

Details for the file stock_utilities-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: stock_utilities-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.7.5 Linux/5.4.0-70-generic

File hashes

Hashes for stock_utilities-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c5830e8e140b1c931e32052f5fcee9d3acf2784bc2ade729d1982d80a5a79c3b
MD5 cd61e5a54f017292a4bab8eaaa0c4aee
BLAKE2b-256 802458ad947a0425a8ba9038d494aa42905040d776c6d3266f1e52ba57d06f17

See more details on using hashes here.

Supported by

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