Metadata-Version: 2.1
Name: quool
Version: 2.0.0
Summary: Quantitative Toolkit - a helper in quant developping
Home-page: https://github.com/ppoak/quool
Author: ppoak
Author-email: ppoak@foxmail.com
Keywords: quant,framework,finance
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: bs4
Requires-Dist: tqdm
Requires-Dist: lxml
Requires-Dist: numpy
Requires-Dist: numba
Requires-Dist: joblib
Requires-Dist: pandas
Requires-Dist: pyarrow
Requires-Dist: requests
Requires-Dist: matplotlib
Requires-Dist: backtrader

# Quool

![Python](https://img.shields.io/badge/Python-FFD43B?style=for-the-badge&logo=python&logoColor=blue) ![Numpy](https://img.shields.io/badge/Numpy-777BB4?style=for-the-badge&logo=numpy&logoColor=white) ![Pandas](https://img.shields.io/badge/Pandas-2C2D72?style=for-the-badge&logo=pandas&logoColor=white) ![Wechat](https://img.shields.io/badge/WeChat-07C160?style=for-the-badge&logo=wechat&logoColor=white)


# Financial Data Analysis Toolkit

This toolkit provides a comprehensive suite of modules for financial data analysis, including web requests, data processing, and logging. Designed with ease of use and efficiency in mind, it's an ideal solution for analysts and developers working in financial data analytics.

## Features

* **Request Module** : Interfaces with various financial data APIs and web scraping for stock market information.
* **Tool Module** : A collection of utility functions for data parsing, logging, memory optimization, and more.
* **Custom Logging** : Enhanced logging capabilities for both console and file output with customizable formats.

## Modules

### 1. Request Module

Handles various types of web requests and interactions with APIs. It includes classes for:

* **AkShare** : Fetching financial data using the AkShare API.
* **Em** : Interacting with East Money (东方财富网) for financial data and analysis.
* **StockUS** : Accessing US stock market data and research reports.
* **WeiXin** : Interfacing with WeChat for functionalities like QR code-based login and notifications.

### 2. Tool Module

Provides utility functions and classes to support operations such as:

* **Logger** : Enhanced logging with configurable display options.
* **Date Parsing** : Converts date strings into `pandas.Timestamp` objects.
* **Memory Optimization** : Reduces memory usage of pandas DataFrames.

## Installation

To use this toolkit, clone the repository to your local machine:

<pre><div class="bg-black rounded-md"><div class="flex items-center relative text-gray-200 bg-gray-800 dark:bg-token-surface-primary px-4 py-2 text-xs font-sans justify-between rounded-t-md"><span>bash</span><span class="" data-state="closed"><button class="flex gap-1 items-center"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="icon-sm"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 4C10.8954 4 10 4.89543 10 6H14C14 4.89543 13.1046 4 12 4ZM8.53513 4C9.22675 2.8044 10.5194 2 12 2C13.4806 2 14.7733 2.8044 15.4649 4H17C18.6569 4 20 5.34315 20 7V19C20 20.6569 18.6569 22 17 22H7C5.34315 22 4 20.6569 4 19V7C4 5.34315 5.34315 4 7 4H8.53513ZM8 6H7C6.44772 6 6 6.44772 6 7V19C6 19.5523 6.44772 20 7 20H17C17.5523 20 18 19.5523 18 19V7C18 6.44772 17.5523 6 17 6H16C16 7.10457 15.1046 8 14 8H10C8.89543 8 8 7.10457 8 6Z" fill="currentColor"></path></svg>Copy code</button></span></div><div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash">git clone https://github.com/ppoak/quool
</code></div></div></pre>

## Usage

Here's a quick example of how to use the `AkShare` class to fetch daily market data:

<pre><div class="bg-black rounded-md"><div class="flex items-center relative text-gray-200 bg-gray-800 dark:bg-token-surface-primary px-4 py-2 text-xs font-sans justify-between rounded-t-md"><span>python</span><span class="" data-state="closed"><button class="flex gap-1 items-center"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="icon-sm"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 4C10.8954 4 10 4.89543 10 6H14C14 4.89543 13.1046 4 12 4ZM8.53513 4C9.22675 2.8044 10.5194 2 12 2C13.4806 2 14.7733 2.8044 15.4649 4H17C18.6569 4 20 5.34315 20 7V19C20 20.6569 18.6569 22 17 22H7C5.34315 22 4 20.6569 4 19V7C4 5.34315 5.34315 4 7 4H8.53513ZM8 6H7C6.44772 6 6 6.44772 6 7V19C6 19.5523 6.44772 20 7 20H17C17.5523 20 18 19.5523 18 19V7C18 6.44772 17.5523 6 17 6H16C16 7.10457 15.1046 8 14 8H10C8.89543 8 8 7.10457 8 6Z" fill="currentColor"></path></svg>Copy code</button></span></div><div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-python">import quool.request as qr
daily_data = qr.AkShare.market_daily('600000', start='20200101', end='20201231')
</code></div></div></pre>

For logging:

<pre><div class="bg-black rounded-md"><div class="flex items-center relative text-gray-200 bg-gray-800 dark:bg-token-surface-primary px-4 py-2 text-xs font-sans justify-between rounded-t-md"><span>python</span><span class="" data-state="closed"><button class="flex gap-1 items-center"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="icon-sm"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 4C10.8954 4 10 4.89543 10 6H14C14 4.89543 13.1046 4 12 4ZM8.53513 4C9.22675 2.8044 10.5194 2 12 2C13.4806 2 14.7733 2.8044 15.4649 4H17C18.6569 4 20 5.34315 20 7V19C20 20.6569 18.6569 22 17 22H7C5.34315 22 4 20.6569 4 19V7C4 5.34315 5.34315 4 7 4H8.53513ZM8 6H7C6.44772 6 6 6.44772 6 7V19C6 19.5523 6.44772 20 7 20H17C17.5523 20 18 19.5523 18 19V7C18 6.44772 17.5523 6 17 6H16C16 7.10457 15.1046 8 14 8H10C8.89543 8 8 7.10457 8 6Z" fill="currentColor"></path></svg>Copy code</button></span></div><div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-python">import quool.tool import qt
logger = qt.Logger(name="MyLogger", level=logging.INFO, file="log.txt")
logger.info("This is an info message")
</code></div></div></pre>

## Contributing

Contributions to improve this toolkit are welcome. Please fork the repository and submit a pull request with your changes.

## License

This project is licensed under [MIT License]().
