REST Countries mock requests: pre-cached per-URL; missing URLs fetched and cached automatically.
Project description
mock-requests-restcountries
A mock for REST Countries (v3.1):
- Uses packaged JSONs for common URLs
- If a URL isn't cached, it fetches live once and caches to
~/.cache/mock_requests_rc
Local usage
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -U pip build
pip install -e ".[dev]"
## Bulk priming
- Prime many URLs into **user cache** (and optionally copy into package data):
```bash
python scripts/bulk_prime.py --urls-file scripts/seed_urls.txt --to-package
Runtime behavior
Resolution order for a URL:
- Package data (
mock_requests/data/*.json) — fastest - User cache (
~/.cache/mock_requests_rc/*.json) - Live fetch then save to user cache
- Else: return 404-like mock response
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mock_requests_restcountries-0.7.0.tar.gz.
File metadata
- Download URL: mock_requests_restcountries-0.7.0.tar.gz
- Upload date:
- Size: 359.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04688a1ddf508787d01b31e46d153134f260d9f4167b97328e70ae41ae40f43b
|
|
| MD5 |
21958f74d291123cee4027c1ff002b33
|
|
| BLAKE2b-256 |
3f22b6a1a338785cb2830a83824f2b5edf290da16794f6a5dfe54b095d924603
|
File details
Details for the file mock_requests_restcountries-0.7.0-py3-none-any.whl.
File metadata
- Download URL: mock_requests_restcountries-0.7.0-py3-none-any.whl
- Upload date:
- Size: 399.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b7aa3bbb1c63c86bd712fd2cdd3903fa67601cc0eabd087df9a939bdc613aee
|
|
| MD5 |
a6d0f411a32774b1f95004edcac44b2e
|
|
| BLAKE2b-256 |
987771ac96aea4ad17ccbaeb99e20ae341c2dbfba98ff2a614df843934353d68
|