Mock external REST APIs for tests. Testing utilities.
Project description
pyrestmock
Mock REST APIs
Installation
pip install pyrestmock
💡 Usage Examples
Basic Operations
from pylib_restmock import MockServer
# Create mock server
server = MockServer()
server.add_route("GET", "/api/data", {"result": "success"})
response = server.request("GET", "/api/data")
AI/ML Use Cases
from pylib_restmock import MockServer
# Mock AI API for testing
mock_ai_api = MockServer()
mock_ai_api.add_route("POST", "/api/predict", {"prediction": "cat"})
📚 API Reference
See package documentation for complete API reference.
🤖 AI Agent Friendly
This package is optimized for AI agents and code generation tools:
- Clear function names and signatures
- Comprehensive docstrings with examples
- Type hints for better IDE support
- Common use cases documented
- Zero dependencies for reliability
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pylib_restmock-0.1.0.tar.gz
(2.1 kB
view details)
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 pylib_restmock-0.1.0.tar.gz.
File metadata
- Download URL: pylib_restmock-0.1.0.tar.gz
- Upload date:
- Size: 2.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4193f6144cbbddfca0d2ece88aec61ab026201e67470fb19221f41852f13b294
|
|
| MD5 |
3821a400a4a99186fc7dc47c9946fd42
|
|
| BLAKE2b-256 |
b38e9d44a9b17aa73c00be02f96e427ebcabdfb3e7db6bf57a17ae95ef99ad83
|
File details
Details for the file pylib_restmock-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pylib_restmock-0.1.0-py3-none-any.whl
- Upload date:
- Size: 1.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09191d44f214fdba61ea0e15745b2ac1474e42455f6c0a5c50bcf553d347435e
|
|
| MD5 |
da8a1f2233995e2ba13f03f233931c43
|
|
| BLAKE2b-256 |
31d15ac509e5a60942147a5ef6a396854c2670fddd9f273c976286d38e5a80cf
|