Download the PHP package housell/urbandataanalytics without Composer

On this page you can find all versions of the php package housell/urbandataanalytics. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package urbandataanalytics

Urban Data Analytics PHP API

This is a fast and secure integration for uDA Real Estate Data, S.L.

This library allows creating and checking applications thought the webservice.

Check the documentation https://api.urbandataanalytics.com/docs

Installation

Composer

To install the library, you must execute the following code:

composer require housell/urbandataanalytics master

Manual

Download the library from https://github.com/Housell/urbandataanalytics

Include all the files from the "installation path/src"

function autoload($path) {
    $items = glob($path . DIRECTORY_SEPARATOR . "*");

    foreach($items as $item) {
        $isPhp = pathinfo($item) ["extension"] === "php";

        if (is_file($item) && $isPhp) {
            require_once $item;
        } elseif (is_dir($item)) {
            autoload($item);
        }
    }
}

autoload($installation_path . DIRECTORY_SEPARATOR . 'src');

Usage

To instance the API

use UrbanDataAnalytics\Api;

$Api = new Api($YOUR_API_TOKEN);

Create an Asset

Example to create an asset

use UrbanDataAnalytics\Asset;

$Asset = new Asset();
$Asset->operation = Asset::OPERATION_SALE;
$Asset->area = 40;
$Asset->lat = 40.45454062568134;
$Asset->lon = -3.7071921786304336;
$Asset->portfolio_id = 123456;

Create the indicators

The indicators to ask

use UrbanDataAnalytics\Indicator;

$indicator = new Indicator();
$indicator->indicator = Indicator::AVG_PRICE;
$indicator->admin_level = Indicator::ADMIN_LEVEL_NEIGHBORHOOD;

Basic Asset valuation

To ask for the valuation of an Asset, we need to send the asset and the indicators via the valuation function of the API

Example:

try {
    $Valuation = $Api->valuation($Asset, 123456, $indicators);
} catch (Exception $e) {
    echo $e->getMessage();
}

Throws Exception on error

Returns Valuation

Documentation

Api

// Configuration
public $authorization_token = '';

// Registry
public $call_url;
public $post_data;
public $raw_response;
public $info;

Api::valuation(Asset $Asset, $portfolio_id, array $Indicators = null, $price_type = null)

To ask for the valuation of an Asset, we need to send the asset and the indicators via the valuation function of the API

Model

Dynamically validates the objects and creates json objects from the public properties on __toString

Object classes

All the classes that extend from Model

Every class has its own constants and public properties

Asset

Mandatory properties "area", "lat", "lon" and "portfolio_id"

// operation
const OPERATION_RENT = 0;
const OPERATION_SALE = 1;

// property_type
const PROPERTY_TYPE_UNKNOWN = 0;
const PROPERTY_TYPE_PENTHOUSE = 1;
const PROPERTY_TYPE_DUPLEX = 2;
const PROPERTY_TYPE_HOUSE = 3;
const PROPERTY_TYPE_APARTMENT = 4;
const PROPERTY_TYPE_SEMI_DETACHED_HOUSE = 5;
const PROPERTY_TYPE_TERRACED_HOUSE = 6;
const PROPERTY_TYPE_STUDIO = 7;
const PROPERTY_TYPE_COUNTRY_SIDE_HOUSE = 8;

// construction_type
const CONSTRUCTION_TYPE_BRAND_NEW = 1;
const CONSTRUCTION_TYPE_SECOND_HAND = 2;

// energy_cert
const ENERGY_CERT_UNKNOWN = 0;
const ENERGY_CERT_A_PLUS = 11;
const ENERGY_CERT_A = 1;
const ENERGY_CERT_B = 2;
const ENERGY_CERT_C = 3;
const ENERGY_CERT_D = 4;
const ENERGY_CERT_E = 5;
const ENERGY_CERT_F = 6;
const ENERGY_CERT_G = 7;
const ENERGY_CERT_EXEMPT_PROPERTY = 8;
const ENERGY_CERT_NOT_INDICATED = 9;
const ENERGY_CERT_IN_PROCESS = 10;

// status
const STATUS_UNKNOWN = 0;
const STATUS_GOOD_CONDITION = 1;
const STATUS_PARTIAL_REFORMATION = 2;
const STATUS_TOTAL_REFORMATION = 5;
const STATUS_BRAND_NEW = 6;

// usage
const USAGE_UNKNOWN = 0;
const USAGE_RESIDENTIAL = 1;
const USAGE_OFFICE = 2;
const USAGE_LOCAL = 5;
const USAGE_SHED = 6;
const USAGE_PARKING_LOT = 7;
const USAGE_TERRAIN = 8;

// furnished
const FURNISHED_UNKNOWN = 0;
const FURNISHED_UNFURNISHED = 1;
const FURNISHED_PARTLY_FURNISHED = 2;
const FURNISHED_FULLY_FURNISHED = 3;

/* @var bool */
public $ac;

/* @var string */
public $address;

/* @var bool */
public $agency;

/* @var int */
public $area;

/* @var string JSON value */
public $avm;

/* @var int */
public $bathrooms;

/* @var int */
public $boundary_id;

/* @var string */
public $boundary_code;

/* @var bool */
public $common_zones;

/* @var string GeoJSON */
public $competitors_geom;

/* @var string Date YYYY-MM-DD HH:MM:SS */
public $date_in;

/* @var string Date YYYY-MM-DD HH:MM:SS */
public $date_out;

/* @var int */
public $construction_type;

/* @var string JSON */
public $custom_attrs;

/* @var bool */
public $elevator;

/* @var int */
public $energy_cert;

/* @var string */
public $external_id;

/* @var string Decimal */
public $floor;

/* @var int */
public $furnished;

/* @var bool */
public $garage;

/* @var bool */
public $gymn;

/* @var int */
public $id;

/* @var float Decimal */
public $lat;

/* @var float Decimal */
public $lon;

/* @var string */
public $notes;

/* @var int */
public $operation;

/* @var bool */
public $orientation_east;

/* @var bool */
public $orientation_north;

/* @var bool */
public $orientation_south;

/* @var bool */
public $orientation_west;

/* @var bool */
public $outside;

/* @var bool */
public $pool;

/* @var int */
public $portfolio_id;

/* @var int */
public $price;

/* @var int */
public $price_sale;

/* @var int */
public $price_rent;

/* @var int */
public $property_type;

/* @var string */
public $reference;

/* @var string */
public $report_url;

/* @var int */
public $rooms;

/* @var bool */
public $simulated;

/* @var bool */
public $sports_area;

/* @var int */
public $status;

/* @var bool */
public $storage;

/* @var bool */
public $terrace;

/* @var int */
public $usage;

Competitor

/* @var string */
public $admin0;

/* @var string */
public $admin3;

/* @var string */
public $admin4;

/* @var string */
public $admin5;

/* @var integer */
public $construction_year;

/* @var string */
public $contact_name;

/* @var integer */
public $days;

/* @var float */
public $distance;

/* @var array */
public $images;

/* @var Boolean */
public $is_stock;

/* @var Boolean */
public $is_vpo;

/* @var Boolean */
public $relevant;

/* @var float */
public $rank;

/* @var string */
public $source_url;

Indicator

Mandatory properties 'indicator' and 'admin_level'

// indicators
const INDICATOR_SALE_RENT_PERCENT = 's_p';
const INDICATOR_SALE_RENT_UNITS = 's_u';
const INDICATOR_SALE_RENT_DIFF_PREV_Q_PERCENT = 's_u_qq';
const INDICATOR_SALE_RENT_DIFF_PREV_Q_PERCENTILE = 's_u_qq_rk';
const INDICATOR_SOLD_RENTED_DIFF_PREV_Q_PERCENT = 'o_u_qq';
const INDICATOR_SOLD_RENTED_DIFF_PREV_Q_PERCENTILE = 'o_u_qq_rk';
const INDICATOR_NEW_STOCK_DIFF_PREV_Q_PERCENTILE = 'i_u_qq_rk';
const INDICATOR_TOTAL_ABSORPTION_RATIO_PERCENT = 'o_a';
const INDICATOR_AVG_PRICE = 'o_pm';
const INDICATOR_AVG_PRICE_PER_METER = 'o_pu';
const INDICATOR_AVG_PRICE_PRE_METER_DIFF_PREV_Q_PERCENT = 'o_pu_qq';
const INDICATOR_ESTIMATED_TIME_TO_SELL_RENT = 's_t';
const INDICATOR_ESTIMATED_TIME_TO_SELL_RENT_DIFF_PREV_Q_PERCENT = 's_t_qq';
const INDICATOR_GROSS_RENT_PROFITABILITY = 'y_r';
const INDICATOR_GROSS_SALE_PROFITABILITY = 'y_s';
const INDICATOR_INVESTMENT_INDICATOR = 'r_g';
const INDICATOR_NEGOTIATION_FACTOR = 's_fn';

// admin_levels
const ADMIN_LEVEL_COUNTRY = 0;
const ADMIN_LEVEL_STATE = 1;
const ADMIN_LEVEL_PROVINCE = 2;
const ADMIN_LEVEL_CITY = 3;
const ADMIN_LEVEL_DISTRICT = 4;
const ADMIN_LEVEL_NEIGHBORHOOD = 5;

/* @var string */
public $indicator;

/* @var number */
public $admin_level;

/* @var string */
public $taxonomy;

/* @var string */
public $period;

Valuation

/* @var Competitor[] */
public $competitors;

/* @var array */
public $indicators;

/* @var Asset */
public $attributes;

/* @var object */
public $best_score;

/* @var int */
public $id;

/* @var object */
public $forecast;

Cadastre

/* @var string */
public $reference;

/* @var int */
public $usage;

/* @var int */
public $area;

/* @var string */
public $address;

/* @var float */
public $lon;

/* @var float */
public $lat;

/* @var int */
public $property_type;

/* @var string */
public $origin;

/* @var string */
public $domain;

/* @var string */
public $payload;

All versions of urbandataanalytics with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
ext-json Version *
ext-curl Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package housell/urbandataanalytics contains the following files

Loading the files please wait ....