Skip to content

Commit

Permalink
Merge pull request #59 from PtPrashantTripathi/new
Browse files Browse the repository at this point in the history
updated
  • Loading branch information
PtPrashantTripathi authored Sep 20, 2024
2 parents 4897509 + d0bc02f commit 0029420
Show file tree
Hide file tree
Showing 36 changed files with 794 additions and 30,538 deletions.
10 changes: 10 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
coverage:
status:
project: yes
patch: yes
changes: yes

comment:
layout: "header, diff"
behavior: default
require_changes: no
10 changes: 8 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,11 @@ indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.py]
max_line_length = 100
known_first_party = ptprashanttripathi
balanced_wrapping = true

[*.yml]
indent_size = 2
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

31 changes: 0 additions & 31 deletions .github/ABOUT.md

This file was deleted.

66 changes: 66 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
# Labels names are important as they are used by Release Drafter to decide
# regarding where to record them in changelog or if to skip them.
#
# The repository labels will be automatically configured using this file and
# the GitHub Action https://github.com/marketplace/actions/github-labeler.
- name: breaking
description: Breaking Changes
color: "bfd4f2"
- name: bug
description: Something isn't working
color: "d73a4a"
- name: build
description: Build System and Dependencies
color: "bfdadc"
- name: ci
description: Continuous Integration
color: "4a97d6"
- name: dependencies
description: Pull requests that update a dependency file
color: "0366d6"
- name: documentation
description: Improvements or additions to documentation
color: "0075ca"
- name: duplicate
description: This issue or pull request already exists
color: "cfd3d7"
- name: enhancement
description: New feature or request
color: "a2eeef"
- name: github_actions
description: Pull requests that update Github_actions code
color: "000000"
- name: good first issue
description: Good for newcomers
color: "7057ff"
- name: help wanted
description: Extra attention is needed
color: "008672"
- name: invalid
description: This doesn't seem right
color: "e4e669"
- name: performance
description: Performance
color: "016175"
- name: python
description: Pull requests that update Python code
color: "2b67c6"
- name: question
description: Further information is requested
color: "d876e3"
- name: refactoring
description: Refactoring
color: "ef67c4"
- name: removal
description: Removals and Deprecations
color: "9ae7ea"
- name: style
description: Style
color: "c120e5"
- name: testing
description: Testing
color: "b1fc6f"
- name: wontfix
description: This will not be worked on
color: "ffffff"
31 changes: 31 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
categories:
- title: ":boom: Breaking Changes"
label: "breaking"
- title: ":rocket: Features"
label: "enhancement"
- title: ":fire: Removals and Deprecations"
label: "removal"
- title: ":beetle: Fixes"
label: "bug"
- title: ":raising_hand: Help wanted"
label: "help wanted"
- title: ":racehorse: Performance"
label: "performance"
- title: ":rotating_light: Testing"
label: "testing"
- title: ":construction_worker: Continuous Integration"
label: "ci"
- title: ":books: Documentation"
label: "documentation"
- title: ":hammer: Refactoring"
label: "refactoring"
- title: ":lipstick: Style"
label: "style"
- title: ":package: Dependencies"
labels:
- "dependencies"
- "build"
template: |
## Changes
$CHANGES
18 changes: 18 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Labeler

on:
push:
branches:
- main

jobs:
labeler:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3

- name: Run Labeler
uses: crazy-max/ghaction-github-labeler@v4
with:
skip-delete: true
14 changes: 14 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Release Drafter

on:
push:
branches:
- release

jobs:
draft_release:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Report Coverage
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Report Coverage
uses: codecov/codecov-action@v1
2 changes: 1 addition & 1 deletion .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Update Data

on:
schedule:
- cron: "0 0 1 * *" # every 1st day of the month
- cron: "0 0 1 * *" # every 1st day of the month
workflow_dispatch:

jobs:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,4 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

62 changes: 28 additions & 34 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,36 +1,30 @@
exclude: .idea/
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: check-json
- id: check-yaml
- id: check-toml
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
language_version: python3
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args:
[
"--order-by-type",
"--length-sort",
"--filter-files",
"--float-to-top",
"black",
]
name: isort (python)
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: check-json
- id: check-yaml
- id: check-toml
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
language_version: python3
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args:
["--order-by-type", "--length-sort", "black"]
name: isort (python)

- repo: https://github.com/nbQA-dev/nbQA
rev: 1.8.7
hooks:
- id: nbqa-black
- id: nbqa-pyupgrade
args: ["--py37-plus"]
- id: nbqa-isort
args: ["--float-to-top"]
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.8.7
hooks:
- id: nbqa-black
- id: nbqa-pyupgrade
args: ["--py37-plus"]
- id: nbqa-isort
args:
["--order-by-type", "--length-sort", "black"]
54 changes: 0 additions & 54 deletions .vscode/launch.json

This file was deleted.

21 changes: 21 additions & 0 deletions DATA/SOURCE/Holdings/HoldingsHistory_data.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
segment,exchange,symbol,min_date,max_date,isin
EQ,NSE,BAJAJHFL,2024-09-13,2024-09-20,INE377Y01014
EQ,NSE,BHAGERIA,2020-05-05,2020-06-14,INE354C01027
EQ,NSE,BPCL,2021-08-06,2022-08-09,INE029A01011
EQ,NSE,GOLDBEES,2021-02-09,2021-06-03,INF204KB17I5
EQ,NSE,HERANBA,2021-03-04,2021-03-08,INE694N01015
EQ,NSE,IDEA,2020-07-29,2021-06-13,INE669E01016
EQ,NSE,INFY,2021-04-12,2021-06-13,INE009A01021
EQ,NSE,IRCTC,2024-06-04,2024-09-20,INE335Y01020
EQ,NSE,KPITTECH,2024-06-13,2024-09-20,INE04I401011
EQ,NSE,LICI,2022-05-13,2022-08-09,INE0J1Y01017
EQ,NSE,NIFTYBEES,2021-02-09,2021-06-13,INF204KB14I2
EQ,NSE,PNB,2020-07-29,2021-06-13,INE160A01022
EQ,NSE,SBIN,2021-05-10,2021-06-03,INE062A01020
EQ,NSE,TATACHEM,2021-06-15,2022-08-09,INE092A01019
EQ,NSE,TATAMOTORS,2020-04-21,2024-09-20,INE155A01022
EQ,NSE,TATAPOWER,2021-02-08,2024-09-20,INE245A01021
EQ,NSE,VOLTAS,2021-06-15,2022-08-09,INE226A01021
EQ,NSE,YESBANK,2020-07-27,2021-11-09,INE528G01035
MF,BMF,MIRAE_ASSET_ELSS_TAX_SAVER_FUND_DIRECT_PLAN_GROWTH,2024-05-24,2024-09-20,INF769K01DM9
MF,BMF,SBI_LONG_TERM_EQUITY_FUND_DIRECT_PLAN_GROWTH,2024-05-24,2024-09-20,INF200K01UM9
7 changes: 3 additions & 4 deletions ETLTOOLS/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#!/usr/bin/env python

from . import version, portfolio, globalpath, datetimeutils

from .portfolio import *
from .globalpath import *
from . import datetimeutils, globalpath, portfolio, version
from .datetimeutils import *
from .globalpath import *
from .portfolio import *

__doc__ = f"""PortfolioTracker v{version.VERSION}- ETL TOOL KIT
https://ptprashanttripathi.github.io/PortfolioTracker
Expand Down
4 changes: 2 additions & 2 deletions ETLTOOLS/portfolio/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from typing import Dict, List, Union, Optional
from datetime import datetime, time
from typing import Dict, List, Optional, Union

__all__ = [
"Portfolio",
Expand Down Expand Up @@ -508,7 +508,7 @@ def get_pnl(self) -> List[Dict]:
"close_side": position.close_side,
"close_price": position.close_price,
"close_amount": position.close_amount,
"position":position.position,
"position": position.position,
"pnl_amount": position.pnl_amount,
"pnl_percentage": position.pnl_percentage,
}
Expand Down
7 changes: 3 additions & 4 deletions ETLTOOLS/portfolio/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
portfolio.check_expired_stocks()
import pandas as pd


print("Holding history\n",pd.DataFrame(portfolio.get_holdings_history()))
print("Current Holdings\n",pd.DataFrame(portfolio.get_current_holdings()))
print("PNL history\n",pd.DataFrame(portfolio.get_pnl()))
print("Holding history\n", pd.DataFrame(portfolio.get_holdings_history()))
print("Current Holdings\n", pd.DataFrame(portfolio.get_current_holdings()))
print("PNL history\n", pd.DataFrame(portfolio.get_pnl()))
Loading

0 comments on commit 0029420

Please sign in to comment.