tefasfon


Nametefasfon JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/urazakgul/tefasfon
SummaryFetches fund data from the TEFAS website.
upload_time2025-07-20 11:30:41
maintainerNone
docs_urlNone
authorUraz Akgül
requires_python>=3.8
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # tefasfon v0.1.0

## Türkçe tercih edenler için:

***Those who prefer English can scroll down the page.***

## Açıklama

`tefasfon`, Türkiye Elektronik Fon Alım Satım Platformu'nun (TEFAS) resmi web sitesinde yayımlanan yatırım fonu ve emeklilik fonu verilerini programatik olarak çekmenizi sağlayan bir Python kütüphanesidir. Kütüphane, fon türü ve tarih aralığı seçimiyle esnek veri çekimi sunar. Mesajlar ve hata bildirimleri Türkçe/İngilizce desteklidir; çıktı doğrudan kullanıma hazır pandas DataFrame olarak döner ve isteğe bağlı olarak Excel dosyasına kaydedilebilir.

## Özellikler

* İstenilen tarih aralığında ve fon türüne göre TEFAS verilerini hızlıca çekebilirsiniz.
* Fon bilgisi veya portföy dağılımı (iki farklı sekme) için veri alabilirsiniz.
* Mesajlar ve hata uyarıları Türkçe/İngilizce gösterilir.
* Kolay kullanım, çıktı olarak doğrudan `pandas.DataFrame` döner.
* Çekilen verileri opsiyonel olarak Excel dosyasına kaydedebilirsiniz.
* Selenium ile gerçek tarayıcı üzerinden veriler alınır, böylece web arayüzündeki tüm güncel verilere ulaşabilirsiniz.

## Kurulum

Kütüphaneyi yüklemek için şu adımları izleyin:

1. Python'ı yükleyin: https://www.python.org/downloads/
2. Terminal veya komut istemcisinde aşağıdaki komutu çalıştırın:

```bash
pip install tefasfon
```

Belirli bir versiyonu yüklemek için:

```bash
pip install tefasfon==0.1.0
```

Yüklü versiyonu görüntülemek için:

```bash
pip show tefasfon
```

## Fonksiyonlar

### `fetch_tefas_data`

TEFAS web sitesinden fon veya portföy verisi çeker.

Parametreler:

* `fund_type_code` (int): Fon tipi kodu
  * 0: Menkul Kıymet Yatırım Fonları
  * 1: Emeklilik Fonları
  * 2: Borsa Yatırım Fonları
  * 3: Gayrimenkul Yatırım Fonları
  * 4: Girişim Sermayesi Yatırım Fonları
* `tab_code` (int): Sekme kodu
  * 0: Genel Bilgiler
  * 1: Portföy Dağılımı
* `start_date` (str): Başlangıç tarihi, 'gg.aa.yyyy' formatında (örn. '17.07.2025')
* `end_date` (str): Bitiş tarihi, 'gg.aa.yyyy' formatında (örn. '18.07.2025')
* `lang` (str): "tr" veya "en" (varsayılan "tr")
* `save_to_excel` (bool): True verilirse, Excel dosyasına kaydeder (varsayılan: False)
* `wait_seconds` (int): Web işlemleri arası bekleme süresi (varsayılan: 3)

Dönüş:

* `pandas.DataFrame` (veya veri yoksa boş DataFrame)

## Örnek Kullanım

```python
from tefasfon import fetch_tefas_data

df = fetch_tefas_data(
    fund_type_code=0,
    tab_code=0,
    start_date="17.08.2025",
    end_date="18.07.2025",
    lang="tr",
    save_to_excel=True
)
```

## Notlar

* Kütüphane, TEFAS'ın web sitesindeki verilere bağımlıdır. Herhangi bir değişiklikte veya bakımda, veri çekilemeyebilir. Lütfen [TEFAS](https://www.tefas.gov.tr/TarihselVeriler.aspx) adresinden veri durumu ve güncelliğini kontrol edin.
* Selenium ve ChromeDriver kullanılır. Bilgisayarınızda Google Chrome kurulu olmalı ve güncel olmalıdır.
* Kütüphanenin geliştirilmesi ve iyileştirilmesi için geri bildirimlerinizi bekliyorum. GitHub reposuna katkıda bulunun: [GitHub Repo](https://github.com/urazakgul/tefasfon)
* Herhangi bir sorun veya öneride lütfen GitHub reposundaki "Issue" bölümünden yeni bir konu açarak bildirim sağlayın: [GitHub Issues](https://github.com/urazakgul/tefasfon/issues)

## Sürüm Notları

### v0.1.0 - 20/07/2025

* İlk sürüm yayınlandı.

## Lisans

Bu proje MIT Lisansı altında lisanslanmıştır.

## For those who prefer English:

## Description

`tefasfon` is a Python package that enables you to programmatically fetch investment fund and pension fund data published on the official TEFAS website. The library offers flexible data fetching by fund type and date range. All messages and errors are displayed in Turkish or English. The output is delivered as a ready-to-use pandas DataFrame and can optionally be saved as an Excel file.

## Features

* Easily fetch TEFAS data for any desired date range and fund type.
* Fetch either general fund information or portfolio breakdown (two separate tabs).
* Errors and status messages are shown in Turkish or English.
* Simple usage; output is directly returned as a `pandas.DataFrame`.
* Optionally save the fetched data as an Excel file.
* Uses Selenium for browser automation, ensuring access to up-to-date data from the web interface.

## Installation

To use the package, follow these steps:

1. Install Python: https://www.python.org/downloads/
2. Open your terminal or command prompt and run:

```bash
pip install tefasfon
```

To install a specific version:

```bash
pip install tefasfon==0.1.0
```

To check the installed version:

```bash
pip show tefasfon
```

## Functions

### `fetch_tefas_data`

Fetches fund or portfolio data from the TEFAS website.

Parameters:

* `fund_type_code` (int): Fund type code
  * 0: Securities Mutual Funds
  * 1: Pension Funds
  * 2: Exchange Traded Funds
  * 3: Real Estate Investment Funds
  * 4: Venture Capital Investment Funds
* `tab_code` (int): Tab code
  * 0: General Information
  * 1: Portfolio Breakdown
* `start_date` (str): Start date, in 'dd.mm.yyyy' format (e.g. '17.07.2025')
* `end_date` (str): End date, in 'dd.mm.yyyy' format (e.g. '18.07.2025')
* `lang` (str): "tr" or "en" (default "tr")
* `save_to_excel` (bool): If True, saves the result to an Excel file (default: False)
* `wait_seconds` (int): Wait time between web actions (default: 3)

Returns:

* `pandas.DataFrame` (or an empty DataFrame if no data)

## Example

```python
from tefasfon import fetch_tefas_data

df = fetch_tefas_data(
    fund_type_code=0,
    tab_code=0,
    start_date="17.08.2025",
    end_date="18.07.2025",
    lang="en",
    save_to_excel=True
)
```

## Notes

* The library depends on data from the [TEFAS](https://www.tefas.gov.tr/TarihselVeriler.aspx) official website. In case of any changes or maintenance, data fetching may not be possible. Please check the data status and availability on TEFAS.
* Selenium and ChromeDriver are used. Google Chrome must be installed and up-to-date on your system.
* I welcome your feedback to improve and develop the library. You can contribute to the GitHub repository: [GitHub Repo](https://github.com/urazakgul/tefasfon)
* For any issues or suggestions, please open a new topic in the "Issue" section of the GitHub repository: [GitHub Issues](https://github.com/urazakgul/tefasfon/issues)

## Release Notes

### v0.1.0 - 20/07/2025

* First release published.

## License

This project is licensed under the MIT License.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/urazakgul/tefasfon",
    "name": "tefasfon",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "Uraz Akg\u00fcl",
    "author_email": "urazdev@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/89/e7/27aa1906b7c10c5bd99c68c526c28de6b8ed2cdeeaabcdb6ad61a8a7a56b/tefasfon-0.1.0.tar.gz",
    "platform": null,
    "description": "# tefasfon v0.1.0\r\n\r\n## T\u00fcrk\u00e7e tercih edenler i\u00e7in:\r\n\r\n***Those who prefer English can scroll down the page.***\r\n\r\n## A\u00e7\u0131klama\r\n\r\n`tefasfon`, T\u00fcrkiye Elektronik Fon Al\u0131m Sat\u0131m Platformu'nun (TEFAS) resmi web sitesinde yay\u0131mlanan yat\u0131r\u0131m fonu ve emeklilik fonu verilerini programatik olarak \u00e7ekmenizi sa\u011flayan bir Python k\u00fct\u00fcphanesidir. K\u00fct\u00fcphane, fon t\u00fcr\u00fc ve tarih aral\u0131\u011f\u0131 se\u00e7imiyle esnek veri \u00e7ekimi sunar. Mesajlar ve hata bildirimleri T\u00fcrk\u00e7e/\u0130ngilizce desteklidir; \u00e7\u0131kt\u0131 do\u011frudan kullan\u0131ma haz\u0131r pandas DataFrame olarak d\u00f6ner ve iste\u011fe ba\u011fl\u0131 olarak Excel dosyas\u0131na kaydedilebilir.\r\n\r\n## \u00d6zellikler\r\n\r\n* \u0130stenilen tarih aral\u0131\u011f\u0131nda ve fon t\u00fcr\u00fcne g\u00f6re TEFAS verilerini h\u0131zl\u0131ca \u00e7ekebilirsiniz.\r\n* Fon bilgisi veya portf\u00f6y da\u011f\u0131l\u0131m\u0131 (iki farkl\u0131 sekme) i\u00e7in veri alabilirsiniz.\r\n* Mesajlar ve hata uyar\u0131lar\u0131 T\u00fcrk\u00e7e/\u0130ngilizce g\u00f6sterilir.\r\n* Kolay kullan\u0131m, \u00e7\u0131kt\u0131 olarak do\u011frudan `pandas.DataFrame` d\u00f6ner.\r\n* \u00c7ekilen verileri opsiyonel olarak Excel dosyas\u0131na kaydedebilirsiniz.\r\n* Selenium ile ger\u00e7ek taray\u0131c\u0131 \u00fczerinden veriler al\u0131n\u0131r, b\u00f6ylece web aray\u00fcz\u00fcndeki t\u00fcm g\u00fcncel verilere ula\u015fabilirsiniz.\r\n\r\n## Kurulum\r\n\r\nK\u00fct\u00fcphaneyi y\u00fcklemek i\u00e7in \u015fu ad\u0131mlar\u0131 izleyin:\r\n\r\n1. Python'\u0131 y\u00fckleyin: https://www.python.org/downloads/\r\n2. Terminal veya komut istemcisinde a\u015fa\u011f\u0131daki komutu \u00e7al\u0131\u015ft\u0131r\u0131n:\r\n\r\n```bash\r\npip install tefasfon\r\n```\r\n\r\nBelirli bir versiyonu y\u00fcklemek i\u00e7in:\r\n\r\n```bash\r\npip install tefasfon==0.1.0\r\n```\r\n\r\nY\u00fckl\u00fc versiyonu g\u00f6r\u00fcnt\u00fclemek i\u00e7in:\r\n\r\n```bash\r\npip show tefasfon\r\n```\r\n\r\n## Fonksiyonlar\r\n\r\n### `fetch_tefas_data`\r\n\r\nTEFAS web sitesinden fon veya portf\u00f6y verisi \u00e7eker.\r\n\r\nParametreler:\r\n\r\n* `fund_type_code` (int): Fon tipi kodu\r\n  * 0: Menkul K\u0131ymet Yat\u0131r\u0131m Fonlar\u0131\r\n  * 1: Emeklilik Fonlar\u0131\r\n  * 2: Borsa Yat\u0131r\u0131m Fonlar\u0131\r\n  * 3: Gayrimenkul Yat\u0131r\u0131m Fonlar\u0131\r\n  * 4: Giri\u015fim Sermayesi Yat\u0131r\u0131m Fonlar\u0131\r\n* `tab_code` (int): Sekme kodu\r\n  * 0: Genel Bilgiler\r\n  * 1: Portf\u00f6y Da\u011f\u0131l\u0131m\u0131\r\n* `start_date` (str): Ba\u015flang\u0131\u00e7 tarihi, 'gg.aa.yyyy' format\u0131nda (\u00f6rn. '17.07.2025')\r\n* `end_date` (str): Biti\u015f tarihi, 'gg.aa.yyyy' format\u0131nda (\u00f6rn. '18.07.2025')\r\n* `lang` (str): \"tr\" veya \"en\" (varsay\u0131lan \"tr\")\r\n* `save_to_excel` (bool): True verilirse, Excel dosyas\u0131na kaydeder (varsay\u0131lan: False)\r\n* `wait_seconds` (int): Web i\u015flemleri aras\u0131 bekleme s\u00fcresi (varsay\u0131lan: 3)\r\n\r\nD\u00f6n\u00fc\u015f:\r\n\r\n* `pandas.DataFrame` (veya veri yoksa bo\u015f DataFrame)\r\n\r\n## \u00d6rnek Kullan\u0131m\r\n\r\n```python\r\nfrom tefasfon import fetch_tefas_data\r\n\r\ndf = fetch_tefas_data(\r\n    fund_type_code=0,\r\n    tab_code=0,\r\n    start_date=\"17.08.2025\",\r\n    end_date=\"18.07.2025\",\r\n    lang=\"tr\",\r\n    save_to_excel=True\r\n)\r\n```\r\n\r\n## Notlar\r\n\r\n* K\u00fct\u00fcphane, TEFAS'\u0131n web sitesindeki verilere ba\u011f\u0131ml\u0131d\u0131r. Herhangi bir de\u011fi\u015fiklikte veya bak\u0131mda, veri \u00e7ekilemeyebilir. L\u00fctfen [TEFAS](https://www.tefas.gov.tr/TarihselVeriler.aspx) adresinden veri durumu ve g\u00fcncelli\u011fini kontrol edin.\r\n* Selenium ve ChromeDriver kullan\u0131l\u0131r. Bilgisayar\u0131n\u0131zda Google Chrome kurulu olmal\u0131 ve g\u00fcncel olmal\u0131d\u0131r.\r\n* K\u00fct\u00fcphanenin geli\u015ftirilmesi ve iyile\u015ftirilmesi i\u00e7in geri bildirimlerinizi bekliyorum. GitHub reposuna katk\u0131da bulunun: [GitHub Repo](https://github.com/urazakgul/tefasfon)\r\n* Herhangi bir sorun veya \u00f6neride l\u00fctfen GitHub reposundaki \"Issue\" b\u00f6l\u00fcm\u00fcnden yeni bir konu a\u00e7arak bildirim sa\u011flay\u0131n: [GitHub Issues](https://github.com/urazakgul/tefasfon/issues)\r\n\r\n## S\u00fcr\u00fcm Notlar\u0131\r\n\r\n### v0.1.0 - 20/07/2025\r\n\r\n* \u0130lk s\u00fcr\u00fcm yay\u0131nland\u0131.\r\n\r\n## Lisans\r\n\r\nBu proje MIT Lisans\u0131 alt\u0131nda lisanslanm\u0131\u015ft\u0131r.\r\n\r\n## For those who prefer English:\r\n\r\n## Description\r\n\r\n`tefasfon` is a Python package that enables you to programmatically fetch investment fund and pension fund data published on the official TEFAS website. The library offers flexible data fetching by fund type and date range. All messages and errors are displayed in Turkish or English. The output is delivered as a ready-to-use pandas DataFrame and can optionally be saved as an Excel file.\r\n\r\n## Features\r\n\r\n* Easily fetch TEFAS data for any desired date range and fund type.\r\n* Fetch either general fund information or portfolio breakdown (two separate tabs).\r\n* Errors and status messages are shown in Turkish or English.\r\n* Simple usage; output is directly returned as a `pandas.DataFrame`.\r\n* Optionally save the fetched data as an Excel file.\r\n* Uses Selenium for browser automation, ensuring access to up-to-date data from the web interface.\r\n\r\n## Installation\r\n\r\nTo use the package, follow these steps:\r\n\r\n1. Install Python: https://www.python.org/downloads/\r\n2. Open your terminal or command prompt and run:\r\n\r\n```bash\r\npip install tefasfon\r\n```\r\n\r\nTo install a specific version:\r\n\r\n```bash\r\npip install tefasfon==0.1.0\r\n```\r\n\r\nTo check the installed version:\r\n\r\n```bash\r\npip show tefasfon\r\n```\r\n\r\n## Functions\r\n\r\n### `fetch_tefas_data`\r\n\r\nFetches fund or portfolio data from the TEFAS website.\r\n\r\nParameters:\r\n\r\n* `fund_type_code` (int): Fund type code\r\n  * 0: Securities Mutual Funds\r\n  * 1: Pension Funds\r\n  * 2: Exchange Traded Funds\r\n  * 3: Real Estate Investment Funds\r\n  * 4: Venture Capital Investment Funds\r\n* `tab_code` (int): Tab code\r\n  * 0: General Information\r\n  * 1: Portfolio Breakdown\r\n* `start_date` (str): Start date, in 'dd.mm.yyyy' format (e.g. '17.07.2025')\r\n* `end_date` (str): End date, in 'dd.mm.yyyy' format (e.g. '18.07.2025')\r\n* `lang` (str): \"tr\" or \"en\" (default \"tr\")\r\n* `save_to_excel` (bool): If True, saves the result to an Excel file (default: False)\r\n* `wait_seconds` (int): Wait time between web actions (default: 3)\r\n\r\nReturns:\r\n\r\n* `pandas.DataFrame` (or an empty DataFrame if no data)\r\n\r\n## Example\r\n\r\n```python\r\nfrom tefasfon import fetch_tefas_data\r\n\r\ndf = fetch_tefas_data(\r\n    fund_type_code=0,\r\n    tab_code=0,\r\n    start_date=\"17.08.2025\",\r\n    end_date=\"18.07.2025\",\r\n    lang=\"en\",\r\n    save_to_excel=True\r\n)\r\n```\r\n\r\n## Notes\r\n\r\n* The library depends on data from the [TEFAS](https://www.tefas.gov.tr/TarihselVeriler.aspx) official website. In case of any changes or maintenance, data fetching may not be possible. Please check the data status and availability on TEFAS.\r\n* Selenium and ChromeDriver are used. Google Chrome must be installed and up-to-date on your system.\r\n* I welcome your feedback to improve and develop the library. You can contribute to the GitHub repository: [GitHub Repo](https://github.com/urazakgul/tefasfon)\r\n* For any issues or suggestions, please open a new topic in the \"Issue\" section of the GitHub repository: [GitHub Issues](https://github.com/urazakgul/tefasfon/issues)\r\n\r\n## Release Notes\r\n\r\n### v0.1.0 - 20/07/2025\r\n\r\n* First release published.\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License.\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Fetches fund data from the TEFAS website.",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/urazakgul/tefasfon"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "1632798d4779ff9dcacc6506dd0cb82eb645b6edf3ee00c19a178dea3e5d90e8",
                "md5": "2ea52189d659cd0e7c1f118b8f60f30d",
                "sha256": "d6b19d0e1c873dd670dd37ffa55cdcda4c81d3ae4b7bbd8e1afc9e4d0e7d5e23"
            },
            "downloads": -1,
            "filename": "tefasfon-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2ea52189d659cd0e7c1f118b8f60f30d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 8979,
            "upload_time": "2025-07-20T11:30:40",
            "upload_time_iso_8601": "2025-07-20T11:30:40.011183Z",
            "url": "https://files.pythonhosted.org/packages/16/32/798d4779ff9dcacc6506dd0cb82eb645b6edf3ee00c19a178dea3e5d90e8/tefasfon-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "89e727aa1906b7c10c5bd99c68c526c28de6b8ed2cdeeaabcdb6ad61a8a7a56b",
                "md5": "b45be4ce19e9f97d0583a2698dfe34bd",
                "sha256": "08d13b8903c7fe2a166d82f2fdd6fb15318f25bb051ac44a98fcf6a751ff13b5"
            },
            "downloads": -1,
            "filename": "tefasfon-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "b45be4ce19e9f97d0583a2698dfe34bd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 10395,
            "upload_time": "2025-07-20T11:30:41",
            "upload_time_iso_8601": "2025-07-20T11:30:41.491111Z",
            "url": "https://files.pythonhosted.org/packages/89/e7/27aa1906b7c10c5bd99c68c526c28de6b8ed2cdeeaabcdb6ad61a8a7a56b/tefasfon-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-20 11:30:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "urazakgul",
    "github_project": "tefasfon",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "tefasfon"
}
        
Elapsed time: 1.06728s