ruia is a free, open source data extraction & web scraping project written in Python and released under Apache-2.0. It has 1,737 GitHub stars, 185 forks and 9 open issues, and was last pushed 10 days ago. On this registry it ranks #74 of 120 tracked projects in Data Extraction & Web Scraping, with 5 head-to-head comparisons available.

What is ruia?

Ruia is an asynchronous web scraping micro-framework for Python 3.6 and above, built on asyncio and aiohttp, and intended for Python developers who want to declare what a crawler should collect and let the framework handle concurrent requests.

What it is

Ruia is a small, Apache-2.0 licensed Python library for writing web crawlers, developed under the python-ruia organisation and published to PyPI as the ruia package. Its programming model is declarative: a crawler is assembled from items that describe the data to be collected, a spider that controls the crawl, and request and response objects that carry pages through the run. The documentation is organised around exactly those pieces, with tutorials for defining data items, spider control, requests and responses, custom middleware and plugins. It describes itself as a micro-framework, which is accurate in the sense that it does not attempt to be a full crawling platform — it supplies the async crawling core and leaves storage, scheduling policy and deployment to the developer.

The problem Ruia addresses is the boilerplate that appears when a crawler is built directly on asyncio and aiohttp. Wiring the event loop, dispatching concurrent requests, handling responses, and structuring parsed output by hand is repetitive, and the same shape of code is rewritten for every site. Ruia replaces that hand-rolled plumbing with a declarative spider abstraction sitting on the same underlying stack, so the crawler definition stays short while execution remains asynchronous. It lives squarely in the Python async ecosystem: aiohttp provides the HTTP layer, uvloop is an optional performance extra, and the project credits demiurge as an influence on its design.

Key capabilities

  • Declarative spider programming, with separate tutorials for defining data items, spider control, and request and response handling.
  • Asynchronous execution powered by asyncio and aiohttp, distributed as the ruia package for Python 3.6 and later.
  • An optional uvloop extra (pip install -U ruia[uvloop]) for Linux and macOS, with a plain install for Windows.
  • Extensibility through middleware and plugins, including a dedicated tutorial on writing plugins and the awesome-ruia plugin collection.
  • JavaScript support, listed among the framework's headline features.
  • Debugging and request-limit helpers in the wider organisation: ruia-cache for caching during debugging to reduce request limits, and ruia-shell for debugging scripts interactively.
  • A black-formatted codebase with an open contribution path for bug reports, plugins, documentation and test cases.

Who uses it and how

  • Python developers who need to crawl many URLs concurrently and prefer a declarative spider definition over writing asyncio and aiohttp code directly.
  • Linux and macOS users who install the uvloop extra to pair the framework with a faster event loop, and Windows users who install the base package.
  • Teams that need crawler-specific behaviour in the request/response pipeline, who implement custom middleware or publish plugins through awesome-ruia.
  • Developers debugging and iterating on crawlers, who use ruia-shell to debug scripts and ruia-cache to cache responses and stay under request limits.
  • Scrapers that need to render or handle pages requiring JavaScript support.

Getting started

Install from PyPI with pip install -U ruia[uvloop] on Linux and macOS, or pip install -U ruia on Windows. New features can be installed ahead of release from source with pip install git+https://github.com/howie6879/ruia.

How it compares

Ruia sits among the Python async tooling it is built on: aiohttp supplies the HTTP client, uvloop is an optional accelerator, and the README credits demiurge as an acknowledged influence on the framework. Its distinguishing choice is the micro-framework scope — a small declarative layer over asyncio rather than a broader crawling platform — with extensibility pushed out to middleware and the awesome-ruia plugin ecosystem.

When to use it — and when not to

Because Ruia is a library rather than a hosted service, there is no database, object store or mail server to operate; what a user runs is a Python environment, and scheduling, persistence and proxy management remain the user's responsibility. Anyone who needs distributed crawling across multiple machines should wait: distributed crawling or scraping is still an unchecked item on the project's TODO list. The README is also brief and defers most explanation to external documentation, and the project describes itself as still under development, so users who require a heavily documented or fully managed scraping platform may be better served elsewhere.

project readme (upstream, from github) — read inline

Ruia logo

Ruia

🕸️ Async Python 3.6+ web scraping micro-framework based on asyncio.

⚡ Write less, run faster.

travis codecov PyPI - Python Version PyPI Downloads gitter

Overview

Ruia is an async web scraping micro-framework, written with asyncio and aiohttp, aims to make crawling url as convenient as possible.

Write less, run faster:

Features

  • Easy: Declarative programming
  • Fast: Powered by asyncio
  • Extensible: Middlewares and plugins
  • Powerful: JavaScript support

Installation

# For Linux & Mac
pip install -U ruia[uvloop]

# For Windows
pip install -U ruia

# New features
pip install git+https://github.com/howie6879/ruia

Tutorials

  1. Overview
  2. Installation
  3. Define Data Items
  4. Spider Control
  5. Request & Response
  6. Customize Middleware
  7. Write a Plugins

TODO

  • Cache for debug, to decreasing request limitation, ruia-cache
  • Provide an easy way to debug the script, ruia-shell
  • Distributed crawling/scraping

Contribution

Ruia is still under developing, feel free to open issues and pull requests:

  • Report or fix bugs
  • Require or publish plugins
  • Write or fix documentation
  • Add test cases

!!!Notice: We use black to format the code.

Thanks

Frequently asked questions

Is ruia free to use?

ruia is open source under the Apache-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does ruia do?

Async Python 3.6+ web scraping micro-framework based on asyncio

What is ruia written in?

ruia is primarily written in Python. Its source is publicly available at https://github.com/howie6879/ruia, and it has 1,737 GitHub stars.