Стандартная библиотека asyncio это стандарт (начиная с Py3.4) для работы с асинхронным кодом. Но эта библиотека достаточно низкоуровневая, со своими проблемами, устаревшими подходами.
Чтобы исправить это, были созданы разные обертки и альтернативы с реализацией популярных инструментов и паттернов асинхронного программирования. Это такие библиотеки как:
- trio: улучшает корректность выполнения, не оставляя потерянных корутин при ошибках, то есть предлагает Structured Concurrency из коробки.
- curio: упрощение синтаксиса и читаемости кода, больше похоже на работу с потоками.
- anyio: универсальная обертка над asyncio или trio плюс множество вспомогательных инструментов.
anyio используется в FastAPI как основная библиотека для работы с асинхронным кодом и вызовом синхронного кода из асинхронного.
В общем, рекомендую почитать про возможности anyio, возможно вы более не будете использовать чистый asyncio в своих проектах)
Это совсем не значит что дефолтный asyncio плох, он тоже даёт достаточный для работы функционал и продолжает развиваться. Например, в версии 3.11 появились TaskGroup, с похожим на trio функционалом. Так что он тоже актуален, просто придется больше написать кода самостоятельно.
#libs#async
https://medium.com/towards-data-science/using-scrapy-to-build-your-own-dataset-64ea2d7d4673
In short, #Scrapy is a framework built to build web scrapers more easily and relieve the pain of maintaining them. Basically, it allows you to focus on the data extraction using #CSS selectors and choosing XPath expressions and less on the intricate internals of how spiders are supposed to work.
#scrapy
Scrapy is a fast high-level #web crawling and web scraping framework, used to crawl websites and extract structured data from their pages. It can be used for a wide range of purposes, from #data_mining to #monitoring and #automated_testing.
https://github.com/scrapy/scrapy
#python#crawler#feapder#feaplat#python#scrapy#spider
Feapder is a simple, powerful Python web scraping framework (Python 3.6+) with four spider types for different needs, plus breakpoint resuming, monitoring alerts, browser rendering, and massive data deduplication. Install easily via pip (basic, render, or full versions), create a spider with one command, and run it to fetch/parse sites like Baidu. A management system handles deployment/scheduling. This saves you time by making scraping fast, reliable, and scalable without building everything from scratch.
https://github.com/Boris-code/feapder
#webScraping#Python#Scrapy
🐍
Scrapy course - Python web scraping for beginners
The Scrapy #Beginners Course will teach you everything you need to learn to start scraping websites at scale using #Python Scrapy.
Topics
- Creating your first #Scrapy spider
- #Crawling through websites & scraping data from each page
- Cleaning data with Items & Item Pipelines
- Saving data to CSV files, #MySQL & #Postgres#databases
- Using fake #user-agents & headers to avoid getting blocked
- Using #proxies to scale up your web scraping without getting banned
- Deploying your #scraper to the cloud & scheduling it to run periodically
🗣️ Joe Kearney.
🔗Link
📢#youtube
⭐️ Resources ⭐️
Course Resources
- Scrapy Docs
- Course Guide
- Course Github
- The Python Scrapy Playbook
-----
Main channel: @repo_science
Coupons: @freecoupons_reposcience
-----