Skip to main content

finpy

Financial Python

To install

Requirement: Python 3

pip install finpy

You can also download the window install package if you're using windows. Introduction

I plan to expand the capabilities. Please let me know if you have any suggestions. You can reach me at blacksburg98 (at) yahoo dot com

I've tried to use docstring as much as possible, so you can try these commands in python shell to get more information.

:: from finpy.utils import get_tickdata from finpy.equity import Equity help(Equity) from finpy.portfolio import Portfolio help(Portfolio)

Please go to https://github.com/blacksburg98/finpy to file a issue if you have any problems.

Recommend: This will be the area where the downloaded stock data are stored.

setenv FINPYDATA ~/stock_data

Tutorial 1

::

"""
Tutorial 1 
Load stock data and print 
"""
import matplotlib
matplotlib.use('Agg') # fix for matplotlib under multiprocessing
import matplotlib.pyplot as plt
import matplotlib.dates as mdates 
import datetime as dt
from finpy.utils import get_tickdata

import finpy.fpdateutil as du
if __name__ == '__main__':
    dt_timeofday = dt.timedelta(hours=16)
    dt_start = dt.datetime(2010, 1, 1)
    dt_end = dt.datetime(2010, 12, 31)
    ls_symbols = ['AAPL','GOOG', 'IBM', 'MSFT']
    ldt_timestamps = du.getNYSEdays(dt_start, dt_end, dt_timeofday)
    all_stocks = get_tickdata(ls_symbols=ls_symbols, ldt_timestamps=ldt_timestamps)
    fig = plt.figure()
    ax = fig.add_subplot(111)
    for tick in ls_symbols:
        ax.plot(ldt_timestamps, all_stocks[tick].normalized())
    legend = ls_symbols
    ax.legend(legend, loc=2)
    fig.autofmt_xdate()
    svg_file = 'tutorial1.pdf'
    fig.savefig(svg_file)

Release files for FinPy 0.61

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

Source distribution (sdist)

Source distribution for FinPy 0.61
File Size Uploaded
FinPy-0.61.tar.gz 71.5 kB Details

Release files / FinPy-0.61.tar.gz

Download URL FinPy-0.61.tar.gz
Size 71.5 kB
Tags Source
SHA-256 checksum
How to use checksums
388172dae02c069ac308887cf360915e6b82c8d4a61145e02599b1ca91b1aa6a
BLAKE2b-256 checksum
How to use checksums
f2bd29d2a4461fd69c0f65fc50fc0a3ccee493e8a0255acb10bc92a97c34cfd4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.9

Release history Release notifications | RSS feed

This release

0.61 This release

1 release file

0.6

1 release file

0.5

3 release files

0.4.6

3 release files

0.4.5

3 release files

0.4.4

3 release files

0.4.2

3 release files

0.4.1

0.4.0

0.3.3

2 release files

0.3.2

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.1.0

3 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