market-analy


Namemarket-analy JSON
Version 0.6 PyPI version JSON
download
home_pageNone
SummaryAnalysis of exchange-listed financial instruments
upload_time2024-09-23 09:35:57
maintainerNone
docs_urlNone
authorMarcus Read
requires_python~=3.10
licenseMIT License
keywords finance analysis prices historical-data investing stocks currencies forex crypto etf funds bonds commodities indices
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <!-- NB any links not defined as aboslute will not resolve on PyPI page -->
<div align="center">
  <img src="docs/splash.png"><br>
</div>

-----------------

# market_analy

[![PyPI](https://img.shields.io/pypi/v/market-analy)](https://pypi.org/project/market-analy/) ![Python Support](https://img.shields.io/pypi/pyversions/market-analy) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

A python package for interactive charting and analysis of financial instruments.

Functionality includes **defining and visualising trends**.

Interactive charting is offered via guis created from widgets of the [bqplot](https://github.com/bqplot/bqplot), [ipywidgets](https://github.com/jupyter-widgets/ipywidgets) and [ipyvuetify](https://github.com/widgetti/ipyvuetify) libraries. Users can use the underlying parts to develop their own interactive charts and analyses. Contributions very much welcome! This is a WIP and it's anticipated that further analyses will be added.

There's a load of great financial libraries out there. This library isn't reinventing the wheel (not intentionally anyway), rather it principally provides functions and interactive charting that I think are useful and couldn't find elsewhere.

## Video tutorials

The following videos cover what's on offer:
* [General tutorial](https://vimeo.com/801302973) demonstrates the functionality as of the initial release (February 2023).
* [Trends](https://vimeo.com/835495038) demonstrates functionality (added June 2023) to define and visualise trends.

## Quickstart
All analyses can be accessed via the classes `Analysis` (single instrument analyses) and `Compare` (to compare multiple instruments). For example:

```python
from market_prices import PricesYahoo
from market_analy import Analysis,  Compare

prices = PricesYahoo("MSFT")
# OR if Yahoo API endpoints are not all currently available in your region...
prices = PricesYahoo("MSFT", calendars="XNYS", delays=0)
analy = Analysis(prices)
gui = analy.plot(months=18)
```
https://github.com/user-attachments/assets/9d03b38d-9da2-4668-8126-e6a33a66c269

```python
trend_kwargs = {
    "prd":60,
    "ext_break":0.05,
    "ext_limit":0.03,
    "min_bars":5,
}
gui = analy.trends_chart(
    "1D",
    trend_kwargs,
    years=3,
)
```
https://github.com/maread99/market_analy/assets/56914820/998c7f46-20f5-43f1-8b82-c857c0702cee

```python
comp = Compare(PricesYahoo("MSFT, AMZN, TSLA"))
# OR if Yahoo API endpoints are not all currently available in your region...
comp = Compare(PricesYahoo("MSFT, AMZN, TSLA", calendars="XNYS", delays=0))
gui = comp.plot(hours=30)
```
https://user-images.githubusercontent.com/56914820/220773790-1fdabf13-25bb-4205-acc2-6bac9b832dae.mp4

```python
gui = comp.chg_every_interval("20T", days=5, chart=True)
```
https://user-images.githubusercontent.com/56914820/220773802-ae329259-4a4e-4e5e-8d02-d4ee88b8b452.mp4

For further documentation see the [video tutorials](#Video-tutorials) and the [analysis](https://github.com/maread99/market_analy/blob/master/src/market_analy/analysis.py) module.

## Installation and environment

It's recommended that `market-analy` is installed to a new virtual environment created using `venv`.

The package can be installed to the activated environment via pip:

`$ pip install market-analy`

Plots are intended to be created in JupyterLab (they will not load in a notebook opened in VSCode). The 'jupyter' optional dependencies can be specified to additionally install `jupyter` and `jupyterlab` to the target environment.

`$ pip install market-analy[jupyter]`

Alternatively, it's possible to use an existing JupyterLab installation (>=3.0) in a separate environment to that in which `market_analy` is installed. In this case:
* The following dependencies should additionally be installed **in the environment to which JupyterLab is installed**:
  - `ipyvuetify`
  - `bqplot`
* A kernel should be created for **the environment to which `market_analy` was installed**. Executing the following, with any virutal environment activated, will create a kernel and make it available to all installed versions of `jupyterlab`.
  - `python -m ipykernel install --user --name mkt_analy --display-name "market analy env"`

> :warning: If starting JupyterLab from a different environment to the environment in which `market_analy` is installed then **the same versions of `ipyvuetify` and `bqplot` must be installed to both environments**. If either of these packages is subsequently upgraded in one environment then it must also be upgraded in the other. (This is due to the potential for conflicts between the versions in the JupyterLab environment, which are responsible for the frontend, and those in the `market_analy` environment where the backend is defined.)

### Color scheme
The color scheme assumes the package is being used with the JupyterLab dark theme. There are no plans to provide a 'light theme' option (although a contribution would certainly be welcome from anyone seeking one).

### `market-prices` dependency
`market-analy` depends on the [market-prices][market-prices] library for price data. This provides for functionality including:
* defining analysis periods in terms of number of sessions and trading minutes rather than calendar days and times.
* complete data sets regardless of liquidity (regular data points during market hours, no data points outside of market hours).

Most of the arguments available to the market-prices `get` function can be passed directly to the `market_analy` functions. See the [market-prices][market-prices] documentation for further info.

## Release schedule, bugs, development and feedback
The first beta version of `market_analy` was released Feb 2023. Functionality to  define and visually interrogate trends was added in June 2023.

The project is immature. Whilst it's not anticipated that major changes will be made to the existing public side, they could be. All that's under-the-bonnet is subject to change as the project evolves. The `guis` module in particular won't permit much further development without overhauling the current inheritance-based approach to a compositional one.

The test suite is somewhat limited. It's pretty much guaranteed that there are bugs. Please raise an [issue](https://github.com/maread99/market_analy/issues) if you find one or come across unexpected behaviour.

Please use [discussions](https://github.com/maread99/market_analy/discussions) to make any suggestions and offer general feedback.

## Disclaimers
`market-analy` should not be assumed sufficiently reliable to undertake analysis intended to inform investment decisions. Users should inspect the source code and the test suite of the library and its dependencies in order to make their own assessment of the packages' suitability for their purposes. **The `market-analy` package is used entirely at the user's own risk.**

The default `market_prices.PricesYahoo` class gets data from publically available Yahoo APIs. **See the [Disclaimers section of the market-prices README](https://github.com/maread99/market_prices#disclaimers) for conditions of use**, including restrictions.

## Alternative packages

* [awesome-quant](https://github.com/wilsonfreitas/awesome-quant) offers an extensive listing of libraries for all things finance.

## License

[MIT License][license]


[license]: https://github.com/maread99/beanahead/blob/master/LICENSE.txt
[market-prices]: https://github.com/maread99/market_prices

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "market-analy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "~=3.10",
    "maintainer_email": null,
    "keywords": "finance, analysis, prices, historical-data, investing, stocks, currencies, forex, crypto, etf, funds, bonds, commodities, indices",
    "author": "Marcus Read",
    "author_email": "marcusaread.prog@proton.me",
    "download_url": "https://files.pythonhosted.org/packages/60/9d/0ee47453df568a75311211874ea477ed871a57f86d942ce3406e26b3da87/market_analy-0.6.tar.gz",
    "platform": null,
    "description": "<!-- NB any links not defined as aboslute will not resolve on PyPI page -->\n<div align=\"center\">\n  <img src=\"docs/splash.png\"><br>\n</div>\n\n-----------------\n\n# market_analy\n\n[![PyPI](https://img.shields.io/pypi/v/market-analy)](https://pypi.org/project/market-analy/) ![Python Support](https://img.shields.io/pypi/pyversions/market-analy) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\nA python package for interactive charting and analysis of financial instruments.\n\nFunctionality includes **defining and visualising trends**.\n\nInteractive charting is offered via guis created from widgets of the [bqplot](https://github.com/bqplot/bqplot), [ipywidgets](https://github.com/jupyter-widgets/ipywidgets) and [ipyvuetify](https://github.com/widgetti/ipyvuetify) libraries. Users can use the underlying parts to develop their own interactive charts and analyses. Contributions very much welcome! This is a WIP and it's anticipated that further analyses will be added.\n\nThere's a load of great financial libraries out there. This library isn't reinventing the wheel (not intentionally anyway), rather it principally provides functions and interactive charting that I think are useful and couldn't find elsewhere.\n\n## Video tutorials\n\nThe following videos cover what's on offer:\n* [General tutorial](https://vimeo.com/801302973) demonstrates the functionality as of the initial release (February 2023).\n* [Trends](https://vimeo.com/835495038) demonstrates functionality (added June 2023) to define and visualise trends.\n\n## Quickstart\nAll analyses can be accessed via the classes `Analysis` (single instrument analyses) and `Compare` (to compare multiple instruments). For example:\n\n```python\nfrom market_prices import PricesYahoo\nfrom market_analy import Analysis,  Compare\n\nprices = PricesYahoo(\"MSFT\")\n# OR if Yahoo API endpoints are not all currently available in your region...\nprices = PricesYahoo(\"MSFT\", calendars=\"XNYS\", delays=0)\nanaly = Analysis(prices)\ngui = analy.plot(months=18)\n```\nhttps://github.com/user-attachments/assets/9d03b38d-9da2-4668-8126-e6a33a66c269\n\n```python\ntrend_kwargs = {\n    \"prd\":60,\n    \"ext_break\":0.05,\n    \"ext_limit\":0.03,\n    \"min_bars\":5,\n}\ngui = analy.trends_chart(\n    \"1D\",\n    trend_kwargs,\n    years=3,\n)\n```\nhttps://github.com/maread99/market_analy/assets/56914820/998c7f46-20f5-43f1-8b82-c857c0702cee\n\n```python\ncomp = Compare(PricesYahoo(\"MSFT, AMZN, TSLA\"))\n# OR if Yahoo API endpoints are not all currently available in your region...\ncomp = Compare(PricesYahoo(\"MSFT, AMZN, TSLA\", calendars=\"XNYS\", delays=0))\ngui = comp.plot(hours=30)\n```\nhttps://user-images.githubusercontent.com/56914820/220773790-1fdabf13-25bb-4205-acc2-6bac9b832dae.mp4\n\n```python\ngui = comp.chg_every_interval(\"20T\", days=5, chart=True)\n```\nhttps://user-images.githubusercontent.com/56914820/220773802-ae329259-4a4e-4e5e-8d02-d4ee88b8b452.mp4\n\nFor further documentation see the [video tutorials](#Video-tutorials) and the [analysis](https://github.com/maread99/market_analy/blob/master/src/market_analy/analysis.py) module.\n\n## Installation and environment\n\nIt's recommended that `market-analy` is installed to a new virtual environment created using `venv`.\n\nThe package can be installed to the activated environment via pip:\n\n`$ pip install market-analy`\n\nPlots are intended to be created in JupyterLab (they will not load in a notebook opened in VSCode). The 'jupyter' optional dependencies can be specified to additionally install `jupyter` and `jupyterlab` to the target environment.\n\n`$ pip install market-analy[jupyter]`\n\nAlternatively, it's possible to use an existing JupyterLab installation (>=3.0) in a separate environment to that in which `market_analy` is installed. In this case:\n* The following dependencies should additionally be installed **in the environment to which JupyterLab is installed**:\n  - `ipyvuetify`\n  - `bqplot`\n* A kernel should be created for **the environment to which `market_analy` was installed**. Executing the following, with any virutal environment activated, will create a kernel and make it available to all installed versions of `jupyterlab`.\n  - `python -m ipykernel install --user --name mkt_analy --display-name \"market analy env\"`\n\n> :warning: If starting JupyterLab from a different environment to the environment in which `market_analy` is installed then **the same versions of `ipyvuetify` and `bqplot` must be installed to both environments**. If either of these packages is subsequently upgraded in one environment then it must also be upgraded in the other. (This is due to the potential for conflicts between the versions in the JupyterLab environment, which are responsible for the frontend, and those in the `market_analy` environment where the backend is defined.)\n\n### Color scheme\nThe color scheme assumes the package is being used with the JupyterLab dark theme. There are no plans to provide a 'light theme' option (although a contribution would certainly be welcome from anyone seeking one).\n\n### `market-prices` dependency\n`market-analy` depends on the [market-prices][market-prices] library for price data. This provides for functionality including:\n* defining analysis periods in terms of number of sessions and trading minutes rather than calendar days and times.\n* complete data sets regardless of liquidity (regular data points during market hours, no data points outside of market hours).\n\nMost of the arguments available to the market-prices `get` function can be passed directly to the `market_analy` functions. See the [market-prices][market-prices] documentation for further info.\n\n## Release schedule, bugs, development and feedback\nThe first beta version of `market_analy` was released Feb 2023. Functionality to  define and visually interrogate trends was added in June 2023.\n\nThe project is immature. Whilst it's not anticipated that major changes will be made to the existing public side, they could be. All that's under-the-bonnet is subject to change as the project evolves. The `guis` module in particular won't permit much further development without overhauling the current inheritance-based approach to a compositional one.\n\nThe test suite is somewhat limited. It's pretty much guaranteed that there are bugs. Please raise an [issue](https://github.com/maread99/market_analy/issues) if you find one or come across unexpected behaviour.\n\nPlease use [discussions](https://github.com/maread99/market_analy/discussions) to make any suggestions and offer general feedback.\n\n## Disclaimers\n`market-analy` should not be assumed sufficiently reliable to undertake analysis intended to inform investment decisions. Users should inspect the source code and the test suite of the library and its dependencies in order to make their own assessment of the packages' suitability for their purposes. **The `market-analy` package is used entirely at the user's own risk.**\n\nThe default `market_prices.PricesYahoo` class gets data from publically available Yahoo APIs. **See the [Disclaimers section of the market-prices README](https://github.com/maread99/market_prices#disclaimers) for conditions of use**, including restrictions.\n\n## Alternative packages\n\n* [awesome-quant](https://github.com/wilsonfreitas/awesome-quant) offers an extensive listing of libraries for all things finance.\n\n## License\n\n[MIT License][license]\n\n\n[license]: https://github.com/maread99/beanahead/blob/master/LICENSE.txt\n[market-prices]: https://github.com/maread99/market_prices\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Analysis of exchange-listed financial instruments",
    "version": "0.6",
    "project_urls": {
        "Issue Tracker": "https://github.com/maread99/market_analy/issues",
        "Source Code": "https://github.com/maread99/market_analy",
        "documentation": "https://github.com/maread99/market_analy",
        "homepage": "https://github.com/maread99/market_analy"
    },
    "split_keywords": [
        "finance",
        " analysis",
        " prices",
        " historical-data",
        " investing",
        " stocks",
        " currencies",
        " forex",
        " crypto",
        " etf",
        " funds",
        " bonds",
        " commodities",
        " indices"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5c86362df2052af1616e71457ee0236931eb1f58bdf39ac8deb9099bd9b3a6ce",
                "md5": "c473c48bdec4eb6def28d5261bfc4f2d",
                "sha256": "55c6092c86c413d8874ec231a3d9dc65cb0ed2aecdbbf86f6f5986b40523993c"
            },
            "downloads": -1,
            "filename": "market_analy-0.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c473c48bdec4eb6def28d5261bfc4f2d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.10",
            "size": 128034,
            "upload_time": "2024-09-23T09:35:56",
            "upload_time_iso_8601": "2024-09-23T09:35:56.383738Z",
            "url": "https://files.pythonhosted.org/packages/5c/86/362df2052af1616e71457ee0236931eb1f58bdf39ac8deb9099bd9b3a6ce/market_analy-0.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "609d0ee47453df568a75311211874ea477ed871a57f86d942ce3406e26b3da87",
                "md5": "6c9549a1d8a67c534bd486960b790f76",
                "sha256": "24994197293b147986de38f5c73e6d515d6000de363648ffc7f565d4c038aa31"
            },
            "downloads": -1,
            "filename": "market_analy-0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "6c9549a1d8a67c534bd486960b790f76",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "~=3.10",
            "size": 241429,
            "upload_time": "2024-09-23T09:35:57",
            "upload_time_iso_8601": "2024-09-23T09:35:57.620929Z",
            "url": "https://files.pythonhosted.org/packages/60/9d/0ee47453df568a75311211874ea477ed871a57f86d942ce3406e26b3da87/market_analy-0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-23 09:35:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "maread99",
    "github_project": "market_analy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "market-analy"
}
        
Elapsed time: 0.79302s