{"id":16641128,"url":"https://github.com/suminb/finance","last_synced_at":"2025-06-14T13:32:58.428Z","repository":{"id":8206765,"uuid":"27952702","full_name":"suminb/finance","owner":"suminb","description":"경제적 자유로의 여정","archived":false,"fork":false,"pushed_at":"2024-06-04T15:51:56.000Z","size":3268,"stargazers_count":131,"open_issues_count":20,"forks_count":10,"subscribers_count":20,"default_branch":"develop","last_synced_at":"2025-04-09T20:08:21.128Z","etag":null,"topics":["bonds","cagr","finance","investment","python","stock"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-4-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/suminb.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-12-13T07:05:31.000Z","updated_at":"2025-01-18T22:10:07.000Z","dependencies_parsed_at":"2023-01-13T16:23:45.755Z","dependency_job_id":"c8712310-25d2-45e2-bd80-b69322ea3c2a","html_url":"https://github.com/suminb/finance","commit_stats":{"total_commits":688,"total_committers":5,"mean_commits":137.6,"dds":0.03197674418604646,"last_synced_commit":"7f4d1d89c8a976cb5e314bcfc28b37bace7faa3b"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suminb%2Ffinance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suminb%2Ffinance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suminb%2Ffinance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suminb%2Ffinance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suminb","download_url":"https://codeload.github.com/suminb/finance/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103873,"owners_count":21048245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bonds","cagr","finance","investment","python","stock"],"created_at":"2024-10-12T07:45:20.955Z","updated_at":"2025-04-09T20:08:27.357Z","avatar_url":"https://github.com/suminb.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Personal Finance Project\n========================\n\n.. image:: https://travis-ci.org/suminb/finance.svg?branch=develop\n   :target: https://travis-ci.org/suminb/finance\n\n.. image:: https://coveralls.io/repos/github/suminb/finance/badge.svg?branch=develop\n   :target: https://coveralls.io/github/suminb/finance?branch=develop\n\n.. image:: https://sonarcloud.io/api/project_badges/measure?project=finance\u0026metric=alert_status\n   :target: https://sonarcloud.io/dashboard?id=finance\n\nNOTE: 제가 주로 사용하는 에디터인 vim 에서 한글 타이핑이 불편하기 때문에 영어로\n문서를 작성하는 것이 일반적이지만, 이 프로젝트의 경우 한국어를 사용하는 청중이\n대부분인 관계로 문서를 한국어로 작성합니다.\n\n.. figure:: https://github.com/suminb/finance/raw/develop/moving_average.png\n    :align: center\n    :alt: Moving Average\n\n목표\n----\n이 프로젝트의 목적은 크게 네 가지입니다.\n\n#. 거래 내역 관리, 포트폴리오 시각화 등 자산 현황 파악하기.\n#. 종목 리서치에 필요한 기능 제공하기.\n#. 미리 설정해놓은 조건을 만족할 경우 알람 보내기.\n#. 자동으로 거래하기. (먼 미래의 이야기)\n\n\n비전\n----\n`NDC 2016 - 프로그래머가 투자하는 법 \u003chttp://www.slideshare.net/suminb/how-programmers-invest\u003e`_\n\n현재 연구중인 주제\n------------------\n- Currency exchange rate tracking\n- Asset rebalancing\n- Dual models: Database, ``DataFrame``\n\n잠시 뒤로 미루어둔 주제\n-----------------------\n- 총 자산 가치 추적\n- 자산 가격 받아오기: 여러가지 데이터 소스로부터 금융 자산 가격 정보를\n  받아옵니다.\n\n  - 주식: `야후 파이낸스 \u003chttp://finance.yahoo.com\u003e`_\\ 에서 받아옵니다. 20분\n    지연된 정보이긴 하지만, 일 단위 가격을 받아오는 것이기 때문에 지연 시간은\n    중요하지 않습니다.\n  - 펀드: 금융투자협회(KOFIA)에 공시된 정보를 받아옵니다.\n\n- `수익률 계산 \u003chttps://github.com/suminb/finance/wiki/%EC%88%98%EC%9D%B5%EB%A5%A0-%EA%B3%84%EC%82%B0\u003e`_\n- `전자공시데이터(DART) 가져오기 \u003chttps://github.com/suminb/finance/issues/1\u003e`_\n\n앞으로 할 일, 하지 않을 일\n--------------------------\n- 자동으로 데이터 받아오기: 주식, 펀드 가격 등 거래소에 공시되는 가격을\n  주기적으로 받아오는 무언가를 만들어야 합니다. 사용할 도구로는 AWS Lambda가\n  적당해보입니다.\n- 달력을 다루는 도구 제공: 업무일(business days)은 국가와 지역마다 다를 수\n  있습니다. 시차도 존재합니다. 따라서 여러 지역 시장에 투자할 경우 날짜, 시간\n  정보를 효율적으로 다룰 수 있어야 합니다.\n- 웹 인터페이스는 당분간 만들지 않을 예정입니다. 그대신 `주피터 노트북\n  \u003chttps://jupyter.org\u003e`_\\ 에서 쉽게 사용할 수 있는 함수들을 제공하는데 집중할\n  예정입니다.\n\n(TODO: 내용 계속 채워넣기)\n\nDaily Net Asset Values\n**********************\n\n매일 총 자산 가치(net asset value; NAV)를 합산하여 그래프로 보여줍니다. 이는\n펀드의 단위 가격을 산정하는데 필수적인 데이터입니다.\n\n(TODO: Prepare an illustration)\n\n자산이 한가지 화폐 단위로 표기되는 경우에는 큰 어려움이 없습니다. 만약, 한국\n주식만 보유하고 있다면 보유 종목의 총 가치와 원화 잔고를 합친 값이 총 자산\n가치가 됩니다.\n\n만약 다양한 화폐 단위로 표기되는 자산을 보유하고 있다면 가치 척도의 기준이 되는\n화폐\\ [1]_\\ 를 정하고 그 화폐 기준으로 가치를 표기합니다. 예를 들어서, 한국\n주식과 미국 주식을 보유하고 있고, 기준 화폐가 미국 달러(USD)라면 한국 주식\n가격을 USD로 변환해서 합산해야 합니다.\n\n.. [1] 코드에서는 ``base asset`` 이라는 이름으로 부르고 있지만, 더 적당한 용어가\n   있다면 그것으로 대체할 용의가 있습니다.\n\nUsage\n-----\n\n(TODO: 사용법 계속 채워넣기)\n\nSearch For Listings On Naver Finance\n************************************\n\n.. code::\n\n   \u003e\u003e\u003e from finance.ext.search import search_listings\n   \u003e\u003e\u003e results = search_listings(\"naver\", \"KODEX\")\n   \u003e\u003e\u003e next(results)\n   Listing(069500, KODEX 200, https://finance.naver.com/item/main.nhn?code=069500)\n   \u003e\u003e\u003e next(results)\n   Listing(091160, KODEX 반도체, https://finance.naver.com/item/main.nhn?code=091160)\n   \u003e\u003e\u003e next(results)\n   Listing(091170, KODEX 은행, https://finance.naver.com/item/main.nhn?code=091170)\n   \u003e\u003e\u003e # Or, we could make it as a list\n   \u003e\u003e\u003e listings = list(results)\n\nFetch Company Profiles From Naver Finance\n*****************************************\n\n.. code::\n\n   \u003e\u003e\u003e from finance.ext.profile import fetch_profile\n   \u003e\u003e\u003e profile = fetch_profile(\"naver\", \"063170\")\n   \u003e\u003e\u003e profile.name\n   서울옥션\n   \u003e\u003e\u003e profile.current_price\n   4300\n   \u003e\u003e\u003e profile.eps\n   -494\n   \u003e\u003e\u003e profile.bps\n   4290\n\nFetch Financial Statements From DART (전자공시)\n***********************************************\n\n.. code::\n\n   from finance.ext.dart import FinancialStatementRequest\n\n   fs = FinancialStatementRequest()\n   statements = fs.fetch(\n       \"00788773\", 2020, \"11012\", \"OFS\",\n       categorization_level1_key=\"fs_name\",\n       categorization_level2_key=\"account_name\")\n\n   statements[\"포괄손익계산서\"][\"당기순이익\"].amount\n\n   balance_sheet = statements[\"재무상태표\"]\n   debt_ratio = balance_sheet[\"부채총계\"].amount / balance_sheet[\"자본총계\"].amount\n\n.. code::\n\n   from finance.ext.dart import get_listed_corporations, search_corporations\n\n   get_listed_corporations()\n   search_corporations(\"NAVER\")\n\nSome Technical Details\n----------------------\n\nCreate Tables\n*************\n\n.. code::\n\n   finance create_all\n\nInsert Test Data\n****************\n\n.. code::\n\n   finance insert_test_data\n\nImport Stock Values\n*******************\n\n.. code::\n\n   finance fetch_stock_values 009830.KS | finance import_stock_values 009830.KS\n\nThe ``fetch_stock_values`` command strictly fetches data from Google Finance\nas CSV, and the ``import_stock_values`` imports the structured data into the\ndatabase.\n\nPostgreSQL in Docker\n********************\n\n.. code::\n\n    docker run -d \\\n        -p 5432:5432 -e POSTGRES_USER=postgres \\\n        -e POSTGRES_PASSWORD=qwerasdf \\\n        -e POSTGRES_DB=finance \\\n        -v $HOME/postgres:/var/lib/postgresql/data \\\n        -t postgres:10\n\npsycopg2 on Mac\n***************\n\nIf you fail to build the ``psycopg2`` package on Mac OS X with an error\nmessage saying the following,\n\n.. code::\n\n    ld: library not found for -lssl\n\nYou may want to build ``pscycopg2`` as follows:\n\n.. code::\n\n    env LDFLAGS=\"-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib\" pip install psycopg2\n\nThat's assuming you have ``openssl`` installed in your system. If you are\nusing ``brew`` you may install ``openssl`` as following:\n\n.. code::\n\n    brew install openssl\n\nSonarCloud with Travis CI\n*************************\n\nSet ``SONAR_TOKEN`` environment variable on Travis CI repository settings.\nRefer `this document \u003chttps://docs.travis-ci.com/user/sonarcloud/\u003e`_ for more\ndetails. Then you will need to set up ``sonar-project.properties`` file as\ndescribed `here\n\u003chttps://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner\u003e`_.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuminb%2Ffinance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuminb%2Ffinance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuminb%2Ffinance/lists"}