Skip to main content

Factor

This is a framework for factor mining and evaluating. The data backend is from anthor quantative tool repository named parquool, see parquool for more information.

Installation

You can simple click download file in zip format on github, or you can use git command line if you want:

git clone git@github.com:ppoak/factool

Quick Start

Factor Source

Factor source is managed by parquool.DuckParquet, which provides a easy and simple way to manage factor data completely offline by your own computer. DuckParquet provides a series of sql-like interfaces, you can simple create a DuckParquet directory by using DuckParquet(path).upsert_from_df(df). And you can also select with where clause, order by clause, etc.

Factor Computing

You can simply create a function starts with calc_ and add the real factor script name to it in a python file. For example, if you want to create a market_size function, which calculate the log market size factor and non-linear market size factor. You can just create one script named market_size.py with one function called calc_market_size. Then by running calc function in calc.py, pass the path to the market_size.py to it, it will compute and save the result to the directory where your environment variable FACTOR_DATA_PATH points to.

Factor Evaluating

To evaluate a factor, you need to tell the evaluate funciton where your factor DuckParquet path is and your k-line data for computing returns of the market. Moreover, if you want to see the performance of the benchmark, you can also assign the benchmark code to the function. If the parameters above are not set, the funciont will automatically find them in environment variable: QUOTESDAY_PATH, INDEXQUOTESDAY_PATH. And the result output will be EVAL_PATH. The result is composed with one excel file with two sheets, one for ic time series, and one for evaluation result. And the other result is ic time-series image and net value of grouping result with benchmark value if set.

Automation

All the processes above can be set in an automatic way. The scritp/agent.py and script/web.py file provide a terminal and web interface for using AI models in calculating and evaluating factors.

For the cli, you can simply input a factor definition markdown file path to the command. All the process will be run automatically. As for the web, just explore it!

Metadata

Release files for facttool 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for facttool 0.0.1
File Size Uploaded
facttool-0.0.1.tar.gz 20.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for facttool 0.0.1
File Interpreter ABI Platform
facttool-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 40.0 kB

Release files / facttool-0.0.1.tar.gz

Download URL facttool-0.0.1.tar.gz
Size 20.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c3ce7fa3fde29104043640a6675f2899ea330966ddc9a70e43a78b0c57c81d53
BLAKE2b-256 checksum
How to use checksums
708031e1a8b16184b22c72449a1c17a05691ff9128bfa9e4eb9f7ca9db0b8470
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / facttool-0.0.1-py3-none-any.whl

Download URL facttool-0.0.1-py3-none-any.whl
Size 19.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d0dc203668c067e2929e4424652ed66c19234cae5394d302c48918ebc5b1bd2d
BLAKE2b-256 checksum
How to use checksums
9eb1d671f9b4196fa5ec41a8c2469b466566029986518a4af7df2053183c2cc8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page