Skip to content

read_html and read_json should provide a cache #6456

Closed
@c0indev3l

Description

@c0indev3l

Hello,

pandas.io.html.read_html should provide a cache such as what requests_cache provides
https://requests-cache.readthedocs.org/en/latest/

persistence into sqlite, mongodb, redis... is very convenient.

Maybe some other pandas functions could also use this cache mechanism.
pandas.io.json.read_json for example

This is what I do

import requests
import requests_cache
expire_after = 15*60 # expire_after=delay_second or None
requests_cache.install_cache('req_cache', backend='sqlite', expire_after=expire_after)
import json
import pandas as pd
from StringIO import StringIO

req = requests.get(url)
io = StringIO(req.content)
df = pd.read_html(io)

Kind regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocsIO HTMLread_html, to_html, Styler.apply, Styler.applymapIO JSONread_json, to_json, json_normalize

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions