Skip to main content

ruia_cache - A Ruia plugin for caching URL.

Project description

ruia-cache

A Ruia plugin for caching URL

Installation

pip install -U ruia-cache

# New features
pip install git+https://github.com/python-ruia/ruia-cache

Usage

ruia-cache will automatically cache the captured URL to prevent the second request to the target web page:

import os

from ruia_cache import RuiaCacheSpider

# Set RUIA_CACHE path
os.environ.setdefault(
    "RUIA_CACHE", os.path.dirname(__file__),
)


class Demo(RuiaCacheSpider):
    name = "demo_spider"
    start_urls = ["http://httpbin.org/get"]

    async def parse(self, response):
        html = await response.text()
        print(html)


if __name__ == "__main__":
    Demo.start()
    # Using cache data
    Demo.start()

Enjoy it :)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ruia_cache-0.0.2.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

ruia_cache-0.0.2-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file ruia_cache-0.0.2.tar.gz.

File metadata

  • Download URL: ruia_cache-0.0.2.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.3

File hashes

Hashes for ruia_cache-0.0.2.tar.gz
Algorithm Hash digest
SHA256 b0d940eb125c85e468761da000ae2f43b67c6dd9c3b0cefa630679d630763ab0
MD5 7cef6f4b22da22e87786357a6f4c5c6b
BLAKE2b-256 8729101cb95c88d914ee1e64ca05c564a1470ccb779fd74e4d748d0baa454194

See more details on using hashes here.

File details

Details for the file ruia_cache-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: ruia_cache-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.3

File hashes

Hashes for ruia_cache-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f567db1b5f32844a3ae41b655a743009ae7b47edcc428b3a149d37d5c6696d4d
MD5 626dc141168c5946b6b293d6a7278ba8
BLAKE2b-256 13337907855b553614c1442e695f940d0f5a22e382de03bb06521be35bbf62be

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page