tefas
Github: https://github.com/atahanuz/tefas/
Get daily price data of 5 years from TEFAS, Turkey's exchange traded funds platform. (in Turkish: Yatırım Fonları)
https://www.tefas.gov.tr
TEFAS doesn't provice an API for easy data retrieval, so the program uses Selenium to physically visit the website and scrape the data.
Installation
pip install tefas
Usage
import tefas
data= tefas.get_data("AFT","MAC","TCD")
call tefas.get_data() function with the ETF names. You can pass a single or as many ETFs as you want. You will get a Pandas dataframe with days as indexes and each ETFs daily prices as columns.
You can pass an optional verbose=False argument if you want to disable printing scraping progression to the console.
import tefas
data= tefas.get_data("IPJ",verbose=False)
Example Dataframe
Additional Features ?
Initially, I thougt about adding various data manipulation functions to the library. But to keep the library lightweight, I think it is enough to retrieve the dataframe. Because once the dataframe is ready, users can easily process the data according to their needs using the Pandas library. Examples:
import tefas
data= tefas.get_data("AFT","MAC","TCD")
# print the correlation matrix between ETFs
print(data.corr(),"\n")
#print total percentage return for each ETF
for column in data:
print(f"{column} total return: {data[column].iloc[-1] / data[column].iloc[0] * 100 - 100:.2f} %")
Output
Contact
Raise an issue on the GitHub repo and I'll happily respond:
https://github.com/atahanuz/tefas/issues/new
Disclaimer: This program doesn't provide any investment advice, it simply displays data based on user request.
Metadata
Release files for tefas 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| tefas-1.0.1.tar.gz | 3.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tefas-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.6 kB
Release files / tefas-1.0.1.tar.gz
| Download URL | tefas-1.0.1.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d0f9ce1f61c65b8aee9b689e8283d8ef7c05071a591bf111beffca73b0c1592d
|
|
BLAKE2b-256 checksum How to use checksums |
0748932c80018ed00e1878580fc76c050c8f93cb8c1038b6f7fc1cf3660b1dc2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.0
|
Release files / tefas-1.0.1-py3-none-any.whl
| Download URL | tefas-1.0.1-py3-none-any.whl |
|---|---|
| Size | 3.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
81727cb491e0b0d80fe6b6ad29a30b212f6eb66f89f00a4f5c8abef2588d3ec8
|
|
BLAKE2b-256 checksum How to use checksums |
96cc0c472ee088710d2199106439a6cbea542b79ed654ec5587837bd4136a176
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.0
|
Security for tefas 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.