From f81646ad36c70f79876754b3dc541c47b55c2b3d Mon Sep 17 00:00:00 2001 From: pbrumblay Date: Thu, 24 Sep 2020 17:59:30 -0600 Subject: [PATCH] moving version to setup.py and using pkg_resources to fetch from core.py --- pandas_ta/core.py | 11 ++++++----- setup.py | 3 +-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pandas_ta/core.py b/pandas_ta/core.py index 9d8fe33..d82e0ee 100644 --- a/pandas_ta/core.py +++ b/pandas_ta/core.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +import pkg_resources from collections import namedtuple from dataclasses import dataclass, field from datetime import datetime @@ -23,7 +24,7 @@ from pandas_ta.volatility import * from pandas_ta.volume import * from pandas_ta.utils import * -version = ".".join(("0", "2", "11b")) +version = pkg_resources.get_distribution('pandas-ta').version # Strategy DataClass @@ -37,7 +38,7 @@ class Strategy: ta (list of dicts): A list of dicts containing keyword arguments where "kind" is the indicator. description (str): A more detailed description of what the Strategy tries to capture. Default: None created (str): At datetime string of when it was created. Default: Automatically generated. *Subject to change* - + Example TA: ta = [ {"kind": "sma", "length": 200}, @@ -440,7 +441,7 @@ class AnalysisIndicators(BasePandasObject): name, mode["category"] = strategy_.name, True else: name, mode["custom"] = strategy_.name, True - + return name, mode @@ -470,7 +471,7 @@ class AnalysisIndicators(BasePandasObject): the working DataFrame. Default: None. Returns: - Returns the appended constants + Returns the appended constants Returns nothing to the user. Either adds or removes constant ranges from the working DataFrame. """ @@ -486,7 +487,7 @@ class AnalysisIndicators(BasePandasObject): def indicators(self, **kwargs): """List of Indicators - + Args: kwargs: as_list (bool, optional): Default: False. When True, it diff --git a/setup.py b/setup.py index 0b250ae..37d267b 100644 --- a/setup.py +++ b/setup.py @@ -1,13 +1,12 @@ # -*- coding: utf-8 -*- from distutils.core import setup -from pandas_ta.core import version long_description = "An easy to use Python 3 Pandas Extension with 115+ Technical Analysis Indicators. Can be called from a Pandas DataFrame or standalone like TA-Lib. Correlation tested with TA-Lib." setup( name ="pandas_ta", packages =['pandas_ta', 'pandas_ta.candles', 'pandas_ta.momentum', 'pandas_ta.overlap', 'pandas_ta.performance', 'pandas_ta.statistics', 'pandas_ta.trend', 'pandas_ta.volatility', 'pandas_ta.volume'], - version =version, + version =".".join(("0", "2", "02b")), description =long_description, long_description =long_description, author ="Kevin Johnson",