๐ฅ Trending Repository: xiaomusic
๐ Description: ไฝฟ็จๅฐ็ฑ้ณ็ฎฑๆญๆพ้ณไน๏ผ้ณไนไฝฟ็จ yt-dlp ไธ่ฝฝใ
๐ Repository URL: https://github.com/hanxi/xiaomusic
๐ Website: http://xdocs.hanxi.cc/
๐ Readme: https://github.com/hanxi/xiaomusic#readme
๐ Statistics:
๐ Stars: 6.4K stars
๐ Watchers: 22
๐ด Forks: 637 forks
๐ป Programming Languages: Python
๐ท๏ธ Related Topics:
==================================
๐ง By: https://t.me/DataScienceM
๐ Description: ไฝฟ็จๅฐ็ฑ้ณ็ฎฑๆญๆพ้ณไน๏ผ้ณไนไฝฟ็จ yt-dlp ไธ่ฝฝใ
๐ Repository URL: https://github.com/hanxi/xiaomusic
๐ Website: http://xdocs.hanxi.cc/
๐ Readme: https://github.com/hanxi/xiaomusic#readme
๐ Statistics:
๐ Stars: 6.4K stars
๐ Watchers: 22
๐ด Forks: 637 forks
๐ป Programming Languages: Python
๐ท๏ธ Related Topics:
#python #music #docker #vue #docker_compose #xiaomi #pdm #xiaoai #xiaoai_speaker #xiaomusic
==================================
๐ง By: https://t.me/DataScienceM
#YOLOv8 #ComputerVision #HomeSecurity #ObjectTracking #AI #Python
Lesson: Tracking Suspicious Individuals Near a Home at Night with YOLOv8
This tutorial demonstrates how to build an advanced security system using YOLOv8's object tracking capabilities. The system will detect people in a night-time video feed, track their movements, and trigger an alert if a person loiters for too long within a predefined "alert zone" (e.g., a driveway or porch).
---
We will use
Create a Python script (e.g.,
---
We will load a standard YOLOv8 model capable of detecting 'person'. The key is to define a polygon representing the area we want to monitor. We will also set a time threshold to define "loitering". You will need a video file of your target area, for example,
---
This is the core of the system. We will read the video frame by frame and use YOLOv8's
(Note: The code below should be placed inside the
---
Inside the main loop, we'll iterate through each tracked person. We check if their position is inside our alert zone. If it is, we start or update a timer. If the timer exceeds our threshold, we trigger an alert for that person's ID.
Lesson: Tracking Suspicious Individuals Near a Home at Night with YOLOv8
This tutorial demonstrates how to build an advanced security system using YOLOv8's object tracking capabilities. The system will detect people in a night-time video feed, track their movements, and trigger an alert if a person loiters for too long within a predefined "alert zone" (e.g., a driveway or porch).
---
#Step 1: Project Setup and DependenciesWe will use
ultralytics for YOLOv8 and its built-in tracker, opencv-python for video processing, and numpy for defining our security zone.pip install ultralytics opencv-python numpy
Create a Python script (e.g.,
security_tracker.py) and import the necessary libraries. We'll also use defaultdict to easily manage timers for each tracked person.import cv2
import numpy as np
from ultralytics import YOLO
from collections import defaultdict
import time
# Hashtags: #Setup #Python #OpenCV #YOLOv8
---
#Step 2: Model Loading and Zone ConfigurationWe will load a standard YOLOv8 model capable of detecting 'person'. The key is to define a polygon representing the area we want to monitor. We will also set a time threshold to define "loitering". You will need a video file of your target area, for example,
night_security_footage.mp4.# Load the YOLOv8 model
model = YOLO('yolov8n.pt')
# Path to your night-time video file
VIDEO_PATH = 'night_security_footage.mp4'
# Define the polygon for the alert zone.
# IMPORTANT: You MUST adjust these [x, y] coordinates to fit your video's perspective.
# This example defines a rectangular area for a driveway.
ALERT_ZONE_POLYGON = np.array([
[100, 500], [800, 500], [850, 250], [50, 250]
], np.int32)
# Time in seconds a person can be in the zone before an alert is triggered
LOITERING_THRESHOLD_SECONDS = 5.0
# Dictionaries to store tracking data
# Stores the time when a tracked object first enters the zone
loitering_timers = {}
# Stores the IDs of individuals who have triggered an alert
alert_triggered_ids = set()
# Hashtags: #Configuration #AIModel #SecurityZone
---
#Step 3: Main Loop for Tracking and Zone MonitoringThis is the core of the system. We will read the video frame by frame and use YOLOv8's
track() function. This function not only detects objects but also assigns a unique ID to each one, allowing us to follow them across frames.cap = cv2.VideoCapture(VIDEO_PATH)
while cap.isOpened():
success, frame = cap.read()
if not success:
break
# Run YOLOv8 tracking on the frame, persisting tracks between frames
results = model.track(frame, persist=True)
# Get the bounding boxes and track IDs
boxes = results[0].boxes.xywh.cpu()
track_ids = results[0].boxes.id.int().cpu().tolist()
# Visualize the results on the frame
annotated_frame = results[0].plot()
# Draw the alert zone polygon on the frame
cv2.polylines(annotated_frame, [ALERT_ZONE_POLYGON], isClosed=True, color=(0, 255, 255), thickness=2)
# Hashtags: #RealTime #ObjectTracking #VideoProcessing
(Note: The code below should be placed inside the
while loop of Step 3)---
#Step 4: Implementing Loitering Logic and AlertsInside the main loop, we'll iterate through each tracked person. We check if their position is inside our alert zone. If it is, we start or update a timer. If the timer exceeds our threshold, we trigger an alert for that person's ID.
#PyQt5 #SQLite #DesktopApp #Pharmacy #Barcode #Python
Lesson: Building a Pharmacy Management System with PyQt5 and Barcode Scanning
This tutorial will guide you through creating a complete desktop application for managing a pharmacy. The system will use a SQLite database for inventory, and a Point of Sale (POS) interface that uses barcode scanning to add drugs to a sale and automatically deducts stock upon completion.
---
First, we create a dedicated file to handle all SQLite database operations. This keeps our data logic separate from our UI logic. Create a file named
---
Create the main application file,
Lesson: Building a Pharmacy Management System with PyQt5 and Barcode Scanning
This tutorial will guide you through creating a complete desktop application for managing a pharmacy. The system will use a SQLite database for inventory, and a Point of Sale (POS) interface that uses barcode scanning to add drugs to a sale and automatically deducts stock upon completion.
---
#Step 1: Database Setup (database.py)First, we create a dedicated file to handle all SQLite database operations. This keeps our data logic separate from our UI logic. Create a file named
database.py.import sqlite3
DB_NAME = 'pharmacy.db'
def connect():
return sqlite3.connect(DB_NAME)
def setup_database():
conn = connect()
cursor = conn.cursor()
cursor.execute('''
CREATE TABLE IF NOT EXISTS drugs (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
barcode TEXT NOT NULL UNIQUE,
quantity INTEGER NOT NULL,
price REAL NOT NULL,
expiry_date TEXT NOT NULL
)
''')
conn.commit()
conn.close()
def add_drug(name, barcode, quantity, price, expiry_date):
conn = connect()
cursor = conn.cursor()
try:
cursor.execute("INSERT INTO drugs (name, barcode, quantity, price, expiry_date) VALUES (?, ?, ?, ?, ?)",
(name, barcode, quantity, price, expiry_date))
conn.commit()
except sqlite3.IntegrityError:
return False # Barcode already exists
finally:
conn.close()
return True
def get_all_drugs():
conn = connect()
cursor = conn.cursor()
cursor.execute("SELECT id, name, barcode, quantity, price, expiry_date FROM drugs ORDER BY name")
drugs = cursor.fetchall()
conn.close()
return drugs
def find_drug_by_barcode(barcode):
conn = connect()
cursor = conn.cursor()
cursor.execute("SELECT id, name, barcode, quantity, price, expiry_date FROM drugs WHERE barcode = ?", (barcode,))
drug = cursor.fetchone()
conn.close()
return drug
def update_drug_quantity(drug_id, sold_quantity):
conn = connect()
cursor = conn.cursor()
cursor.execute("UPDATE drugs SET quantity = quantity - ? WHERE id = ?", (sold_quantity, drug_id))
conn.commit()
conn.close()
# Hashtags: #SQLite #DatabaseDesign #DataPersistence #Python
---
#Step 2: Main Application and Inventory Management UICreate the main application file,
main.py. We will set up the main window with tabs for "Point of Sale" and "Inventory Management". We will fully implement the inventory tab first, allowing users to view and add drugs to the database.๐ฅ Trending Repository: pytorch
๐ Description: Tensors and Dynamic neural networks in Python with strong GPU acceleration
๐ Repository URL: https://github.com/pytorch/pytorch
๐ Website: https://pytorch.org
๐ Readme: https://github.com/pytorch/pytorch#readme
๐ Statistics:
๐ Stars: 94.5K stars
๐ Watchers: 1.8k
๐ด Forks: 25.8K forks
๐ป Programming Languages: Python - C++ - Cuda - C - Objective-C++ - CMake
๐ท๏ธ Related Topics:
==================================
๐ง By: https://t.me/DataScienceM
๐ Description: Tensors and Dynamic neural networks in Python with strong GPU acceleration
๐ Repository URL: https://github.com/pytorch/pytorch
๐ Website: https://pytorch.org
๐ Readme: https://github.com/pytorch/pytorch#readme
๐ Statistics:
๐ Stars: 94.5K stars
๐ Watchers: 1.8k
๐ด Forks: 25.8K forks
๐ป Programming Languages: Python - C++ - Cuda - C - Objective-C++ - CMake
๐ท๏ธ Related Topics:
#python #machine_learning #deep_learning #neural_network #gpu #numpy #autograd #tensor
==================================
๐ง By: https://t.me/DataScienceM
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
element = WebDriverWait(driver, 10).until(
EC.presence_of_element_located((By.ID, "myDynamicElement"))
)
โข Get the page source after JavaScript has executed.
dynamic_html = driver.page_source
โข Close the browser window.
driver.quit()
VII. Common Tasks & Best Practices
โข Handle pagination by finding the "Next" link.
next_page_url = soup.find('a', text='Next')['href']โข Save data to a CSV file.
import csv
with open('data.csv', 'w', newline='', encoding='utf-8') as f:
writer = csv.writer(f)
writer.writerow(['Title', 'Link'])
# writer.writerow([title, url]) in a loop
โข Save data to CSV using
pandas.import pandas as pd
df = pd.DataFrame(data, columns=['Title', 'Link'])
df.to_csv('data.csv', index=False)
โข Use a proxy with
requests.proxies = {'http': 'http://10.10.1.10:3128', 'https': 'http://10.10.1.10:1080'}
requests.get('http://example.com', proxies=proxies)โข Pause between requests to be polite.
import time
time.sleep(2) # Pause for 2 seconds
โข Handle JSON data from an API.
json_response = requests.get('https://api.example.com/data').json()โข Download a file (like an image).
img_url = 'http://example.com/image.jpg'
img_data = requests.get(img_url).content
with open('image.jpg', 'wb') as handler:
handler.write(img_data)
โข Parse a
sitemap.xml to find all URLs.# Get the sitemap.xml file and parse it like any other XML/HTML to extract <loc> tags.
VIII. Advanced Frameworks (
Scrapy)โข Create a Scrapy spider (conceptual command).
scrapy genspider example example.com
โข Define a
parse method to process the response.# In your spider class:
def parse(self, response):
# parsing logic here
pass
โข Extract data using Scrapy's CSS selectors.
titles = response.css('h1::text').getall()โข Extract data using Scrapy's XPath selectors.
links = response.xpath('//a/@href').getall()โข Yield a dictionary of scraped data.
yield {'title': response.css('title::text').get()}โข Follow a link to parse the next page.
next_page = response.css('li.next a::attr(href)').get()
if next_page is not None:
yield response.follow(next_page, callback=self.parse)โข Run a spider from the command line.
scrapy crawl example -o output.json
โข Pass arguments to a spider.
scrapy crawl example -a category=books
โข Create a Scrapy Item for structured data.
import scrapy
class ProductItem(scrapy.Item):
name = scrapy.Field()
price = scrapy.Field()
โข Use an Item Loader to populate Items.
from scrapy.loader import ItemLoader
loader = ItemLoader(item=ProductItem(), response=response)
loader.add_css('name', 'h1.product-name::text')
#Python #WebScraping #BeautifulSoup #Selenium #Requests
โโโโโโโโโโโโโโโ
By: @DataScienceN โจ
โค3
๐ฅ Trending Repository: localstack
๐ Description: ๐ป A fully functional local AWS cloud stack. Develop and test your cloud & Serverless apps offline
๐ Repository URL: https://github.com/localstack/localstack
๐ Website: https://localstack.cloud
๐ Readme: https://github.com/localstack/localstack#readme
๐ Statistics:
๐ Stars: 61.1K stars
๐ Watchers: 514
๐ด Forks: 4.3K forks
๐ป Programming Languages: Python - Shell - Makefile - ANTLR - JavaScript - Java
๐ท๏ธ Related Topics:
==================================
๐ง By: https://t.me/DataScienceM
๐ Description: ๐ป A fully functional local AWS cloud stack. Develop and test your cloud & Serverless apps offline
๐ Repository URL: https://github.com/localstack/localstack
๐ Website: https://localstack.cloud
๐ Readme: https://github.com/localstack/localstack#readme
๐ Statistics:
๐ Stars: 61.1K stars
๐ Watchers: 514
๐ด Forks: 4.3K forks
๐ป Programming Languages: Python - Shell - Makefile - ANTLR - JavaScript - Java
๐ท๏ธ Related Topics:
#python #testing #aws #cloud #continuous_integration #developer_tools #localstack
==================================
๐ง By: https://t.me/DataScienceM
๐ฅ Trending Repository: TrendRadar
๐ Description: ๐ฏ ๅๅซไฟกๆฏ่ฟ่ฝฝ๏ผAI ๅฉไฝ ็ๆๆฐ้ป่ต่ฎฏ็ญ็น๏ผ็ฎๅ็่ๆ ็ๆงๅๆ - ๅคๅนณๅฐ็ญ็น่ๅ+ๅบไบ MCP ็AIๅๆๅทฅๅ ทใ็ๆง35ไธชๅนณๅฐ๏ผๆ้ณใ็ฅไนใB็ซใๅๅฐ่ก่ง้ปใ่ดข่็คพ็ญ๏ผ๏ผๆบ่ฝ็ญ้+่ชๅจๆจ้+AIๅฏน่ฏๅๆ๏ผ็จ่ช็ถ่ฏญ่จๆทฑๅบฆๆๆๆฐ้ป๏ผ่ถๅฟ่ฟฝ่ธชใๆ ๆๅๆใ็ธไผผๆฃ็ดข็ญ13็งๅทฅๅ ท๏ผใๆฏๆไผไธๅพฎไฟก/้ฃไนฆ/้้/Telegram/้ฎไปถ/ntfyๆจ้๏ผ30็ง็ฝ้กต้จ็ฝฒ๏ผ1ๅ้ๆๆบ้็ฅ๏ผๆ ้็ผ็จใๆฏๆDocker้จ็ฝฒโญ ่ฎฉ็ฎๆณไธบไฝ ๆๅก๏ผ็จAI็่งฃ็ญ็น
๐ Repository URL: https://github.com/sansan0/TrendRadar
๐ Website: https://github.com/sansan0
๐ Readme: https://github.com/sansan0/TrendRadar#readme
๐ Statistics:
๐ Stars: 6K stars
๐ Watchers: 21
๐ด Forks: 4.5K forks
๐ป Programming Languages: Python - HTML - Batchfile - Shell - Dockerfile
๐ท๏ธ Related Topics:
==================================
๐ง By: https://t.me/DataScienceM
๐ Description: ๐ฏ ๅๅซไฟกๆฏ่ฟ่ฝฝ๏ผAI ๅฉไฝ ็ๆๆฐ้ป่ต่ฎฏ็ญ็น๏ผ็ฎๅ็่ๆ ็ๆงๅๆ - ๅคๅนณๅฐ็ญ็น่ๅ+ๅบไบ MCP ็AIๅๆๅทฅๅ ทใ็ๆง35ไธชๅนณๅฐ๏ผๆ้ณใ็ฅไนใB็ซใๅๅฐ่ก่ง้ปใ่ดข่็คพ็ญ๏ผ๏ผๆบ่ฝ็ญ้+่ชๅจๆจ้+AIๅฏน่ฏๅๆ๏ผ็จ่ช็ถ่ฏญ่จๆทฑๅบฆๆๆๆฐ้ป๏ผ่ถๅฟ่ฟฝ่ธชใๆ ๆๅๆใ็ธไผผๆฃ็ดข็ญ13็งๅทฅๅ ท๏ผใๆฏๆไผไธๅพฎไฟก/้ฃไนฆ/้้/Telegram/้ฎไปถ/ntfyๆจ้๏ผ30็ง็ฝ้กต้จ็ฝฒ๏ผ1ๅ้ๆๆบ้็ฅ๏ผๆ ้็ผ็จใๆฏๆDocker้จ็ฝฒโญ ่ฎฉ็ฎๆณไธบไฝ ๆๅก๏ผ็จAI็่งฃ็ญ็น
๐ Repository URL: https://github.com/sansan0/TrendRadar
๐ Website: https://github.com/sansan0
๐ Readme: https://github.com/sansan0/TrendRadar#readme
๐ Statistics:
๐ Stars: 6K stars
๐ Watchers: 21
๐ด Forks: 4.5K forks
๐ป Programming Languages: Python - HTML - Batchfile - Shell - Dockerfile
๐ท๏ธ Related Topics:
#python #docker #mail #news #telegram_bot #mcp #data_analysis #trending_topics #wechat_robot #dingtalk_robot #ntfy #hot_news #feishu_robot #mcp_server
==================================
๐ง By: https://t.me/DataScienceM
๐ฅ Trending Repository: LEANN
๐ Description: RAG on Everything with LEANN. Enjoy 97% storage savings while running a fast, accurate, and 100% private RAG application on your personal device.
๐ Repository URL: https://github.com/yichuan-w/LEANN
๐ Readme: https://github.com/yichuan-w/LEANN#readme
๐ Statistics:
๐ Stars: 3.9K stars
๐ Watchers: 34
๐ด Forks: 403 forks
๐ป Programming Languages: Python
๐ท๏ธ Related Topics:
==================================
๐ง By: https://t.me/DataScienceM
๐ Description: RAG on Everything with LEANN. Enjoy 97% storage savings while running a fast, accurate, and 100% private RAG application on your personal device.
๐ Repository URL: https://github.com/yichuan-w/LEANN
๐ Readme: https://github.com/yichuan-w/LEANN#readme
๐ Statistics:
๐ Stars: 3.9K stars
๐ Watchers: 34
๐ด Forks: 403 forks
๐ป Programming Languages: Python
๐ท๏ธ Related Topics:
#python #privacy #ai #offline_first #localstorage #vectors #faiss #rag #vector_search #vector_database #llm #langchain #llama_index #retrieval_augmented_generation #ollama #gpt_oss
==================================
๐ง By: https://t.me/DataScienceM
๐ฅ Trending Repository: PythonRobotics
๐ Description: Python sample codes and textbook for robotics algorithms.
๐ Repository URL: https://github.com/AtsushiSakai/PythonRobotics
๐ Website: https://atsushisakai.github.io/PythonRobotics/
๐ Readme: https://github.com/AtsushiSakai/PythonRobotics#readme
๐ Statistics:
๐ Stars: 26.3K stars
๐ Watchers: 509
๐ด Forks: 7K forks
๐ป Programming Languages: Python
๐ท๏ธ Related Topics:
==================================
๐ง By: https://t.me/DataScienceM
๐ Description: Python sample codes and textbook for robotics algorithms.
๐ Repository URL: https://github.com/AtsushiSakai/PythonRobotics
๐ Website: https://atsushisakai.github.io/PythonRobotics/
๐ Readme: https://github.com/AtsushiSakai/PythonRobotics#readme
๐ Statistics:
๐ Stars: 26.3K stars
๐ Watchers: 509
๐ด Forks: 7K forks
๐ป Programming Languages: Python
๐ท๏ธ Related Topics:
#python #algorithm #control #robot #localization #robotics #mapping #animation #path_planning #slam #autonomous_driving #autonomous_vehicles #ekf #hacktoberfest #cvxpy #autonomous_navigation
==================================
๐ง By: https://t.me/DataScienceM
โข Error Handling: Always wrap dispatch logic in
โข Security: Never hardcode credentials directly in scripts. Use environment variables (
โข Rate Limits: SMTP servers impose limits on the number of messages one can send per hour or day. Implement pauses (
โข Opt-Outs: For promotional dispatches, ensure compliance with regulations (like GDPR, CAN-SPAM) by including clear unsubscribe options.
Concluding Thoughts
Automating electronic message dispatch empowers users to scale their communication efforts with remarkable efficiency. By leveraging Python's native capabilities, anyone can construct a powerful, flexible system for broadcasting anything from routine updates to extensive promotional campaigns. The journey into programmatic dispatch unveils a world of streamlined operations and enhanced communicative reach.
#python #automation #email #smtplib #emailautomation #programming #scripting #communication #developer #efficiency
โโโโโโโโโโโโโโโ
By: @DataScienceN โจ
try-except blocks to gracefully handle network issues, authentication failures, or incorrect receiver addresses.โข Security: Never hardcode credentials directly in scripts. Use environment variables (
os.environ.get()) or a secure configuration management system. Ensure starttls() is called for encrypted communication.โข Rate Limits: SMTP servers impose limits on the number of messages one can send per hour or day. Implement pauses (
time.sleep()) between dispatches to respect these limits and avoid being flagged as a spammer.โข Opt-Outs: For promotional dispatches, ensure compliance with regulations (like GDPR, CAN-SPAM) by including clear unsubscribe options.
Concluding Thoughts
Automating electronic message dispatch empowers users to scale their communication efforts with remarkable efficiency. By leveraging Python's native capabilities, anyone can construct a powerful, flexible system for broadcasting anything from routine updates to extensive promotional campaigns. The journey into programmatic dispatch unveils a world of streamlined operations and enhanced communicative reach.
#python #automation #email #smtplib #emailautomation #programming #scripting #communication #developer #efficiency
โโโโโโโโโโโโโโโ
By: @DataScienceN โจ