Skip to content

Instantly share code, notes, and snippets.

@erenmustafaozdal
erenmustafaozdal / install_python_package_git.md
Created March 2, 2024 21:05 — forked from chhantyal/install_python_package_git.md
Pipenv or pip Install Python package from Git (Github, Gitlab, Bitbucket etc.) and using Git tag for versioning. Works for branches too.

Install from Git tag

pipenv install git+ssh://git@github.com/chhantytal/parquet-cli.git@v1.1#egg=parq

Install from branch name

pipenv install git+ssh://git@github.com/chhantytal/parquet-cli.git@master#egg=parq

Works for pip as well.

@erenmustafaozdal
erenmustafaozdal / text-to-speech.py
Created July 31, 2023 11:51
Metinden sese çevirme işlemi. Paketler: `gtts`, `playsound`
# Metni konuşmaya dönüştürmek için gereken modülü içeri aktarın
from gtts import gTTS
# Dönüştürülmüş sesi çalmak için içe aktarım yapın
import os
# Sese dönüştürmek istediğiniz metin
metin = 'Merhaba Eren Mustafa Özdal'
# Dönüştürmek istediğiniz dil
@erenmustafaozdal
erenmustafaozdal / translation_handler.py
Last active July 10, 2023 16:06
A class that handles translations and provides translation functionality.
import json
import random
from typing import Union
class TranslationHandler:
"""
A class that handles translations and provides translation functionality.
Attributes:
@erenmustafaozdal
erenmustafaozdal / google_search.py
Last active June 26, 2023 19:04
Belirtilen sorgu, dil ve sonuç sayısı parametrelerine göre, Google'da arama yapan ve sonuçları döndüren fonksiyon. Tek sorgu için en fazla 100 adet sonuç döndürülebilir. `GOOGLE_API_KEY` ve `GOOGLE_CUSTOM_SEARCH_ID` "Guide" sayfasında belirtilen şekilde alınmalıdır. ❗ Günde 100 sorgu ücretsizdir.
import os
from time import sleep
import logging
# Doc: https://developers.google.com/custom-search/v1/reference/rest/v1/cse/list
# Guide: https://developers.google.com/custom-search/v1/overview
from googleapiclient.discovery import build
from googleapiclient.errors import HttpError
logger = logging.getLogger(__name__)
@erenmustafaozdal
erenmustafaozdal / bypass-cloudflare.py
Last active June 6, 2023 23:24
Cloudflare anti-bot korumasını aşmak için örnek kodlar
# undetected_chromedriver ve diğer gerekli Selenium modüllerinin içe aktarılması
# undetected_chromedriver yüklemek için: pip install undetected-chromedriver
import undetected_chromedriver as undetected_webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.common.by import By
# XPATH ve ID seçicileri için değişkenlerin tanımlanması
cloudflare_checkbox = "//div[@id='challenge-stage']/div/label/input[@type='checkbox']"
cookie_accept = "onetrust-accept-btn-handler"