Skip to main content

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:

ds

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

libfinance-0.0.6.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

libfinance-0.0.6-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

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

Hashes for libfinance-0.0.6.tar.gz
Algorithm Hash digest
SHA256 c40906497e9956a1f16f542fe2e8716f3034552920f9314f4cafd9db62bc4221
MD5 d9ffa89440a551d4837df351c6e4d8f5
BLAKE2b-256 f399e5aa153c671a86c25e086b5a3753fff68c7b3157090d4db45ebe5a196eb9

See more details on using hashes here.

Provenance

The following attestation bundles were made for libfinance-0.0.6.tar.gz:

Publisher: python-publish.yml on StateOfTheArt-quant/libfinance

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for libfinance-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 18f33b107b3bd4f1f69cd56bebf407b4d70c19bd129806111f800a8a6f3adc89
MD5 dcf17666968573f2058c70d54cdeabc0
BLAKE2b-256 ec6ecd7d169d80f96911a130d143f5cdb379cf53f506ae8a0f33b5912eb9ebb7

See more details on using hashes here.

Provenance

The following attestation bundles were made for libfinance-0.0.6-py3-none-any.whl:

Publisher: python-publish.yml on StateOfTheArt-quant/libfinance

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page