Browse Source

Switch from requests to httpx

master
David Larlet 5 years ago
parent
commit
9547c1d65f
No known key found for this signature in database
2 changed files with 3 additions and 4 deletions
  1. 2
    2
      cache.py
  2. 1
    2
      requirements.txt

+ 2
- 2
cache.py View File

from pathlib import Path from pathlib import Path
from time import perf_counter from time import perf_counter


import httpx
import lxml import lxml
import markdown import markdown
import requests
from jinja2 import Environment as Env from jinja2 import Environment as Env
from jinja2 import FileSystemLoader from jinja2 import FileSystemLoader
from minicli import cli, run, wrap from minicli import cli, run, wrap
embeddable in the template and rendered as is. embeddable in the template and rendered as is.
""" """
# Retrieves the resource and turns it into a Readability doc. # Retrieves the resource and turns it into a Readability doc.
response = requests.get(url)
response = httpx.get(url)
document = Document(response.text) document = Document(response.text)


# The short title is more concise and readable. # The short title is more concise and readable.

+ 1
- 2
requirements.txt View File

Jinja2==2.10.3 Jinja2==2.10.3
Markdown==3.1.1 Markdown==3.1.1
MarkupSafe==1.1.1
httpx==0.7.8
minicli==0.4.4 minicli==0.4.4
readability-lxml==0.7.1 readability-lxml==0.7.1
requests==2.22.0

Loading…
Cancel
Save