
Security News
Feross on Risky Business Weekly Podcast: npm’s Ongoing Supply Chain Attacks
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
A Python library for simplified HTTP requests, featuring rate limiting, browser-like headers, and automatic retries. Built on the official `requests` library for reliability.
A Python library for simplified HTTP requests, featuring rate limiting, browser-like headers, and automatic retries. Built on the official requests
library for reliability.
pip install easy-requests
from easy_requests import Connection, init_cache
init_cache(".cache")
connection = Connection()
# to generate headers that mimic the browser
connection.generate_headers()
response = connection.get("https://example.com")
from easy_requests import Connection
import cloudscraper
connection = Connection(cloudscraper.create_scraper())
response = connection.get("https://example.com")
This won't use caching without you configuring it.
You can configure the default cache either with environment variables or using init_cache
. The env keys are EASY_REQUESTS_CACHE_DIR
and EASY_REQUESTS_CACHE_EXPIRES
(in days).
from easy_requests import init_cache
init_cache(".cache")
Alternatively you can pass arguments into Connection(...)
and the request function:
cache_enabled: Optional[bool]
cache_directory: Optional[str]
cache_expires_after: Optional[timedelta]
from easy_requests import Connection
Connection(
cache_enabled = True
)
If you pass in cache_enabled=True
it will raise a Value error if no cache directory was found.
FAQs
A Python library for simplified HTTP requests, featuring rate limiting, browser-like headers, and automatic retries. Built on the official `requests` library for reliability.
We found that easy-requests demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.