Python module to interact with stock data via Django API
Project description
Để đảm bảo bạn có thể dễ dàng copy toàn bộ nội dung Markdown vào file của bạn, tôi sẽ loại bỏ các khối mã thụt đầu dòng và cung cấp nội dung dạng text gọn gàng hơn:
CKVN
CKVN is a Python module that allows you to interact with stock market data through a Django-based API. It provides various functions to retrieve stock information, historical data, and more by making API calls.
Features
- Get stock information: Retrieve detailed information about a stock, including its name, symbol, and other metadata.
- Get historical stock data: Retrieve the stock data (OHLCV) for a given stock over a specified date range.
- Get stocks by market: Fetch stocks associated with a specific market (e.g., HOSE, HNX).
- Get API key info: Retrieve information about the API key, including expiration date and status.
- API key authentication: Use API keys to authenticate requests for accessing stock data.
Installation
You can install the ckvn module directly from PyPI using pip:
pip install ckvn
Usage
Getting Stock Information
You can retrieve information about a stock by symbol using the get_stock_info() function:
import ckvn
symbol = 'AAPL' # Example stock symbol
api_key = 'your_api_key'
stock_info = ckvn.get_stock_info(symbol, api_key)
print(stock_info)
Getting Historical Stock Data
To retrieve historical stock data (OHLCV) for a given stock symbol within a date range:
import ckvn
from datetime import datetime
symbol = 'AAPL'
api_key = 'your_api_key'
from_date = datetime(2020, 1, 1)
to_date = datetime(2021, 1, 1)
stock_data = ckvn.get_stock_data(symbol, from_date, to_date, api_key)
print(stock_data)
Getting Stocks by Market
You can fetch all stocks associated with a particular market:
import ckvn
market = 'HOSE' # Example market
api_key = 'your_api_key'
stocks = ckvn.get_stocks_by_market(market, api_key)
print(stocks)
Getting API Key Info
To retrieve information about your API key, such as expiration date, status, and other details, you can use the get_key_info() function:
import ckvn
api_key = 'your_api_key'
key_info = ckvn.get_key_info(api_key)
print(key_info)
Authentication
Each request made to the API requires an API key for authentication. Make sure to pass a valid API key when calling any of the functions above.
Contributing
We welcome contributions to this project! If you'd like to help, please fork the repository, make your changes, and submit a pull request. Be sure to follow the code of conduct and review the guidelines before contributing.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contact
If you have any questions or suggestions, feel free to reach out to us at [ckvnpro@gmail.com](mailto:ckvnpro@gmail.com).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ckvn-0.0.1.tar.gz.
File metadata
- Download URL: ckvn-0.0.1.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
883cdb2e75417a8061d63b209e0f7d24fb6601e2869035f91d8e978022972007
|
|
| MD5 |
d9ac94b143112e8ca76caaa70f256e6a
|
|
| BLAKE2b-256 |
7ad961a940de0bcde02694f0e306572766716d6e8949bc2467287731ee4a00a8
|
File details
Details for the file ckvn-0.0.1-py3-none-any.whl.
File metadata
- Download URL: ckvn-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b30989f7620fe1b722f2360f74704cd57893bb9a2d07e21d022e85a2f9018d31
|
|
| MD5 |
050cb46e548cdddf5308a13b75170df3
|
|
| BLAKE2b-256 |
f12383c4fc08e904f3d1830ff2b03df7d564a44e6e45a4755e40a8be973c4a44
|