Skip to content

MapleCCC/QuickFund

Repository files navigation

基金信息爬取与结构化器

License Build Status GitHub release (latest SemVer) Semantic release LOC Code Style GitHub commits since latest release (by SemVer)

TOC

Overview

A script to fetch various fund information from https://fund.eastmoney.com/, and structuralize into Excel document. It's a non-tech-savvy user oriented tool, not developer-oriented.

抓取天天基金信息,生成自定义表格。表头和样式可以在 quickfund/writter.py 自定义。

Installation

Prerequisites: Python 3.9+, Git, pip.

One-liner installation recipe:

$ python -m pip install git+https://github.com/MapleCCC/QuickFund.git@v1.4.0#egg=QuickFund

If editable mode installation is preferred:

# Optionally create a virtual environment for isolation purpose
$ python -m virtualenv .venv
$ source .venv/Scripts/activate

# Install in editable mode
$ python -m pip install -e git+https://github.com/MapleCCC/QuickFund.git@v1.4.0#egg=QuickFund

Usage

$ quickfund <A file containing a sequence of newline separated fund codes>

$ quickfund --help
Usage: quickfund [OPTIONS] <A file containing a sequence of newline
                           separated fund codes>

  A script to fetch various fund information from https://fund.eastmoney.com/,
  and structuralize into Excel document.

  Input file format: one fund code per line.

Options:
  -o, --output FILE  The output file path.  [default: 基金信息.xlsx]
  --no-color         Turn off the color output. For compatibility with
                     environment without color code support.
  --disable-cache
  --version          Show the version and exit.
  -h, --help         Show this message and exit.

Example Output

Example Output

Run

Exception Handling Graceful Degrade

Run ASCII

Download

Go to Release page.

Development

Prerequisites: Git, Python 3.9+, pip.

# Clone the repository to local environment
$ git clone https://github.com/MapleCCC/QuickFund.git

$ cd QuickFund

# Optionally create a virtual environment for isolation purpose
$ python -m virtualenv .venv
$ source .venv/Scripts/activate

# Install basic build requirements
$ python -m pip install -r requirements/install.txt

# Install dev requirements
$ python -m pip install -r requirements/dev.txt

$ python -m pip install -e .  # Mind the dot

Alternatively, just a one-liner:

# Optionally create a virtual environment for isolation purpose
$ python -m virtualenv .venv
$ source .venv/Scripts/activate

$ python -m pip install -e git+https://github.com/MapleCCC/QuickFund.git#egg=QuickFund

Test

The project uses pytest and hypothesis as test framework. Property-based testing is adopted in favor of its flexibility and conciseness.

# Install test requirements
$ python -m pip install -r requirements/test.txt

# unit tests
$ make test

Release Strategy

We follow semantic version convention. Every tag pushed to GitHub triggers a Release event. Release workflow (a GitHub action) proceeds and publishes built assets (along with SHA256 hash digest for secure verification).

We follow conventional commit message guideline.

Contribution

Go to issues to send issues or feedbacks. Pull requests are welcome.

License

This project is currently licensed under terms of MIT license. Feel free to contribute, fork, modify or redistribute.