Skip to main content

FinGraph

A simple abstraction layer on top of Matplotlib that allows for easily displaying financial graphics.

Please read this README on GitHub to ensure the SVGs display correctly.

Installation

python -m pip install FinGraph

Examples

See Example.ipynb.

GME and AMC returns

Code

startEnd = ('2021-01-01', '2021-06-09', '1d')

GME = Stock("GME", *startEnd).returns()
AMC = Stock("AMC", *startEnd).returns()

FinPlot(
    title = "Return Profiles of GameStop and AMC",
    headingFont = "Public Sans",
    xlabel = "Date",
    ylabel = "Return",
    offset = (24,-12),
).multiplot(
    (GME, "GME", "black"),
    (AMC, "AMC", "red", (0,2)),
).save()

Saved at FinGraphData/Return Profiles of GameStop and AMC.svg

Profit Margins of Remote Work Firms

Code

COLORS = {
    'UBER': '#000000',
    'FVRR': '#1DBF73',
    'LYFT': '#EA0B8C',
    'UPWK': '#37A000'
}

UPWK = (0.131, 3.0e8, -1.6659e7)
FVRR = (0.261, 1.06e8, -3.37363e7)
UBER = (0.220, 1.41e10, -8.506e9)
LYFT = (0.279, 3.62e9, -2.602e9)

# convert to %
fmt = [UPWK, FVRR, UBER, LYFT]
fmt = [(pair[0]*100, pair[1], pair[2]/pair[1]) for pair in fmt]

UPWK, FVRR, UBER, LYFT = fmt
    
FinPlot(
    "Profit Margins of Flexible Work Firms", 
    "Take Rate $T_R$", 
    "Revenue $R$",
    percentX=True,
    financialY=True,
).multiplot_point(
    (*UPWK, "Upwork", COLORS["UPWK"]),
    (*FVRR, "Fiverr", COLORS["FVRR"], (-1, 0)),
    (*UBER, "Uber", COLORS["UBER"], (0, -1)),
    (*LYFT, "Lyft", COLORS["LYFT"], (0, 1)),
    bubbleLabelTransform=lambda x: f"{round(x, 2)*100}%"
).save()

Saved at FinGraphData/Profit Margins of Flexible Work Firms.svg

Download files

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

Source Distribution

FinGraph-0.1.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

FinGraph-0.1.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file FinGraph-0.1.0.tar.gz.

File metadata

  • Download URL: FinGraph-0.1.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10

File hashes

Hashes for FinGraph-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ca9e36e32148518f60c36ed1ce90d3f87471199395e10a54f1fff6eb2636febc
MD5 375024b0ebbfc08bc95b49b750c634a2
BLAKE2b-256 1a8c0d6377802459a3f0b29fc4914f16e9d1bbd2def6a125330ec52f4d50945e

See more details on using hashes here.

File details

Details for the file FinGraph-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: FinGraph-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10

File hashes

Hashes for FinGraph-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7cd1031f0ffc28c556158fc504326c9a6db613cc8f5dbc0d46b933e4f51051d5
MD5 297f8e3046488a38a1beac0b8f6e3bb3
BLAKE2b-256 42d68852de2b4ac0e803df3c1e169e16f5d38b35e3e600eca8640321972aa45c

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

1 file

Supported by

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