Skip to main content

A Python package for fetching data from the IOM's Displacement Tracking Matrix (DTM).

Project description

DTM Logo


dtmapi

PyPI Documentation Status License

About

dtmapi is a Python package developed by Displacement Tracking Matrix (DTM). This package allows the humanitarian community, academia, media, government, and non-governmental organizations to utilize the data collected by DTM. It provides non-sensitive Internally Displaced Person (IDP) figures, aggregated at the country, Admin 1 (states, provinces, or equivalent), and Admin 2 (smaller subnational administrative areas) levels.

Please find more information about DTM API here.

Installation

dtmapi is available on PyPI. It can be installed as below:

pip install dtmapi

Usage

Here's a quick example to get you started:

import dtmapi

# Get all countries for which DTM data is publicly available through the API.
all_country_list = dtmapi.get_all_countries()
all_country_list.head()

# Get all operations for which DTM data is publicly available through the API.
all_operation_list = dtmapi.get_all_operations()
all_operation_list.head()

# Get IDP Admin 0 Data for Ethiopia from Round 1 to Round 10
idp_admin0_data = dtmapi.get_idp_admin0_data(CountryName='Ethiopia', FromRoundNumber=1, ToRoundNumber=10, to_pandas=True)
idp_admin0_data.head()

# Get IDP Admin 1 Data for Sudan from reporting date 2020-01-01 to 2024-08-15
idp_admin1_data = dtmapi.get_idp_admin1_data(CountryName='Sudan', Admin1Name="Blue Nile", FromReportingDate='2020-01-01', ToReportingDate='2024-08-15', to_pandas=True)
idp_admin1_data.head()

# Get IDP Admin 2 Data for Lebanon
idp_admin2_data = dtmapi.get_idp_admin2_data(Operation="Displacement due to conflict", CountryName='Lebanon', to_pandas=True)
idp_admin2_data.head()

Documentation

Comprehensive documentation is available at dtmapi.readthedocs.io.

Source Code

The source code for dtmapi is available on GitHub.

Feel free to explore the repository, contribute, or raise any issues you may encounter.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For any questions or feedback, please reach out to us at dtmdataconsolidation@iom.int.

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

dtmapi-0.1.1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

dtmapi-0.1.1-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file dtmapi-0.1.1.tar.gz.

File metadata

  • Download URL: dtmapi-0.1.1.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for dtmapi-0.1.1.tar.gz
Algorithm Hash digest
SHA256 077f542fdf9df23c75f09efa76be35c78a4fd193d8254abcfe017cb2f31587c7
MD5 0c607d6b05569dbabc6d491513cddf5c
BLAKE2b-256 a785eecff5110dcae1394dce2e2ed3db528d8919b26c52bf2ae2a3cba5b32c60

See more details on using hashes here.

File details

Details for the file dtmapi-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: dtmapi-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for dtmapi-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6c0d4b508767d8de1d89bed97f6475372cbeb1f5986680c9a2f03586f84a6c90
MD5 0611a8a3c42d838c771dee35ebdcad38
BLAKE2b-256 1d8f3588ce6cddc0e2e22f73b96bc11caa30d652fe4a3a52f7bb8c6bcc067d36

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