Skip to main content

A simple finance data fetching library for Naver Finance data.

Project description

text

nfinance

nfinance/
│
├── nfinance/
│   ├── __init__.py
│   └── stock_data.py
│   └── stock_listing.py
│   └── rsi.py
│   └── financials.py
│
├── tests/
│   ├── __init__.py
│   └── test_stock_data.py
│
├── .gitignore
├── LICENSE
├── README.md
├── requirements.txt
└── setup.py

1. 설명

stock_data.py는 네이버 파이낸스의 데이터를 가져오는 Python 라이브러리입니다. stock_listing.py는 네이버 파이낸스의 종목 list를 가져오는 Python 라이브러리입니다. rsi.py는 Relative Strength Index를 구하는 Python 라이브러리입니다.

2. 설치 방법

pip install nfinance

3-1. 사용 예제

import nfinance as nf

ticker = '005930'  # Samsung Electronics Co., Ltd
start_date = '2023-01-01'
end_date = '2023-05-01'

try:
    data = nf.download(ticker, start_date, end_date)
    print(data.head())
except Exception as e:
    print(e)

3-2. 사용 예제

import nfinance as nf

# 코스피 전체 주식 목록 가져오기
stocks_kospi = nf.StockListing('KOSPI')
df_kospi = stocks_kospi.fetch_stocks()
print(df_kospi)

# 코스닥 전체 주식 목록 가져오기
stocks_kosdaq = nf.StockListing('KOSDAQ')
df_kosdaq = stocks_kosdaq.fetch_stocks()
print(df_kosdaq)

3-3. 사용 예제

import nfinance

df_annual = nfinance.get_annual_financial('005930')  # 예시: 삼성전자 코드
print(df_annual)
print("df_annual['2019/12']['매출액']", df_annual['2019/12']['매출액'])
print("df_annual.loc['매출액']", df_annual.loc['매출액'])
print("df_annual.loc['매출액'].tolist()", df_annual.loc['매출액'].tolist())

4. LICENSE

MIT 라이선스를 예로 듭니다. 실제로 사용하려면 올바른 라이선스를 선택해야 합니다.

MIT License

Copyright (c) 2024 lega001

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nfinance-0.4.11.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nfinance-0.4.11-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file nfinance-0.4.11.tar.gz.

File metadata

  • Download URL: nfinance-0.4.11.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.12

File hashes

Hashes for nfinance-0.4.11.tar.gz
Algorithm Hash digest
SHA256 e8f7d50e36fc0e8b8c83930cd35cbb76ac154be9b9a9f87e4e36d5747dd4aaa3
MD5 2cba29b94f436fdfe5b39c1bf033faff
BLAKE2b-256 af136872f2e2561f7ddfff623fcc0e851868583ea22b743fe301cdcdc5da1828

See more details on using hashes here.

File details

Details for the file nfinance-0.4.11-py3-none-any.whl.

File metadata

  • Download URL: nfinance-0.4.11-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.12

File hashes

Hashes for nfinance-0.4.11-py3-none-any.whl
Algorithm Hash digest
SHA256 e554813ee50a986d192e9c9bc9bde9a314d94e10f8376721b15cc5c7d3ca6018
MD5 51a63a13b486830b75ab991e7a15b778
BLAKE2b-256 53c23f9a65306a4a6957aa5bad61d3783bb507ca8c3016acd0db9e2b91c84c72

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page