Skip to main content

Python toolstack for helper functions and efficient connectivity

Project description

WhyKay

PyPI GitHub commit-activity

The concept is to have a personal toolbar that contains all the handy functions that support efficient python software engineering workflows, connectivity to cloud, navigating file systems, parsing date/time formats and pushing notifications to different platforms.

๐Ÿšฉ v0.4.0 is now available with the feature to calculate the stock exposure through your ETFs and stock portfolio


Installation

To run the code successfully, all the dependencies can either be installed using pip:

pip install whykay

Cloning repository for contributions

To run the code successfully, all the dependencies can either be installed using pip:

pip install -r requirements.txt

or use the pre-define Makefile targets

make setup

Features (Usage/Examples)

Investments (Stock/ETF exposure calculator)

Available for use from v0.1.0

Limitations (in-scope features)

  • This only works on ETFs or Stocks (Individual shares) based portfolio
  • Will ignore any other investment holdings that you pass
  • It takes in input in form of a JSON structure:
    [
        {
            "isin": "US30303M1027",
            "investment":  185.22,
            "category": "stock" # Optional field
        },
        {
            "isin": "IE00BQQP9H09",
            "investment":  298.22,
            "category": "ETF" # Optional field
        }
    ]
    
    where isin uniquely idenfies a holding, can get it from Yahoo Finance/Trading 212 (personal choice)
  • Returns the output in a JSON format
>>> from whykay.investments.stocks_analyzer import calculate_exposure
โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘                     Investment Analyzer Imported                         โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
>>> data = [
                {
                    "isin": "US30303M1027",
                    "investment":  185.22
                },
                {
                    "isin": "IE00BQQP9H09",
                    "investment":  298.22
                }
            ]
>>> calculate_exposure(
        holdings = data, display = True
    )
    
+----+----------+-----------------------+--------------------+
|    | symbol   |   Amount Invested ($) |   Overall Exposure |
|----+----------+-----------------------+--------------------|
|  0 | AAPL     |              229.5500 |            32.7929 |
|  1 | MSFT     |               28.1000 |             4.0143 |
|  2 | AMZN     |               20.3000 |             2.9000 |
|  3 | FB       |               11.4500 |             1.6357 |
|  4 | GOOGL    |               10.1000 |             1.4429 |
|  5 | GOOG     |                9.8500 |             1.4071 |
|  6 | BRK.B    |                7.2500 |             1.0357 |
|  7 | TSLA     |                7.2000 |             1.0286 |
|  8 | NVDA     |                6.8500 |             0.9786 |
|  9 | JPM      |                6.5000 |             0.9286 |
+----+----------+-----------------------+--------------------+

Changelog

v0.4.0

  • Breaks previous functionality, as output is now typically returned in a json structure
  • Import reverted back to whykay.investments.stock_analyzer for future use cases
  • Takes in new parameter: display which returns the tabular display of results on screen
  • data is now inputted in form of API convention JSON structures for API endpoint developments

v0.3.0

  • Breaks previous functionality, as output is now typically returned in a json structure
  • Import changes from whykay.investments.stock_analyzer to whykay.investments.holdings_analyzer
  • Takes in new parameter: display which returns the tabular display of results on screen

v0.2.0

  • fixes to .gitignore file which was preventing the requirements.txt file upload
  • does not break functionality changes in v0.1.0

v0.1.0

  • Minor release that supports the stock exposure feature calculator
  • from whykay.investments.portfolio_analyzer import calculate_exposure

v0.0.x

  • previous versions were experimental and don't provide much functionality
  • will be discarded on pypi.org

Authors

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

whykay-0.4.0.tar.gz (9.6 kB view details)

Uploaded Source

File details

Details for the file whykay-0.4.0.tar.gz.

File metadata

  • Download URL: whykay-0.4.0.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for whykay-0.4.0.tar.gz
Algorithm Hash digest
SHA256 10b6a8f174fd450aaa811c209b2774ccc5a18559187e20d678dfe7f46caf27fd
MD5 447b63575334fe84c8a4a16bfbafca25
BLAKE2b-256 69e3b4d6991e81c8a23e7f1951a4c90604074aab1e7b3943e6b83c3e218c3167

See more details on using hashes here.

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