Metadata-Version: 2.4
Name: vws-python-mock
Version: 2026.9.12
Summary: A mock for the Vuforia Web Services (VWS) API.
Author-email: Adam Dangoor <adamdangoor@gmail.com>
License-Expression: MIT
Project-URL: Documentation, https://vws-python.github.io/vws-python-mock/
Project-URL: Source, https://github.com/VWS-Python/vws-python-mock
Keywords: client,fake,mock,vuforia,vws
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Pytest
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.14
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: beartype>=0.22.9
Requires-Dist: flask>=3.0.3
Requires-Dist: httpx>=0.27.0
Requires-Dist: httpx2>=2.12
Requires-Dist: mock-response-delay>=2026.9.12
Requires-Dist: numpy>=2.4.4
Requires-Dist: opencv-contrib-python-headless>=5.0.0.93
Requires-Dist: pillow>=12.2.0
Requires-Dist: pydantic>=2.6
Requires-Dist: pydantic-settings>=2.6.1
Requires-Dist: pyteenybrisque>=0.1.1
Requires-Dist: requests>=2.32.3
Requires-Dist: responses>=0.25.3
Requires-Dist: respx>=0.21.0
Requires-Dist: tzdata; sys_platform == "win32"
Requires-Dist: vws-auth-tools>=2024.7.12
Requires-Dist: werkzeug>=3.1.2
Dynamic: license-file

|Build Status| |PyPI|

VWS Mock
========

.. contents::
   :local:

Mock for the Vuforia Web Services (VWS) API, the Vuforia Web Query API, and the Model Target Web API.

Mocking calls made to Vuforia
------------------------------

``MockVWS`` intercepts requests made with `requests`_, `httpx`_ or `HTTPX2`_.

.. code-block:: shell

    pip install vws-python-mock

This requires Python |minimum-python-version|\+.

.. code-block:: python

    """Make a request to the Vuforia Web Services API mock."""

    import requests

    from mock_vws import MockVWS
    from mock_vws.database import CloudDatabase

    with MockVWS() as mock:
        database = CloudDatabase()
        mock.add_cloud_database(cloud_database=database)
        # This will use the Vuforia mock.
        _ = requests.get(url="https://vws.vuforia.com/summary", timeout=30)

``MockVWS`` also intercepts `httpx`_ requests:

.. code-block:: python

    """Make a request to the Vuforia Web Services API mock using httpx."""

    import httpx

    from mock_vws import MockVWS
    from mock_vws.database import CloudDatabase

    with MockVWS() as mock:
        database = CloudDatabase()
        mock.add_cloud_database(cloud_database=database)
        # This will use the Vuforia mock.
        _ = httpx.get(url="https://vws.vuforia.com/summary", timeout=30)

``MockVWS`` also intercepts `HTTPX2`_ requests, with no need for ``httpx2.alias_httpx()``:

.. code-block:: python

    """Make a request to the Vuforia Web Services API mock using httpx2."""

    import httpx2

    from mock_vws import MockVWS
    from mock_vws.database import CloudDatabase

    with MockVWS() as mock:
        database = CloudDatabase()
        mock.add_cloud_database(cloud_database=database)
        # This will use the Vuforia mock.
        _ = httpx2.get(url="https://vws.vuforia.com/summary", timeout=30)

Asynchronous ``httpx`` and `HTTPX2`_ clients are intercepted as well.

By default, an exception will be raised if any requests to unmocked addresses are made.

.. _requests: https://pypi.org/project/requests/
.. _httpx: https://pypi.org/project/httpx/
.. _HTTPX2: https://httpx2.pydantic.dev/

Using Docker to mock calls to Vuforia from any language
-------------------------------------------------------

It is possible run a Mock VWS instance using Docker containers.

This allows you to run tests against a mock VWS instance regardless of the language or tooling you are using.

See the `the instructions <https://vws-python.github.io/vws-python-mock/docker.html>`__ for how to do this.

Full documentation
------------------

See the `full documentation <https://vws-python.github.io/vws-python-mock/>`__.
This includes details on how to use the mock, options, and details of the differences between the mock and the real Vuforia Web Services.


.. |Build Status| image:: https://github.com/VWS-Python/vws-python-mock/actions/workflows/test.yml/badge.svg?branch=main
   :target: https://github.com/VWS-Python/vws-python-mock/actions
.. |PyPI| image:: https://badge.fury.io/py/VWS-Python-Mock.svg
    :target: https://badge.fury.io/py/VWS-Python-Mock
.. |minimum-python-version| replace:: 3.14
