Crawl the public data from Tefas.
Project description
Tefas Crawler
Crawl public invenstment fund information from Turkey Electronic Fund Trading Platform (TEFAS) with ease.
Installation
pip install tefas-crawler
Usage
Import the Crawler
object and create an instance of it.
from tefas import Crawler
tefas = Crawler()
API
fetch(start, end, name, columns, kind)
Argument | Type | Description | Required |
---|---|---|---|
start | string or datetime.datetime |
The date that fund information is crawled for. | Yes |
end | string or datetime.datetime |
End of the period that fund information is crawled for. | No |
name | string |
Name of the fund. If not given, all funds will be returned. | No |
columns[] | list of string |
List of columns to be returned. | No |
kind | string |
Type of the fund. One of YAT , EMK , or BYF . Defaults to YAT . |
No |
Examples
Get all funds for a given day.
data = tefas.fetch(start="2020-11-20")
Get a specific fund for a time period, and select columns.
data = tefas.fetch(start="2020-11-15", end="2020-11-20", name="YAC", columns=["code", "date", "price"])
Data Schema
As of today, we support the following data schema from Tefas:
Column | Description | Type |
---|---|---|
date | Sate | date |
price | Price of the fund for a given date | string |
code | Short code of the fund | string |
title | Full name of the fund | string |
market_cap | Total value of the fund | float |
number_of_shares | Number of outstanding shares | float |
number_of_investors | Number of participants | float |
tmm | Share of tmm | float |
repo | Share of repo | float |
other | Share of other | float |
stock | Share of stock | float |
eurobonds | Share of eurobonds | float |
bank_bills | Share of bank bills | float |
derivatives | Share of derivatives | float |
reverse_repo | Share of reverse-repo | float |
term_deposit | Share of term deposit | float |
treasury_bill | Share of treasury bill | float |
foreign_equity | Share of foreign equity | float |
government_bond | Share of government bond | float |
precious_metals | Share of precious metals | float |
commercial_paper | Share of commercial paper | float |
fx_payable_bills | Share of fx payable bills | float |
foreign_securities | Share of foreign securities | float |
private_sector_bond | Share of private sector bond | float |
participation_account | Share of participation account | float |
foreign_currency_bills | Share of foreign currency bills | float |
asset_backed_securities | Share of asset-backed securities | float |
real_estate_certificate | Share of real estate certificate | float |
foreign_debt_instruments | Share of foreign debt instruments | float |
government_lease_certificates | Share of government lease certificates | float |
fund_participation_certificate | Share of fund participation certificate | float |
government_bonds_and_bills_fx | Share of government bonds and bills (fx) | float |
private_sector_lease_certificates | Share of private sector lease certificates | float |
To-do
- Increase test coverage
- Request error handling
- Cache query results
License
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
tefas-crawler-0.4.0.tar.gz
(8.7 kB
view details)
Built Distribution
File details
Details for the file tefas-crawler-0.4.0.tar.gz
.
File metadata
- Download URL: tefas-crawler-0.4.0.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86bd8699e1bb20cceefd1fdd2fe64c7832d615004a0e78d0209d469166a36f5a |
|
MD5 | 19c364cf88fbc35a43b4750b08b474dd |
|
BLAKE2b-256 | f3891d2a0a396c864e82864e2700b54a7704ac1b9ff724138f2e2c6b0e0f8294 |
File details
Details for the file tefas_crawler-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: tefas_crawler-0.4.0-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1c9b6e46ff14dce7d94a8b3054c72a0f72aab9ef032da82e778591531c7da11 |
|
MD5 | 6c3c87e60fb96776bdd5a80ca24cb5d2 |
|
BLAKE2b-256 | c66993a6cac52f43eeb4eecaba12686203b95e22b79922b50c732925d4cfef45 |