tonview-bot-main.zip
37.9 KB
💻 ЯП: Python 3.11+🐍
💾 Модули: aiogram, aiohttp
📂 База данных: sqlalchemy
#telegram
Please open Telegram to view this post
VIEW IN TELEGRAM
👍9
import os
import shutil
from pathlib import Path
from PIL import Image, UnidentifiedImageError
PHOTO_FOLDER = os.path.abspath(os.path.join('photo'))
RESULT_FOLDER = os.path.abspath(os.path.join('sorted_photo'))
PHOTO_FORMATS = ('.jpg', '.jpeg', '.png')
def get_year(file_path):
try:
image = Image.open(file_path)
exifdata = image.getexif()
datetime = exifdata.get(306)
image.close()
if datetime:
return datetime[:4]
return None
except UnidentifiedImageError:
pass
def move_photo(photo_path, year_dir):
photo_name = os.path.basename(photo_path)
if not os.path.exists(os.path.join(year_dir, photo_name)):
print(f'✅ moving "{photo_name}" from {photo_path} to {year_dir}')
shutil.move(photo_path, year_dir)
else:
print(f'⛔️ ERROR: "{photo_name}" already exist in {year_dir}')
def go(cur):
for dr in os.listdir(cur):
abs_path = os.path.join(cur, dr)
if os.path.isdir(abs_path):
go(abs_path)
else:
if os.path.isfile(abs_path) and Path(abs_path).suffix.lower() in PHOTO_FORMATS:
year = get_year(abs_path)
if year:
try:
year_dir = os.path.abspath(os.path.join(RESULT_FOLDER, year))
os.mkdir(year_dir)
except FileExistsError:
pass
move_photo(abs_path, year_dir)
def del_empty(cur):
for d in os.listdir(cur):
a = os.path.join(cur, d)
if os.path.isdir(a):
del_empty(a)
if not os.listdir(a):
print('removing empty dir:', a)
os.rmdir(a)
if __name__ == "__main__":
try:
os.mkdir(RESULT_FOLDER)
except FileExistsError:
pass
go(PHOTO_FOLDER)
del_empty(PHOTO_FOLDER)
Please open Telegram to view this post
VIEW IN TELEGRAM
👍13🔥7
Единственный канал где делимся готовыми скриптами на Python 🚀 по крипто тематике абсолютно бесплатно 💸 :
👇👇👇
- Никакой воды🚀
- Алготрейдинг🤖
- Работа с API бирж, агрегаторов💻
- Автоматизации📈
Подпишись и пользуйся -> Crypto Python
👇👇👇
- Никакой воды
- Алготрейдинг
- Работа с API бирж, агрегаторов
- Автоматизации
Подпишись и пользуйся -> Crypto Python
Please open Telegram to view this post
VIEW IN TELEGRAM
2🔥7❤4👍4
💾 Pydoll
🔍 Особенности:
🌐 Отсутствует необходимость в WebDriver
🧑💻 Нативный обход капчи:
🎛️ Асинхронная производительность
🧑💻 Человеко-подобные взаимодействия
🧨 Мощная система событий:
💻 Поддержка нескольких браузеров
⚙️ Установка 👇👇👇
pip install pydoll-python
#библиотеки
Please open Telegram to view this post
VIEW IN TELEGRAM
👍9❤3🔥2🎉1
Python_Scripts
Единственный канал где делимся готовыми скриптами на Python 🚀 по крипто тематике абсолютно бесплатно 💸 : 👇👇👇 - Никакой воды 🚀 - Алготрейдинг 🤖 - Работа с API бирж, агрегаторов 💻 - Автоматизации 📈 Подпишись и пользуйся -> Crypto Python
Подписывайтесь активнее ❗
Единственный канал в своем роде 🧑💻🚀
Единственный канал в своем роде 🧑💻🚀
2🔥7❤2👍2👏1
s-to-td-main.zip
2.6 KB
💻 ЯП: Python 3.11+🐍
💾 Модули: aiogram, conversion, opentele
📂 База данных: -
#telegram
Please open Telegram to view this post
VIEW IN TELEGRAM
👍7🔥3❤2
from scapy.all import sniff, IP, TCP, UDP
def packet_callback(packet):
if IP in packet:
ip_src = packet[IP].src
ip_dst = packet[IP].dst
proto = "TCP" if packet.haslayer(TCP) else "UDP" if packet.haslayer(UDP) else "OTHER"
print(f"📦 {proto} | {ip_src} → {ip_dst}")
# 🔹 Захватываем первые 100 пакетов (или просто запустить без лимита)
print("🕵️ Сниффер запущен. Захват пакетов...")
sniff(prn=packet_callback, count=100, store=False)
Please open Telegram to view this post
VIEW IN TELEGRAM
❤12👍2
💾 Img2Table
🔍 Особенности:
🚀 Спасает, когда таблицы есть только в сканах или фото
🔥 Умеет обрабатывать PDF и многостраничные документы
💡 Очень полезна для юристов, бухгалтеров, исследователей, аналитиков
📦 Удобна для автоматизации документооборота и интеграции в системы
⚙️ Установка 👇👇👇
pip install img2table
#библиотеки
Please open Telegram to view this post
VIEW IN TELEGRAM
👍16🎉4
bot_podpiski_py-main.zip
16.3 KB
💻 ЯП: Python 3.11+🐍
💾 Модули: aiogram, APScheduler
📂 База данных: -
#telegram
Please open Telegram to view this post
VIEW IN TELEGRAM
👍10🔥4
import cv2
import numpy as np
# 🔹 Загрузка изображений (одинакового размера!)
img1 = cv2.imread("image_old.png")
img2 = cv2.imread("image_new.png")
# 🔹 Перевод в ч/б
gray1 = cv2.cvtColor(img1, cv2.COLOR_BGR2GRAY)
gray2 = cv2.cvtColor(img2, cv2.COLOR_BGR2GRAY)
# 🔹 Разница между изображениями
diff = cv2.absdiff(gray1, gray2)
_, thresh = cv2.threshold(diff, 25, 255, cv2.THRESH_BINARY)
# 🔹 Находим контуры изменений
contours, _ = cv2.findContours(thresh, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
# 🔹 Отмечаем отличия на новом изображении
for contour in contours:
if cv2.contourArea(contour) > 50:
x, y, w, h = cv2.boundingRect(contour)
cv2.rectangle(img2, (x, y), (x + w, y + h), (0, 0, 255), 2)
# 🔹 Сохраняем результат
cv2.imwrite("diff_result.png", img2)
print("✅ Отличия сохранены в diff_result.png")
Please open Telegram to view this post
VIEW IN TELEGRAM
❤13👍5🔥1
💾 Pdfquery
🔍 Особенности:
🚀 Позволяет точно достать текст в нужном месте PDF
🔥 Использует CSS/XPath — привычный способ селекции
💡 Идеально для извлечения данных из отчётов, выписок, договоров
🎯 Поддерживает шаблоны, повторяющиеся поля и массовую обработку
⚙️ Установка 👇👇👇
pip install pdfquery
#библиотеки
Please open Telegram to view this post
VIEW IN TELEGRAM
❤14🔥1
LiveCryptoPrice-main.zip
23.3 KB
💻 ЯП: Python 3.11+🐍
💾 Модули: aiogram, httpx, loguru
📂 База данных: -
Функции:
- Получает цены криптовалют из нескольких источников
- Рассчитывает среднюю цену по всем источникам
- Отправляет форматированные обновления на несколько каналов Telegram
- Настраиваемые интервалы обновления
- Обрабатывает ограничения скорости API и ошибки
- Поддерживает разные тикеры для разных каналов
- Асинхронная выборка цен для повышения производительности
- Постоянное хранение данных в выделенном каталоге данных
#telegram
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥10👍5❤2👏1
ДОГОВОР № {{number}}
г. {{city}}, {{date}}
Мы, {{client}}, заключили договор на сумму {{amount}} руб.from docx import Document
# 🔹 Загрузка шаблона
doc = Document("template.docx")
# 🔹 Данные для подстановки
data = {
"{{number}}": "2024/015",
"{{city}}": "Москва",
"{{date}}": "28.03.2025",
"{{client}}": "Иванов И.И.",
"{{amount}}": "150000"
}
# 🔹 Замена текста в каждом абзаце
for paragraph in doc.paragraphs:
for key, value in data.items():
if key in paragraph.text:
paragraph.text = paragraph.text.replace(key, value)
# 🔹 Сохраняем результат
output_filename = "filled_contract.docx"
doc.save(output_filename)
print(f"✅ Документ создан: {output_filename}")
Please open Telegram to view this post
VIEW IN TELEGRAM
👍18❤5👏3
💾 Maya
🔍 Особенности:
🚀 Простая работа с датами, без боли strptime и strftime
🔥 Понимает «живой» английский и ISO-форматы
💡 Подходит для CLI-утилит, логов, напоминаний, бэкапов
🧠 Отличная альтернатива громоздкому arrow, pendulum, datetime
⚙️ Установка 👇👇👇
pip install maya
#библиотеки
Please open Telegram to view this post
VIEW IN TELEGRAM
👍8❤1
username-checker-main.zip
199.3 KB
💻 ЯП: Python 3.11+🐍
💾 Модули: httpx, multithreading, colorama
📂 База данных: -
🌐 Особенности:
✅ Без Selenium
✅ Поддерживает многопоточность
✅ Позволяет добавлять пользовательские веб-сайты
✅ FOSS
✅ Доступные площадки- TikTok, Instagram, Minecraft, Roblox, GitHub, Pastebin, Replit, YouTube, Twitter, Twitch и многое другое!
#other
Please open Telegram to view this post
VIEW IN TELEGRAM
1👍12🔥1
import librosa
import numpy as np
from sklearn.preprocessing import StandardScaler
from sklearn.svm import SVC
import joblib
# 🔹 Функция извлечения признаков
def extract_features(file):
y, sr = librosa.load(file, duration=3, offset=0.5)
mfcc = np.mean(librosa.feature.mfcc(y=y, sr=sr, n_mfcc=13).T, axis=0)
chroma = np.mean(librosa.feature.chroma_stft(y=y, sr=sr).T, axis=0)
mel = np.mean(librosa.feature.melspectrogram(y=y, sr=sr).T, axis=0)
return np.hstack([mfcc, chroma, mel])
# 🔹 Загрузка модели (можно обучить отдельно)
model = joblib.load("emotion_model.pkl") # SVM или любая другая ML-модель
scaler = joblib.load("scaler.pkl")
# 🔹 Анализ аудиофайла
file = "voice_sample.wav"
features = extract_features(file)
features_scaled = scaler.transform([features])
prediction = model.predict(features_scaled)
print(f"🎙 Эмоция: {prediction[0]}")
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥15❤3😁2
💾 PythonInquirer
🔍 Особенности:
🚀 Создание UI прямо в терминале, без GUI
🔥 Поддерживает сложную логику взаимодействия
💡 Подходит для CLI-приложений, интерактивных ассистентов и DevOps-инструментов
🎯 Удобнее, чем input() и argparse в сценариях с множественным выбором
⚙️ Установка 👇👇👇
pip install PyInquirer
#библиотеки
Please open Telegram to view this post
VIEW IN TELEGRAM
👍8❤2🔥2
ServerManagementTelegramBot-main.zip
7.9 KB
💻 ЯП: Python 3.11+🐍
💾 Модули: aiogram, aiohttp
📂 База данных: -
#telegram
Please open Telegram to view this post
VIEW IN TELEGRAM
❤10🔥5👍2
import cv2
import mediapipe as mp
import pyautogui
mp_hands = mp.solutions.hands
mp_drawing = mp.solutions.drawing_utils
cap = cv2.VideoCapture(0)
with mp_hands.Hands(max_num_hands=1, min_detection_confidence=0.7) as hands:
while cap.isOpened():
success, frame = cap.read()
if not success:
break
# Отзеркаливаем изображение и конвертируем
frame = cv2.flip(frame, 1)
rgb = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
result = hands.process(rgb)
if result.multi_hand_landmarks:
for hand_landmarks in result.multi_hand_landmarks:
mp_drawing.draw_landmarks(frame, hand_landmarks, mp_hands.HAND_CONNECTIONS)
# Пример: "палец вверх" — большой палец вытянут, остальные согнуты
thumb = hand_landmarks.landmark[4].y < hand_landmarks.landmark[3].y
index = hand_landmarks.landmark[8].y < hand_landmarks.landmark[6].y
middle = hand_landmarks.landmark[12].y < hand_landmarks.landmark[10].y
ring = hand_landmarks.landmark[16].y < hand_landmarks.landmark[14].y
pinky = hand_landmarks.landmark[20].y < hand_landmarks.landmark[18].y
if thumb and not index and not middle and not ring and not pinky:
cv2.putText(frame, "👍 Палец вверх!", (10, 30), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2)
# Пример действия: нажать play/pause
pyautogui.press("playpause")
cv2.imshow("Жесты руками", frame)
if cv2.waitKey(5) & 0xFF == 27: # ESC
break
cap.release()
cv2.destroyAllWindows()
Please open Telegram to view this post
VIEW IN TELEGRAM
1❤11👍3
💾 Microdot
Он совместим с Python 3 и MicroPython, работает на ESP32, Raspberry Pi и даже в ограниченной среде.
🔍 Особенности:
🚀 Поднимает веб-сервер даже на ESP32 за 1 секунду
🔥 Минималистичная альтернатива Flask — всего ~50 КБ
💡 Идеален для локальных REST API, IoT и микросервисов
🎯 Подходит даже для обучения основам сетевого взаимодействия
⚙️ Установка 👇👇👇
pip install microdot
#библиотеки
Please open Telegram to view this post
VIEW IN TELEGRAM
👍12🔥7❤2