Metadata-Version: 2.4
Name: mock-requests-restcountries
Version: 0.5.0
Summary: REST Countries mock requests: pre-cached per-URL; missing URLs fetched and cached automatically.
Home-page: https://pypi.org/project/mock-requests-restcountries/
Author: Ethan Steinfeld
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Internet :: WWW/HTTP
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Provides-Extra: dev
Requires-Dist: build; extra == "dev"
Dynamic: license-file

# 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

```bash
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:
1. **Package data** (`mock_requests/data/*.json`) — fastest
2. **User cache** (`~/.cache/mock_requests_rc/*.json`)
3. **Live fetch** then save to user cache
4. Else: return 404-like mock response
