strela


Namestrela JSON
Version 0.3.4 PyPI version JSON
download
home_pagehttps://github.com/ymyke/strela
SummaryA python package for financial alerts
upload_time2023-04-03 09:14:37
maintainer
docs_urlNone
authorymyke
requires_python>=3.7.13,<3.10
licenseMIT
keywords python finance financial-analysis financial alerts alerting tessa
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # strela - a python package for financial alerts 📈🚨📉

strela provides a toolbox to generate and send different kinds of alerts based on
financial information.

The package is intended to be used to write a Python script that can be scheduled via
cronjob or similar facilities and runs everything necessary according to your needs. See
`strela.my_runner` as an example.

[→ Check out the full documentation. 📖](https://ymyke.github.io/strela/strela.html)

## Features & overview

- `strela.alert_generator`: The central logic that brings all the building blocks
  together to retrieve and analyze the financial metrics and to generate and send alerts
  if applicable.
- `strela.alertstates.alertstate.AlertState`: The abstract base class for all alert
  states. Alert states encapsulate the logic to determine whether an alert has triggered
  or not. There are two concrete types of alerts:
    - `strela.alertstates.fluctulertstate.FluctulertState`: Alerts for fluctuations (up
      or down) over certain thresholds.
    - `strela.alertstates.doubledownalertstate.DoubleDownAlertState`: Alerts for
      significant downward movement which could trigger an over-proportional buy.
- `strela.templates`: Classes to turn alerts into text or html strings that can be
  printed or mailed.
- `strela.mailer`: To send alerts via email.
- `strela.config`: Configuration management. Use the override mechanism described there
  to put your own user config file in place that overrides the settings in the default
  config file according to your environment.
- `strela.my_runner`: The script that brings it all together and runs the alert
  generator according to your requirements. Use this script as a blueprint to build your
  own runner script.
- `strela.alertstates.alertstaterepository`: Repositories (in memory or on disk) to
  store and retrieve alert states.

## How to install and use

1. Install the package. Two options:
   - `pip install strela`
   - Clone the repository and install the requirements using poetry.
2. Set up your config file `my_config.py` based on the documentation in `strela.config`.
   (Review your config via `strela.config.print_current_configuation`.)
3. Write your own runner script based on the blueprint in `strela.my_runner`. (Test your
   script by running it and -- if necessary -- setting `strela.config.ENABLE_ALL_DOWS`
   and/or `strela.config.NO_MAIL` to `True`.)
4. Install your runner script as a daily cronjob or similar.

## Example alerts

What a single Fluctulert looks like in the alert e-mail:

![Fluctulert example](https://raw.githubusercontent.com/ymyke/strela/master/docs/images/fluctulert_example.png)

What a single DoubleDownAlert looks like in the alert e-mail:

![DoubleDownAlert example](https://raw.githubusercontent.com/ymyke/strela/master/docs/images/doubledownalert_example.png)

## Limitations

The overall software architecture features decent modularization and separation of
concerns, but also has a lot of room left for improvement. E.g., better separation of
concerns in AlertStates (mixing logic and output currently), better parametrization of
alert states and templates, better extensibility, etc. 

## strela vs tessa

The strela package works seamlessly with [tessa](https://github.com/ymyke/tessa) and its
Symbol class and financial information access functionality.

At the same time, care was taken to make strela open and flexible enough to be used with
other packages and/or your own code.

Still, many or most people will end up using strela together with tessa so it's worth
discussing whether strela should be incorporated into tessa.

I decided to keep strela separate from tessa because strela has a distinctly different
character: a) it is not purely a library but needs some script to be built on top and
then called as a CLI tool / cronjob, b) it tends to rely on external files such as a
list of symbols to be loaded, c) it needs a place to store the alert state (and will
fail if that place doesn't exist, which seems to be unacceptable behavior for a pure
library such as tessa).

But I would like to have your thoughts on this. Should strela and tessa be separate
packages or better both in one? [Add your thoughts to the respective
issue.](https://github.com/ymyke/strela/issues/1)

## A note on tests

Some of the tests hit the net and are marked as such with `pytest.mark.net`. That way,
you can easily run exclude those tests if you like: `pytest -m "not net"`.

## Link to Repository

https://github.com/ymyke/strela

## Other noteworthy libraries

- [tessa](https://github.com/ymyke/tessa): Find financial assets and get their price history without worrying about different APIs or rate limiting.
- [pypme](https://github.com/ymyke/pypme): A Python package for PME (Public Market Equivalent) calculation.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ymyke/strela",
    "name": "strela",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7.13,<3.10",
    "maintainer_email": "",
    "keywords": "python,finance,financial-analysis,financial,alerts,alerting,tessa",
    "author": "ymyke",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/db/ad/80e40db8229ef5c1cc3ebc3ccabb685ccfce1fd398d07a446fcaf85ea962/strela-0.3.4.tar.gz",
    "platform": null,
    "description": "# strela - a python package for financial alerts \ud83d\udcc8\ud83d\udea8\ud83d\udcc9\n\nstrela provides a toolbox to generate and send different kinds of alerts based on\nfinancial information.\n\nThe package is intended to be used to write a Python script that can be scheduled via\ncronjob or similar facilities and runs everything necessary according to your needs. See\n`strela.my_runner` as an example.\n\n[\u2192 Check out the full documentation. \ud83d\udcd6](https://ymyke.github.io/strela/strela.html)\n\n## Features & overview\n\n- `strela.alert_generator`: The central logic that brings all the building blocks\n  together to retrieve and analyze the financial metrics and to generate and send alerts\n  if applicable.\n- `strela.alertstates.alertstate.AlertState`: The abstract base class for all alert\n  states. Alert states encapsulate the logic to determine whether an alert has triggered\n  or not. There are two concrete types of alerts:\n    - `strela.alertstates.fluctulertstate.FluctulertState`: Alerts for fluctuations (up\n      or down) over certain thresholds.\n    - `strela.alertstates.doubledownalertstate.DoubleDownAlertState`: Alerts for\n      significant downward movement which could trigger an over-proportional buy.\n- `strela.templates`: Classes to turn alerts into text or html strings that can be\n  printed or mailed.\n- `strela.mailer`: To send alerts via email.\n- `strela.config`: Configuration management. Use the override mechanism described there\n  to put your own user config file in place that overrides the settings in the default\n  config file according to your environment.\n- `strela.my_runner`: The script that brings it all together and runs the alert\n  generator according to your requirements. Use this script as a blueprint to build your\n  own runner script.\n- `strela.alertstates.alertstaterepository`: Repositories (in memory or on disk) to\n  store and retrieve alert states.\n\n## How to install and use\n\n1. Install the package. Two options:\n   - `pip install strela`\n   - Clone the repository and install the requirements using poetry.\n2. Set up your config file `my_config.py` based on the documentation in `strela.config`.\n   (Review your config via `strela.config.print_current_configuation`.)\n3. Write your own runner script based on the blueprint in `strela.my_runner`. (Test your\n   script by running it and -- if necessary -- setting `strela.config.ENABLE_ALL_DOWS`\n   and/or `strela.config.NO_MAIL` to `True`.)\n4. Install your runner script as a daily cronjob or similar.\n\n## Example alerts\n\nWhat a single Fluctulert looks like in the alert e-mail:\n\n![Fluctulert example](https://raw.githubusercontent.com/ymyke/strela/master/docs/images/fluctulert_example.png)\n\nWhat a single DoubleDownAlert looks like in the alert e-mail:\n\n![DoubleDownAlert example](https://raw.githubusercontent.com/ymyke/strela/master/docs/images/doubledownalert_example.png)\n\n## Limitations\n\nThe overall software architecture features decent modularization and separation of\nconcerns, but also has a lot of room left for improvement. E.g., better separation of\nconcerns in AlertStates (mixing logic and output currently), better parametrization of\nalert states and templates, better extensibility, etc. \n\n## strela vs tessa\n\nThe strela package works seamlessly with [tessa](https://github.com/ymyke/tessa) and its\nSymbol class and financial information access functionality.\n\nAt the same time, care was taken to make strela open and flexible enough to be used with\nother packages and/or your own code.\n\nStill, many or most people will end up using strela together with tessa so it's worth\ndiscussing whether strela should be incorporated into tessa.\n\nI decided to keep strela separate from tessa because strela has a distinctly different\ncharacter: a) it is not purely a library but needs some script to be built on top and\nthen called as a CLI tool / cronjob, b) it tends to rely on external files such as a\nlist of symbols to be loaded, c) it needs a place to store the alert state (and will\nfail if that place doesn't exist, which seems to be unacceptable behavior for a pure\nlibrary such as tessa).\n\nBut I would like to have your thoughts on this. Should strela and tessa be separate\npackages or better both in one? [Add your thoughts to the respective\nissue.](https://github.com/ymyke/strela/issues/1)\n\n## A note on tests\n\nSome of the tests hit the net and are marked as such with `pytest.mark.net`. That way,\nyou can easily run exclude those tests if you like: `pytest -m \"not net\"`.\n\n## Link to Repository\n\nhttps://github.com/ymyke/strela\n\n## Other noteworthy libraries\n\n- [tessa](https://github.com/ymyke/tessa): Find financial assets and get their price history without worrying about different APIs or rate limiting.\n- [pypme](https://github.com/ymyke/pypme): A Python package for PME (Public Market Equivalent) calculation.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A python package for financial alerts",
    "version": "0.3.4",
    "split_keywords": [
        "python",
        "finance",
        "financial-analysis",
        "financial",
        "alerts",
        "alerting",
        "tessa"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c79f908ace95c43af215623a28f0db0679e7e0bde865296e32c691d582a5634d",
                "md5": "71aad177635b3733303ec4d785a59f08",
                "sha256": "cfe89659d4c6c4e6788942209cd571371c674190b502f0994bec34db7c8ae49a"
            },
            "downloads": -1,
            "filename": "strela-0.3.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "71aad177635b3733303ec4d785a59f08",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7.13,<3.10",
            "size": 17469,
            "upload_time": "2023-04-03T09:14:35",
            "upload_time_iso_8601": "2023-04-03T09:14:35.730946Z",
            "url": "https://files.pythonhosted.org/packages/c7/9f/908ace95c43af215623a28f0db0679e7e0bde865296e32c691d582a5634d/strela-0.3.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dbad80e40db8229ef5c1cc3ebc3ccabb685ccfce1fd398d07a446fcaf85ea962",
                "md5": "6a6133fb5bac987f3b0ca2b5a918c69b",
                "sha256": "d79c265e22ba8ba95abbb516df4ad3ada3be2be36bec2d8bc55c5c195eaf39e0"
            },
            "downloads": -1,
            "filename": "strela-0.3.4.tar.gz",
            "has_sig": false,
            "md5_digest": "6a6133fb5bac987f3b0ca2b5a918c69b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7.13,<3.10",
            "size": 16032,
            "upload_time": "2023-04-03T09:14:37",
            "upload_time_iso_8601": "2023-04-03T09:14:37.395041Z",
            "url": "https://files.pythonhosted.org/packages/db/ad/80e40db8229ef5c1cc3ebc3ccabb685ccfce1fd398d07a446fcaf85ea962/strela-0.3.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-03 09:14:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "ymyke",
    "github_project": "strela",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "strela"
}
        
Elapsed time: 0.59251s