Commit 825d422 1 parent 14bb6ef commit 825d422 Copy full SHA for 825d422
File tree 5 files changed +24
-8
lines changed
5 files changed +24
-8
lines changed Original file line number Diff line number Diff line change
1
+ ci :
2
+ autofix_commit_msg : |
3
+ [pre-commit.ci] auto fixes from pre-commit.com hooks
4
+ for more information, see https://pre-commit.ci
5
+ autofix_prs : true
6
+ autoupdate_commit_msg : ' [pre-commit.ci] pre-commit autoupdate'
7
+ autoupdate_schedule : weekly
8
+ skip : []
9
+ submodules : false
10
+
1
11
repos :
2
12
- repo : https://github.com/pre-commit/pre-commit-hooks
3
13
rev : v3.4.0
Original file line number Diff line number Diff line change 2
2
[ ![ code style: black] ( https://img.shields.io/badge/code%20style-black-000000.svg )] ( https://github.com/psf/black )
3
3
[ ![ GitHub] ( https://img.shields.io/github/license/kaushiksk/pyportfolio )] ( https://github.com/kaushiksk/pyportfolio/blob/main/LICENSE )
4
4
[ ![ Python package] ( https://github.com/kaushiksk/pyportfolio/actions/workflows/python-package.yml/badge.svg )] ( https://github.com/kaushiksk/pyportfolio/actions/workflows/python-package.yml )
5
+ [ ![ pre-commit.ci status] ( https://results.pre-commit.ci/badge/github/kaushiksk/pyportfolio/main.svg )] ( https://results.pre-commit.ci/latest/github/kaushiksk/pyportfolio/main )
5
6
6
7
Python package with a CLI to consolidate and analyze your investments (currently only supports mutual funds).
7
8
Original file line number Diff line number Diff line change 3
3
SCHEME_API_URL = "https://api.mfapi.in/mf/{code}"
4
4
session = requests .Session ()
5
5
6
+
6
7
def get_scheme_details (amfi_id ):
7
8
"""
8
9
gets the scheme info for a given scheme code
@@ -13,14 +14,15 @@ def get_scheme_details(amfi_id):
13
14
code = str (amfi_id )
14
15
url = SCHEME_API_URL .format (code = code )
15
16
response = session .get (url ).json ()
16
-
17
- scheme_info = response [' meta' ]
17
+
18
+ scheme_info = response [" meta" ]
18
19
if scheme_info :
19
- scheme_info [' nav' ] = response [' data' ][0 ]["nav" ]
20
+ scheme_info [" nav" ] = response [" data" ][0 ]["nav" ]
20
21
return scheme_info
21
-
22
+
22
23
return None
23
24
25
+
24
26
if __name__ == "__main__" :
25
27
print (get_scheme_details (119551 ))
26
- print (get_scheme_details (111 ))
28
+ print (get_scheme_details (111 ))
Original file line number Diff line number Diff line change 1
1
import logging
2
2
3
3
logging .basicConfig ()
4
- logger = logging .getLogger (' pyportfolio' )
4
+ logger = logging .getLogger (" pyportfolio" )
5
5
logger .setLevel (logging .INFO )
6
6
7
+
7
8
# Filter Utils
8
9
def and_filter (filters ):
9
10
return lambda x : all (f (x ) for f in filters )
10
11
12
+
11
13
def or_filter (filters ):
12
14
return lambda x : any (f (x ) for f in filters )
13
15
16
+
14
17
def filter_dict (mydict , keys ):
15
- return {key : mydict [key ] for key in keys }
18
+ return {key : mydict [key ] for key in keys }
Original file line number Diff line number Diff line change 1
1
import setuptools
2
2
3
3
if __name__ == "__main__" :
4
- setuptools .setup ()
4
+ setuptools .setup ()
You can’t perform that action at this time.
0 commit comments