Metadata-Version: 2.1
Name: gib-esu
Version: 1.0.4
Summary: GİB EŞÜ EKS servis istemcisi - Electroop
Home-page: https://github.com/electroop-engineering/gib-esu
Author: Electroop Engineering
Author-email: Özcan Türkmen <ozcan@electroop.io>
Maintainer-email: Özcan Türkmen <ozcan@electroop.io>
License: # Released under MIT License
        
        Copyright (c) 2024 Electroop
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: homepage, https://github.com/electroop-engineering/gib-esu
Project-URL: repository, https://github.com/electroop-engineering/gib-esu
Project-URL: documentation, https://github.com/electroop-engineering/gib-esu/blob/main/doc.md
Keywords: GİB EŞÜ EKS,Elektrikli şarj üniteleri,şarj ağı işletmecileri
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: pandas<3.0.0,>=2.2.2
Requires-Dist: requests<3.0.0,>=2.32.3
Requires-Dist: pydantic<3.0.0,>=2.9.2
Requires-Dist: python-dotenv>=1.0.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"

## GİB EŞÜ EKS Servisi
<details open>

<summary>Cihaz Kayıt</summary>

```python
from models.api_models import ESU, ESUTipi, Soket, SoketTipi
from services.esu_service import ESUServis

servis = ESUServis()  # konfigürasyonda .env dosyası kullanılır
esu = ESU(
    esu_seri_no="7001324500027",
    esu_soket_tipi=ESUTipi.AC_DC,
    esu_soket_sayisi="2",
    esu_soket_detay=[
        Soket(soket_no="Soket1", soket_tip=SoketTipi.AC),
        Soket(soket_no="Soket2", soket_tip=SoketTipi.DC),
    ],
    esu_markasi="Vestel",
    esu_modeli="EVC04",
)

yanit = servis.cihaz_kayit(esu)

print(yanit.durum)  # "success"
print(yanit.sonuc[0].mesaj)  # "Basarili"
print(yanit.sonuc[0].kod)  # "1000"
print(yanit.sonuc[0].esu_seri_no)  # "7001324500027"
```

</details>
<details>

<summary>Mükellef Kayıt</summary>

```python
from models.api_models import Fatura, Lokasyon, Mukellef
from services.esu_service import ESUServis

servis = ESUServis()  # konfigürasyonda .env dosyası kullanılır

seri_no = "7001324500027"

lokasyon = Lokasyon(
    il_kodu="034",
    ilce="Sarıyer",
    adres_numarası="2324516851",
    koordinat="41°11'20.7528\"N, 29°2'51.0756\"E",
)

fatura = Fatura(fatura_tarihi="2024-11-29", fatura_ettn="G212024000000049")

mukellef = Mukellef(
    mukellef_vkn="1234567890", mukellef_unvan="Yeşilçam Enerji Anonim Şirketi"
)

yanit = servis.mukellef_kayit(
    esu=seri_no, lokasyon=lokasyon, fatura=fatura, mukellef=mukellef
)

print(yanit.durum)  # "success"
print(yanit.sonuc[0].mesaj)  # "Basarili"
print(yanit.sonuc[0].kod)  # "1000"
print(yanit.sonuc[0].esu_seri_no)  # "7001324500027"
```

</details>

<details>

<summary>Toplu Kayıt</summary>

```python
from time import time

from services.esu_service import ESUServis

servis = ESUServis()  # konfigürasyonda .env dosyası kullanılır

baslangic = time()

sonuc = servis.toplu_kayit(
    giris_dosya_yolu="input.csv",  # varsayılan "envanter.csv"
    dosyaya_yaz=True,  # varsayılan False
    cikti_dosya_yolu="output.json",  # varsayılan "gonderim_raporu.json"
    paralel_calistir=True,  # varsayılan False
)

bitis = time()

print(sonuc)

sure = bitis - baslangic
print(f"Süre: {sure:.2f} saniye")
```
</details>

<details>

<summary>Kayıt Güncelleme</summary>

```python
from models.api_models import Fatura, Lokasyon, Sertifika
from services.esu_service import ESUServis

servis = ESUServis()  # konfigürasyonda .env dosyası kullanılır

seri_no = "7001324500027"

lokasyon = Lokasyon(
    il_kodu="034",
    ilce="Sarıyer",
    adres_numarası="2324516851",
    koordinat="41°11'20.7528\"N, 29°2'51.0756\"E",
)

fatura = Fatura(fatura_tarihi="2024-11-29", fatura_ettn="G212024000000049")

sertifika = Sertifika(sertifika_no="SE2024013000012", sertifika_tarihi="2024-01-30")

yanit = servis.kayit_guncelle(
    esu_seri_no=seri_no,
    lokasyon=lokasyon,
    fatura=fatura,
    sertifika=sertifika,
)

print(yanit.durum)  # "success"
print(yanit.sonuc[0].mesaj)  # "Basarili"
print(yanit.sonuc[0].kod)  # "1000"
print(yanit.sonuc[0].esu_seri_no)  # "7001324500027"
```

</details>

<details>

<summary>Toplu Kayıt Güncelleme</summary>

```python
from time import time

from services.esu_service import ESUServis

servis = ESUServis()  # konfigürasyonda .env dosyası kullanılır

baslangic = time()

sonuc = servis.toplu_guncelle(
    giris_dosya_yolu="input.csv",  # varsayılan "envanter.csv"
    dosyaya_yaz=True,  # varsayılan False
    cikti_dosya_yolu="output.json",  # varsayılan "gonderim_raporu.json"
    paralel_calistir=True,  # varsayılan False
)

bitis = time()

print(sonuc)

sure = bitis - baslangic
print(f"Süre: {sure:.2f} saniye")
```

</details>
<details>

<summary>Cihaz Kapatma</summary>

```python
from services.esu_service import ESUServis

servis = ESUServis()  # konfigürasyonda .env dosyası kullanılır

seri_no = "7001324500027"

yanit = servis.cihaz_kapatma(esu_seri_no=seri_no)

print(yanit.durum)  # "success"
print(yanit.sonuc[0].mesaj)  # "Basarili"
print(yanit.sonuc[0].kod)  # "1000"
print(yanit.sonuc[0].esu_seri_no)  # "7001324500027"
```

</details>
<br>

 [Dokümantasyon](doc.md)
<br>
<br>
&copy;Electroop, 2024
