SDK for the QuickFS API
Project description
QuickFS API SDK
Contents
General description :arrow_up:
This library is the Python :snake: unofficial SDK for the QuickFS REST API. It's intended to be used for data extraction for financial valuations.
Requirements :arrow_up:
- You need to request an API key with the QuickFS team. Create your account in the following link
Python
>= 3.8
Installation :arrow_up:
pip install quickfs
Demo :arrow_up:
The endpoints of the API will let you request fundamental data for your financial valuation. Here is a demo of its use:
from quickfs import QuickFS
import os
# load the key from the enviroment variables
api_key = os.environ['API_QUICKFS']
client = QuickFS(api_key)
# Request reference data for the supported companies
resp = client.get_api_metadata()
resp = client.get_supported_companies(country='US', exchange='NYSE')
resp = client.get_updated_companies(country='US', date='20210420')
# Available metrics in the API
resp = client.get_available_metrics()
# Request fundamental data for each company
resp = client.get_data_range(symbol='AAPL:US', metric='shares_eop', period='FQ-15:FQ')
resp = client.get_data_full(symbol='AAPL:US')
resp = client.get_data_batch(companies=['KO:US', 'PEP:US'], metrics=['roa', 'roic'], period="FY-2:FY")
# Usage history
resp = client.get_usage()
tutorial on how to save and load environment variables in Python -> Hiding Passwords and Secret Keys in Environment Variables (Windows)
Documentation :arrow_up:
All the methods will use the following instance of the general class:
from quickfs import QuickFS
import os
# load the key from the enviroment variables
api_key = os.environ['API_QUICKFS']
# client instance
client = QuickFS(api_key)
Companies :arrow_up:
get_api_metadata
: Returns the available countries and exchanges where to get data.- arguments:*
None
- usage:
- arguments:*
# get the metadata for the countries and exchanges.
client.get_api_metadata()
get_supported_companies
: Returns a list of ticker symbols supported by QuickFS. You need to specify a country code (US, CA, MM, AU, NZ, MN, or LN). It is recommendable to use theget_api_metadata
to get the references for each argument.- arguments:
- country(str): quickfs code of the country to request data.
- exchange(str): quickfs code of the exchange to request data.
- usage:
- arguments:
# get the companies for the NYSE exchange
NYSE = client.get_supported_companies(country='US', exchange='NYSE')
# get the companies for the LSE
LSE = client.get_supported_companies(country='LN', exchange='LONDON')
# get the companies from Australia
ASX = resp = client.get_supported_companies(country='AU', exchange='ASX')
get_updated_companies
: Returns a list of ticker symbols that were updated with new financial data on or after the specified date (formatted as YYYYMMDD). You need to specify a country code (US, CA, MM, AU, NZ, MN, or LN).- arguments:
- country(str): quickfs code of the country to request data.
- date(str): specific date to request data, it should be written in the following format YYYYMMDD. Please be aware that may be a delay in the company update and the actual update in the quickfs database.
- usage
- arguments:
# get the updated companies from New Zeland
client.get_updated_companies(country='NZ', date='20210420')
Metrics :arrow_up:
get_available_metrics
: Returns a list of available metrics with the associated metadata.- arguments:
None
- usage:
- arguments:
# get the supported metrics by quickfs
client.get_available_metrics()
Datapoints :arrow_up:
It is highly recommendable to use the country identifier code for non-U.S. stocks. If you do not specify a country, the API will first try to match a U.S.-listed symbol and, if none is found, will then match with a non-U.S. company with the same symbol. The order of the returned data is from oldest to more recent data.
Additionally, the period or period range to query should have the following structure period
or from:to
respectively. For example, revenue is reported quarterly and annually, as determined by a company's fiscal calendar. FY-9:FY
represents the last 10 years of annual revenue figures. Similarly, the last 20 quarters of reported quarterly revenue is characterised by the periods FQ-19:FQ
.
get_data_range
: Returns range of data points for a single company metric.- arguments:
- symbol(str): company symbol. for example: AAPL:US
- metric(str): QuickFS metric name.
- usage:
- arguments:
# get the shares outstanding (shares that have been authorized, issued, and purchased by investors and are held by them).
client.get_data_range(symbol='AAPL:US', metric='shares_eop', period='FQ-15:FQ')
get_data_full
: Pull metadata and all financial statements (annual and quarterly) for all periods for a single stock in one API call.- arguments:
- symbol(str): company symbol. for example: AAPL:US
- usage:
- arguments:
# get the full data for finnCap Group plc
client.get_data_full(symbol='FCAP:LN')
get_data_batch
: Batch request for several companies retrieving multiple metrics.- arguments:
- companies(List[str]): List of companies to query.
- metrics(List[str]): List of metrics to query.
- period(str): Period or period range to query.
- usage:
- arguments:
# Get the last 3 years of ROA and ROIC for Cocacola and Pepsi
client.get_data_batch(companies=['KO:US', 'PEP:US'], metrics=['roa', 'roic'], period="FY-2:FY")
Usage history :arrow_up:
get_usage
: Returns your current API usage and limits.- arguments:
None
- usage:
- arguments:
client.get_usage()
Disclaimer :arrow_up:
The information in this document is for informational and educational purposes only. Nothing in this document may be construed as financial, legal or tax advice. The content of this document is solely the opinion of the author, who is not a licensed financial advisor or registered investment advisor. The author is not affiliated as a promoter of QuickFS services.
This document is not an offer to buy or sell financial instruments. Never invest more than you can afford to lose. You should consult a registered professional advisor before making any investment.
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
File details
Details for the file quickfs-0.1.1.tar.gz
.
File metadata
- Download URL: quickfs-0.1.1.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac8633f49ec89f0292137e2af5116162f9c4b87a3823be081bfec5058d8bd639 |
|
MD5 | 82682ed585a23bd9a2d007a9ab564e85 |
|
BLAKE2b-256 | e51f2f0fcf060983e5385908c51b3fe3dc606326459b3a2483ecc51f34466fac |
File details
Details for the file quickfs-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: quickfs-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a1f631a410a9ba0306f336c0f942cc17a8a795eb530799cc97ab7d2a530c3d9 |
|
MD5 | 3684e308805d38b7b80fb06b0204c374 |
|
BLAKE2b-256 | 57d32f81ee335e0ba31970d735d75cd85059b9dce539d3f3516d9eb2f12e8451 |