Skip to main content

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"]))

Metadata

Release files for stock-utilities 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stock-utilities 0.1.9
File Size Uploaded
stock_utilities-0.1.9.tar.gz 6.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for stock-utilities 0.1.9
File Interpreter ABI Platform
stock_utilities-0.1.9-py3-none-any.whl Python 3 none any Details

Total release size: 12.7 kB

Release files / stock_utilities-0.1.9.tar.gz

Download URL stock_utilities-0.1.9.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
659deae424c5c55c975087de5cc90279b004fc956aa05b26586c65193577ad72
BLAKE2b-256 checksum
How to use checksums
ff2874fc39e7039bb16dd8b4bf04664a057e262bef7d7c1b6b03d99e53d81e32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.10 CPython/3.7.5 Linux/5.4.0-70-generic

Release files / stock_utilities-0.1.9-py3-none-any.whl

Download URL stock_utilities-0.1.9-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4c3b73a07db90a9eb641f3d670dd419493a25609a2f4b37acc17079c4c5b0183
BLAKE2b-256 checksum
How to use checksums
df9225f85fb4985e3f088c190fa42c0a772b01032924b5cc52b45390474125e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.10 CPython/3.7.5 Linux/5.4.0-70-generic

Release history Release notifications | RSS feed

This release

0.1.9 This release

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page