Skip to content

Commit

Permalink
v0.6.0 (#50)
Browse files Browse the repository at this point in the history
## New Features

* Add a way to load historical daily OHLCV data from Bhav Copy released
by BSE everyday

## Bug Fixes

* Change the source of the scrip code list to fix the broken list of
codes

## Maintenance

* Add a pipenv environment for development
* Update years in license statements
* Update time & actions used in `daily-tests` workflow
* Increase tests coverage
* Add contributing guidelines
  • Loading branch information
sdabhi23 authored Jan 30, 2024
2 parents d1836ab + 5e60653 commit 86d9dd5
Show file tree
Hide file tree
Showing 28 changed files with 1,482 additions and 254 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/daily-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: daily-tests

on:
schedule:
- cron: '0 1 * * *'
- cron: '10 1 * * *'

jobs:
build:
Expand All @@ -11,20 +11,22 @@ jobs:
strategy:
max-parallel: 3
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requires.ci.txt
- name: Test with pytest
run: |
pip install pytest pytest-cov
pytest --cov=bsedata --no-cov-on-fail --cov-report=xml
32 changes: 32 additions & 0 deletions .github/workflows/daily-update-scrip-code-list.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: update-scrip-code-list

on:
schedule:
- cron: '20 1 * * *'

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requires.ci.txt
- name: Run script to update scrip codes
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
run: |
python cron/update_scrip_code_list.py
12 changes: 8 additions & 4 deletions .github/workflows/dev-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,27 @@ jobs:
strategy:
max-parallel: 3
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requires.ci.txt
- name: Test with pytest
run: |
pip install pytest pytest-cov
pytest --cov=bsedata --no-cov-on-fail --cov-report=xml
pytest --cov=bsedata --no-cov-on-fail --cov-report=xml -n 4
- name: Upload to codecov
uses: codecov/codecov-action@v3
with:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ bsedata/__pycache__/
__pycache__/
*.py[cod]
venv/
.env

# pytest artifacts
.pytest_cache/
.coverage
.coverage.*

# .json files for storing scrip codes
indices.json
Expand Down
23 changes: 23 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# How to contribute

## Did you find a bug?

* **Ensure the bug was not already reported** by searching on GitHub under [issues](https://github.com/sdabhi23/bsedata/issues).

* If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/sdabhi23/bsedata/issues/new). Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** demonstrating the expected behavior that is not occurring. Don't forget to the tag `bug` on your issue.

## Did you write a patch that fixes a bug?

* Open a new GitHub pull request with the patch.

* Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable.

## Do you intend to add a new feature or change an existing one?

* Suggest your change by [opening a new issue on GitHub](https://github.com/sdabhi23/bsedata/issues/new). Don't forget to the tag `enhancement` on your issue.

* Changes which create a dependency on the APIs used by the [new BSE website](https://www.bseindia.com/) are generally rejected as they keep breaking because of security changes on the APIs. These APIs generally start with something like **`https://api.bseindia.com/BseIndiaAPI/api/`**. [Example 1](https://github.com/sdabhi23/bsedata/pull/30) [Example 2](https://github.com/sdabhi23/bsedata/pull/29) [Example 3](https://github.com/sdabhi23/bsedata/pull/45)

## Do you want to contribute to the documentation?

* Please make sure that you fully understand what this library does & do not propose irrelevant or bad changes. [Example](https://github.com/sdabhi23/bsedata/pull/44).
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 - 2023 Shrey Dabhi
Copyright (c) 2018 - 2024 Shrey Dabhi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
22 changes: 22 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
sphinxext-opengraph = "*"
sphinx-copybutton = "*"
beautifulsoup4 = "*"
pytest-xdist = "*"
pytest-cov = "*"
autopep8 = "*"
requests = "*"
pytest = "*"
pandas = "*"
sphinx = "*"
boto3 = "*"
furo = "*"
lxml = "*"

[requires]
python_version = "3.10"
Loading

0 comments on commit 86d9dd5

Please sign in to comment.