ValuationPrototype.API is a prototype backend service for property valuation, designed to mimic the manual assessment process for real estate. It demonstrates how a valuation workflow can be automated using public records and comparable property data, without relying on live API integrations. The project is built with FastAPI and Pydantic, and is intended for demonstration, and prototyping purposes.
- Accepts property details (address, photos, condition) via a
/valuationPOST API endpoint. - Mimics fetching property info and logical comparables from public records (using static data and pseudocode).
- Returns a market valuation and detailed analysis based on pre-selected comparables and manual logic.
- Provides a clear, step-by-step structure for how a real-world automated valuation system would operate.
- Startup Optimization: On app startup, comparable property data is loaded from
data/comps.jsonand cached in memory for fast access. - Valuation Endpoint: The
/valuateendpoint accepts a property address, condition, and optional photos. It mimics the following steps:- Fetching property info from public records (pseudocode).
- Selecting logical comparables (pseudocode, uses static data from manual step).
- Comparing features and adjusting value (pseudocode, uses manual logic).
- Returning a hardcoded valuation and analysis based on the manual assessment.
- Data Models: All data is validated and structured using Pydantic models (
Comparable,PropertyRequest,ValuationResponse). - Testing: Includes a test to validate the integrity of the comparables data and its compatibility with the models. Further tests for the comparison and analysis logic would go here, but in the same format.
app/main.py: FastAPI app, endpoint logic, and pseudocode for assessment steps.app/models.py: Pydantic models for property, comparables, and responses.app/repositories.py: Loads comparables from JSON data.data/comps.json: Static comparable property data.tests/test_models.py: Pytest test for data/model validation.requirements.txt: Python dependencies.LICENSE: MIT License.
-
Clone the Repository
git clone `https://github.com/SamuelNw/ValuationPrototype.API` cd ValuationPrototype.API
-
Set Up Python Environment
- Recommended: Python 3.10+
- Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate
-
Install Dependencies
pip install -r requirements.txt
-
Run the API Server
uvicorn app.main:app --reload
The API will be available at
http://127.0.0.1:8000. -
Test the Endpoint
- Since FastAPI has auto-docs with Swagger, after running the app, navigate to
http://127.0.0.1:8000/docsand tap on try it out option next to the endpoint listed and input data like:{ "property_address": "2028 NE 17th Pl, Cape Coral, FL 33909", "condition": "standard", "photos": [] } - You will receive a valuation and analysis based on the manual logic and static comparables.
- Since FastAPI has auto-docs with Swagger, after running the app, navigate to
-
Run Tests
python3 -m pytest tests/
- This prototype does not perform live API integrations or real data fetching; all steps are mimicked with static data and pseudocode for clarity.
- The analysis and valuation logic are based on a manual assessment and can be extended for real-world use.
This project is licensed under the MIT License. See LICENSE for details.