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 dtmsupport@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.0.11.tar.gz (4.8 kB view hashes)

Uploaded Source

Built Distribution

dtmapi-0.0.11-py3-none-any.whl (5.8 kB view hashes)

Uploaded Python 3

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