{ "info": { "author": "Alvaro Bartolome", "author_email": "alvarob96@usal.es", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only", "Topic :: Scientific/Engineering :: Information Analysis", "Topic :: Software Development :: Libraries" ], "description": "# trendet - is a Python package for trend detection on stock time series data\n\n[![Python Version](https://img.shields.io/pypi/pyversions/trendet.svg)](https://pypi.org/project/trendet/)\n[![PyPi Version](https://img.shields.io/pypi/v/trendet.svg)](https://pypi.org/project/trendet/)\n[![Package Status](https://img.shields.io/pypi/status/trendet.svg)](https://pypi.org/project/trendet/)\n[![Build Status](https://dev.azure.com/alvarob96/alvarob96/_apis/build/status/alvarob96.trendet?branchName=master)](https://dev.azure.com/alvarob96/alvarob96/_build?definitionId=1&_a=summary)\n[![Build Status](https://img.shields.io/travis/alvarob96/trendet/master.svg?label=Travis%20CI&logo=travis&logoColor=white)](https://travis-ci.org/alvarob96/trendet)\n[![Documentation Status](https://readthedocs.org/projects/trendet/badge/?version=latest)](https://trendet.readthedocs.io/)\n[![codecov](https://codecov.io/gh/alvarob96/trendet/branch/master/graph/badge.svg)](https://codecov.io/gh/alvarob96/trendet)\n[![Downloads](https://img.shields.io/pypi/dm/trendet.svg?style=flat)](https://pypistats.org/packages/trendet)\n\n

\n \n

\n\n## Introduction\n\n**trendet** is a Python package to detect trends on the market so to analyze its behaviour. So on, this package\nhas been created to support [investpy](https://github.com/alvarob96/investpy) features when it comes to data retrieval\nfrom different financial products such as stocks/equities, funds or ETFs; and it is intended to be combined with it, \nbut also with every `pandas.DataFrame`, formatted as OHLC.\n\nAnyways, **trendet** can also be used to identify trends from any `pandas.DataFrame` which contains any column with\n`int64` or `float64` values, even though it is intended to be used with stock data; it can also be used for any\n`pandas.DataFrame`.\n\n## Installation\n\nIn order to get this package working you will need to install it using pip by typing on the terminal:\n\n``$ python -m pip install trendet --upgrade``\n\nOr just install the current release or a specific release version such as:\n\n``$ python -m pip install trendet==0.5``\n\n## Usage\n\nAs **trendet** is intended to be combined with **investpy**, the main functionality is to\ndetect trends on stock time series data so to analyse the market and which behaviour does it have\nin certain date ranges.\n\nIn the example presented below, the ``identify_all_trends`` function will be used to detect every bearish/bullish trend\nwith a time window above 5 days, which, for example, implies that every bearish (decreasing) trend with a longer\nlength than 5 days will be identified as a down trend and so on added to a ``pandas.DataFrame`` which already contains\nOHLC values, in new columns called **Up Trend** and **Down Trend** which will be labeled as specified, with letters \nfrom A to Z by default.\n\n````python\nimport trendet\n\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\nsns.set(style='darkgrid')\n\ndf = trendet.identify_all_trends(equity='bbva',\n country='spain',\n from_date='01/01/2018',\n to_date='01/01/2019',\n window_size=5,\n identify='both')\n\ndf.reset_index(inplace=True)\n\nwith plt.style.context('paper'):\n plt.figure(figsize=(20, 10))\n\n ax = sns.lineplot(x=df['Date'], y=df['Close'])\n\n labels = df['Up Trend'].dropna().unique().tolist()\n\n for label in labels:\n sns.lineplot(x=df[df['Up Trend'] == label]['Date'],\n y=df[df['Up Trend'] == label]['Close'],\n color='green')\n\n ax.axvspan(df[df['Up Trend'] == label]['Date'].iloc[0],\n df[df['Up Trend'] == label]['Date'].iloc[-1],\n alpha=0.2,\n color='green')\n\n labels = df['Down Trend'].dropna().unique().tolist()\n\n for label in labels:\n sns.lineplot(x=df[df['Down Trend'] == label]['Date'],\n y=df[df['Down Trend'] == label]['Close'],\n color='red')\n\n ax.axvspan(df[df['Down Trend'] == label]['Date'].iloc[0],\n df[df['Down Trend'] == label]['Date'].iloc[-1],\n alpha=0.2,\n color='red')\n\n plt.show()\n````\n\nFurther usage insights can be found on the [docs](https://trendet.readthedocs.io/) or on the following \n[gist](https://gist.github.com/alvarob96/98f94dcfec59f78a16ad2edbf464ce75#file-identify_all_trends-py). Anyways, \nfeel free to create your own scripts on how you use **trendet** or how can it be used in order to improve its features.\n\n## Contribute\n\nAs this is an open source project it is open to contributions, bug reports, bug fixes, documentation improvements, \nenhancements and ideas.\n\nAlso there is an open tab of [issues](https://github.com/alvarob96/trendet/issues) where anyone can contribute opening \nnew issues if needed or navigate through them in order to solve them or contribute to its solving.\n\n## Disclaimer\n\nThis package has been created so to identify market trends based on stock historical data retrieved via \n[investpy](https://github.com/alvarob96/investpy) so to determine which trends have been prevailing on the market\nbased on a single stock/equity OHLC values.\n\nConclude that this is the result of a research project, so this package has been developed with research purposes and\nno profit is intended.\n\nPlots have been generated with both [matplotlib](https://pypi.org/project/matplotlib/) and \n[seaborn](https://pypi.org/project/seaborn/), using [@Dih5](https://github.com/Dih5) \n[paper-themes](https://github.com/Dih5/paper-themes) for scientific publications highly recommended.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/alvarob96/trendet/archive/0.5.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/alvarob96/trendet", "keywords": "trend detection,stock analysis,stock,trend analysis", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "trendet", "package_url": "https://pypi.org/project/trendet/", "platform": "", "project_url": "https://pypi.org/project/trendet/", "project_urls": { "Bug Reports": "https://github.com/alvarob96/trendet/issues", "Documentation": "https://trendet.readthedocs.io/", "Download": "https://github.com/alvarob96/trendet/archive/0.5.tar.gz", "Homepage": "https://github.com/alvarob96/trendet", "Source": "https://github.com/alvarob96/trendet" }, "release_url": "https://pypi.org/project/trendet/0.5/", "requires_dist": null, "requires_python": ">=3", "summary": "trendet - is a Python package for trend detection on stock time series data", "version": "0.5" }, "last_serial": 5835876, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "99b4635f707a6722ab37d7031e321332", "sha256": "d7a9bd3f9b24aa15ae9b573c57d2f0a558684716676e75b7a77fd6b969b27cef" }, "downloads": -1, "filename": "trendet-0.1.tar.gz", "has_sig": false, "md5_digest": "99b4635f707a6722ab37d7031e321332", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4653, "upload_time": "2019-08-21T16:38:23", "url": "https://files.pythonhosted.org/packages/6a/6b/6b581aadd179619d35b8767d2383a3a8acfd70adb750f5523ee83a4884c8/trendet-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "ef247f01de50d2e48f53b9f8d1453911", "sha256": "24178e9625f6ecc69219e3740893b8d6de85300c960152a95ba0fb1cd2d227ef" }, "downloads": -1, "filename": "trendet-0.2.tar.gz", "has_sig": false, "md5_digest": "ef247f01de50d2e48f53b9f8d1453911", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5813, "upload_time": "2019-08-22T18:50:50", "url": "https://files.pythonhosted.org/packages/09/74/6335d3195de4fc3e6d36246709bdf08c0ca5d9463c1f7d369a0b361eaff2/trendet-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "0aab248e5a176547d0f7d7bfd5624172", "sha256": "93d2fdbbddcdab55bd2e29e390fa9889003f78d919e171c9c4acdf244493da11" }, "downloads": -1, "filename": "trendet-0.3.tar.gz", "has_sig": false, "md5_digest": "0aab248e5a176547d0f7d7bfd5624172", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8785, "upload_time": "2019-08-23T17:43:50", "url": "https://files.pythonhosted.org/packages/ab/db/ce22fccc7140b183443ea5dbeba35f8a3458e3b162fc00ff7f66d585d8ae/trendet-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "c95141ab02a980bac42b21be45a39797", "sha256": "65e0fe1e5f4c3bacf9de9d713c191fd007146822ea91b44ea6c98b48d138553c" }, "downloads": -1, "filename": "trendet-0.4.tar.gz", "has_sig": false, "md5_digest": "c95141ab02a980bac42b21be45a39797", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9115, "upload_time": "2019-08-28T16:48:04", "url": "https://files.pythonhosted.org/packages/ea/e1/8f9f05abd9433aa153c73314845ad2e9d062027c7b9645b81593c79a15fb/trendet-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "811eb5ee8b42f7d5d5a566a0cc3ee906", "sha256": "9edb01edc0682a4763a0b8fd0bd7f90dbfb11852a0d256cc3bff34113262c509" }, "downloads": -1, "filename": "trendet-0.5.tar.gz", "has_sig": false, "md5_digest": "811eb5ee8b42f7d5d5a566a0cc3ee906", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 10334, "upload_time": "2019-09-16T12:26:29", "url": "https://files.pythonhosted.org/packages/a7/c9/b56dfcfe584a54b445ff62189660e719471a94256bdf7944ff9b0466dd28/trendet-0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "811eb5ee8b42f7d5d5a566a0cc3ee906", "sha256": "9edb01edc0682a4763a0b8fd0bd7f90dbfb11852a0d256cc3bff34113262c509" }, "downloads": -1, "filename": "trendet-0.5.tar.gz", "has_sig": false, "md5_digest": "811eb5ee8b42f7d5d5a566a0cc3ee906", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 10334, "upload_time": "2019-09-16T12:26:29", "url": "https://files.pythonhosted.org/packages/a7/c9/b56dfcfe584a54b445ff62189660e719471a94256bdf7944ff9b0466dd28/trendet-0.5.tar.gz" } ] }