Skip to main content

UDL.AI Python interface

Project description

UDL.AI Python API

udlai is a way of interacting with the UDL.AI platform for location intelligence using a convenient Python API.

Note, that to use the udlai, you will need to obtain an access token. See udl.ai for details.

Installation

udlai can be installed either from PyPI or conda-forge.

pip install udlai

Or

conda install -c conda-forge udlai
# or alternatively
mamba install -c conda-forge udlai

Features

In the near future, udlai will offer a convenient interface to all parts of the UDL.AI platform. At the moment, only the feature API module is available, allowing you to retrieve data from the UDL.AI data warehouse.

Feature API

Using the token received from UDL you will be able to perform the following tasks:

Fetch the list of attributes

Get a list of all of the attributes the user has access to, completed with their metadata and description.

>>> udlai.attributes(token)
      id                       name  ...  year value_formatter
0      1       Buildings floorspace  ...  2013            None
1      2        Buildings footprint  ...  2013            None
2      3                     Height  ...  2013            None
3      4                    Stories  ...  2013            None
4      9                   box_area  ...  2013            None
..   ...                        ...  ...   ...             ...
234  283             usefit_ind_old  ...     0            None
235  288  Distance secondary school  ...  None            None
236  294            Price 2 bedroom  ...  None            None
237  295            Price 3 bedroom  ...  None            None
238  296           Price 4 bedrooms  ...  None            None

[239 rows x 22 columns]

Fetch specific feature details

Get the properties, description and summary statistics of a specific attribute.

>>> udlai.attribute_detail(token, 22)
id                                                                     22
name                                                          obj_compact
description             Compactness of object: C=obj_peri²/(4*box_area*π)
short_description                                                    None
unit                                                                    -
tags.id                                                                 4
tags.name                                                      Morphology
main_tag.id                                                             4
main_tag.name                                                  Morphology
data_version                                                         None
data_last_update                                                     None
data_processor                                                        UDL
source_provider                                            Swiss Topo TLM
source_provider_link    https://www.swisstopo.admin.ch/de/wissen-fakte...
coverage_general                                              Switzerland
epsg_code                                                            2056
min_value                                                        0.960614
max_value                                                       24.141694
standard_deviation                                               0.893447
mean                                                             1.647733
year                                                                 2013
value_formatter                                                      None
dtype: object

Fetch feature values for a given coordinate(s)

Get the feature values for a provided coordinate location or locations.

>>> udlai.features(token, 47.37, 8.54, [10, 11, 22], index_by="name")
box_length                 104
box_perim                  335
obj_compact    2.2064113123322
Name: (47.37, 8.54), dtype: object

Fetch a summary over an area of interest

Get the summary statistics of an attribute within a specific area.

>>> udlai.aggregates(token, shapely_geom, [10, 12], index_by='name')
                  sum       mean  median   min    max        std
box_length  12921.0  94.313869    94.0  19.0  135.0  30.600546
box_width   13118.0  95.751825   100.0  29.0  142.0  30.870646

Contact person

Martin Fleischmann (@martinfleis)

m.fleischmann@urbandatalab.net

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

udlai-0.6.1.tar.gz (51.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

udlai-0.6.1-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file udlai-0.6.1.tar.gz.

File metadata

  • Download URL: udlai-0.6.1.tar.gz
  • Upload date:
  • Size: 51.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for udlai-0.6.1.tar.gz
Algorithm Hash digest
SHA256 dd3e7ea6f62683376ba48a0f5bd0a71e2594812c27e3897b0d794ef153816d27
MD5 7ce555594726512d4ae5222453322447
BLAKE2b-256 d80d4b5c1b4eed5a66bcd73a5a9816fad67ecfaf8d89682d584bcc49a8d49869

See more details on using hashes here.

File details

Details for the file udlai-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: udlai-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for udlai-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 52c8e0bea9e0228df10e0395529653b86220b48826eacd37e2a4992fc2070a52
MD5 1cd7c393ee5d613b4a39755b713b463f
BLAKE2b-256 55cb1329a52a92d6db62c5c49ada8122a8ff34e60c426744cc365dde258b05f7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page