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.5.0.tar.gz (51.4 kB view details)

Uploaded Source

Built Distribution

udlai-0.5.0-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: udlai-0.5.0.tar.gz
  • Upload date:
  • Size: 51.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for udlai-0.5.0.tar.gz
Algorithm Hash digest
SHA256 38d33cb02a9de832d5acb657a7095997d5594bdc55c91b2cd2f885294a32899e
MD5 1bf10e69500011a6921003370ac4dc2f
BLAKE2b-256 4fdceda1a6dafc61b1757b5ff718c60df69b2ad15420b780e9cb3722f50b4641

See more details on using hashes here.

File details

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

File metadata

  • Download URL: udlai-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for udlai-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f7bdabcafa3004436aca17b92ec7bc0e5961b399d484e8f2fb14ab08584757f6
MD5 fc2f2451106bbc6c00225c5278d5f85d
BLAKE2b-256 c9ef1a1cd09a6f544a264c613f503c700fae67b451bfb93ceda1574c077d0c8c

See more details on using hashes here.

Supported by

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