libfinance is a modern finance API
Project description
libfinance
[ English | 中文 ]
libfinance is python library for accessing financial data easily. The goal of libfinance is to provide HIGH quality financial data for scholars, researchers and developers in research and production environment.
install
Method1: Install libfinance by pip
$ pip install libfinance
Method2: Install from source with a develop mode
git clone https://github.com/StateOfTheArt-quant/libfinance.git
cd libfinance
python -m pip install --editable .
quick-start
from libfinance import get_trading_dates, get_price
trading_dates = get_trading_dates(start_date="2023-12-25", end_date="2024-01-11")
print(trading_dates)
DatetimeIndex(['2023-12-25', '2023-12-26', '2023-12-27', '2023-12-28',
'2023-12-29', '2024-01-02', '2024-01-03', '2024-01-04',
'2024-01-05', '2024-01-08', '2024-01-09', '2024-01-10',
'2024-01-11'],
dtype='datetime64[ns]', freq=None)
data = get_price(order_book_ids=["000001.XSHE","600000.XSHG"], start_date="2024-03-01", end_date="2024-03-11")
print(data)
open high low close volume
order_book_id datetime
000001.XSHE 2024-03-01 10.59 10.60 10.43 10.49 182810290.0
2024-03-04 10.45 10.50 10.32 10.33 165592954.0
2024-03-05 10.30 10.47 10.26 10.43 181731907.0
2024-03-06 10.40 10.45 10.33 10.33 134564016.0
2024-03-07 10.33 10.64 10.33 10.38 201616589.0
2024-03-08 10.35 10.44 10.30 10.38 111397428.0
2024-03-11 10.38 10.47 10.34 10.47 121067298.0
600000.XSHG 2024-03-01 7.13 7.16 7.10 7.11 29431801.0
2024-03-04 7.12 7.12 7.05 7.07 27855963.0
2024-03-05 7.05 7.18 7.04 7.16 41756232.0
2024-03-06 7.17 7.22 7.12 7.12 25918749.0
2024-03-07 7.12 7.20 7.11 7.14 24690348.0
2024-03-08 7.12 7.17 7.11 7.12 19861794.0
2024-03-11 7.13 7.17 7.06 7.11 26195498.0
Documentation
More info for Documentation
Join us community
Join us WeChat Official Accounts to get the libfinance updated info:
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 libfinance-0.0.6.tar.gz.
File metadata
- Download URL: libfinance-0.0.6.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c40906497e9956a1f16f542fe2e8716f3034552920f9314f4cafd9db62bc4221
|
|
| MD5 |
d9ffa89440a551d4837df351c6e4d8f5
|
|
| BLAKE2b-256 |
f399e5aa153c671a86c25e086b5a3753fff68c7b3157090d4db45ebe5a196eb9
|
Provenance
The following attestation bundles were made for libfinance-0.0.6.tar.gz:
Publisher:
python-publish.yml on StateOfTheArt-quant/libfinance
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
libfinance-0.0.6.tar.gz -
Subject digest:
c40906497e9956a1f16f542fe2e8716f3034552920f9314f4cafd9db62bc4221 - Sigstore transparency entry: 189653226
- Sigstore integration time:
-
Permalink:
StateOfTheArt-quant/libfinance@fde7bfae96f2521b0300c6a3c79da76e7316b8b1 -
Branch / Tag:
refs/tags/v0.0.6 - Owner: https://github.com/StateOfTheArt-quant
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@fde7bfae96f2521b0300c6a3c79da76e7316b8b1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file libfinance-0.0.6-py3-none-any.whl.
File metadata
- Download URL: libfinance-0.0.6-py3-none-any.whl
- Upload date:
- Size: 20.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18f33b107b3bd4f1f69cd56bebf407b4d70c19bd129806111f800a8a6f3adc89
|
|
| MD5 |
dcf17666968573f2058c70d54cdeabc0
|
|
| BLAKE2b-256 |
ec6ecd7d169d80f96911a130d143f5cdb379cf53f506ae8a0f33b5912eb9ebb7
|
Provenance
The following attestation bundles were made for libfinance-0.0.6-py3-none-any.whl:
Publisher:
python-publish.yml on StateOfTheArt-quant/libfinance
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
libfinance-0.0.6-py3-none-any.whl -
Subject digest:
18f33b107b3bd4f1f69cd56bebf407b4d70c19bd129806111f800a8a6f3adc89 - Sigstore transparency entry: 189653229
- Sigstore integration time:
-
Permalink:
StateOfTheArt-quant/libfinance@fde7bfae96f2521b0300c6a3c79da76e7316b8b1 -
Branch / Tag:
refs/tags/v0.0.6 - Owner: https://github.com/StateOfTheArt-quant
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@fde7bfae96f2521b0300c6a3c79da76e7316b8b1 -
Trigger Event:
release
-
Statement type: