From d3c166bc9420cf661d433c19d9d996ca6cfba217 Mon Sep 17 00:00:00 2001 From: Debasish Pal <48341250+debpal@users.noreply.github.com> Date: Sat, 7 Dec 2024 16:12:00 +0200 Subject: [PATCH] update code --- .github/workflows/testing.yml | 58 ----------------------------------- BharatFinTrack/__init__.py | 2 +- BharatFinTrack/core.py | 2 +- BharatFinTrack/nse_index.py | 2 +- README.md | 2 +- tests/test_bharatfintrack.py | 4 +-- 6 files changed, 6 insertions(+), 64 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 7edbf8e..5b736fc 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -65,64 +65,6 @@ jobs: export PYTHONPATH=$(pwd) pytest --cov=BharatFinTrack --cov-report=xml # Run tests and generate coverage report in XML format - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4.2.0 - with: - token: ${{ secrets.CODECOV_TOKEN }} # This secret token should be added in your repository settings - - test-python-3-11: - name: Test with Python 3.11 - runs-on: ubuntu-latest - needs: test-python-3-12 # Runs only after the Python 3.11 tests complete - - steps: - - name: Checkout repository - uses: actions/checkout@v4 # This checks out your code to the runner - - - name: Set up Python 3.11 - uses: actions/setup-python@v3 # Sets up the specified Python version - with: - python-version: "3.11" - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install -r requirements-gh-action.txt # Install dependencies - - - name: Run tests with pytest - run: | - export PYTHONPATH=$(pwd) - pytest --cov=BharatFinTrack --cov-report=xml # Run tests and generate coverage report in XML format - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4.2.0 - with: - token: ${{ secrets.CODECOV_TOKEN }} # This secret token should be added in your repository settings - - test-python-3-10: - name: Test with Python 3.10 - runs-on: ubuntu-latest - needs: test-python-3-11 # Runs only after the Python 3.11 tests complete - - steps: - - name: Checkout repository - uses: actions/checkout@v4 # This checks out your code to the runner - - - name: Set up Python 3.10 - uses: actions/setup-python@v3 # Sets up the specified Python version - with: - python-version: "3.10" - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install -r requirements-gh-action.txt # Install dependencies - - - name: Run tests with pytest - run: | - export PYTHONPATH=$(pwd) - pytest --cov=BharatFinTrack --cov-report=xml # Run tests and generate coverage report in XML format - - name: Upload coverage to Codecov uses: codecov/codecov-action@v4.2.0 with: diff --git a/BharatFinTrack/__init__.py b/BharatFinTrack/__init__.py index e10098e..acb3a2e 100644 --- a/BharatFinTrack/__init__.py +++ b/BharatFinTrack/__init__.py @@ -12,4 +12,4 @@ ] -__version__ = '0.1.9' +__version__ = '0.1.10' diff --git a/BharatFinTrack/core.py b/BharatFinTrack/core.py index 9ad4aa9..d0b0b92 100644 --- a/BharatFinTrack/core.py +++ b/BharatFinTrack/core.py @@ -158,7 +158,7 @@ def _download_nse_tri( url=self.url_nse_index_tri_data, headers=headers, data=payload, - timeout=15 + timeout=10 ) response_data = response.json() records = json.loads(response_data['d']) diff --git a/BharatFinTrack/nse_index.py b/BharatFinTrack/nse_index.py index 690298d..3e73704 100644 --- a/BharatFinTrack/nse_index.py +++ b/BharatFinTrack/nse_index.py @@ -58,7 +58,7 @@ def download_daily_summary_report( response = requests.get( url=csv_url, headers=headers, - timeout=30 + timeout=10 ) soup = bs4.BeautifulSoup( markup=response.content, diff --git a/README.md b/README.md index bbff895..bf2aa23 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ Using `BharatFinTrack`, you can quickly gain insights into the performance of NS In the above graph, the `NIFTY MIDCAP150 MOMENTUM 50` emerges as one of the best-performing NSE equity `TRI` indices in terms of long-term CAGR. The next graph illustrates a comparison of year-wise investments and returns for a monthly SIP of 1,000 Rupees between a government bond and a passive fund tracking the `TRI` data of `NIFTY MIDCAP150 MOMENTUM 50`. -![Year-wise SIP comparison between Government Bond and NIFTY_MIDCAP150_MOMENTUM_50](https://github.com/debpal/BharatFinTrack/raw/master/docs/_static/sip_yearwise_NIFTY_MIDCAP150_MOMENTUM_50.png) +![Year-wise SIP comparison between Government Bond and NIFTY_MIDCAP150_MOMENTUM_50](https://github.com/debpal/BharatFinTrack/raw/master/docs/_static/sip_gsec_vs_NIFTY_MIDCAP150_MOMENTUM_50.png) Additionally, the following plot compares the growth multiples (X) of a monthly SIP investment across `TRI` indices, including the popular index `NIFTY 50` and other top-performing NSE equity indices over the years. diff --git a/tests/test_bharatfintrack.py b/tests/test_bharatfintrack.py index 205ad19..bdb6231 100644 --- a/tests/test_bharatfintrack.py +++ b/tests/test_bharatfintrack.py @@ -736,5 +736,5 @@ def test_github_action( ): assert core._github_action( - integer=2 - ) == '2' + integer=3 + ) == '3'