skillfed

dynamics365crm-python

API wrapper for Dynamics365CRM written in Python

dynamics365crm-python v1.0.2 79.7K downloads/30d#14,343 on PyPI
Permissive license MIT Abandoned released

What it is and what it does

dynamics365crm-python is a wrapper around the Microsoft Dynamics 365 CRM Web API that lets you interact with CRM records from Python code. It handles OAuth2 authentication against Azure AD and provides a client object with methods to query, create, update, and delete contacts, accounts, opportunities, leads, and campaigns. The library depends on msal for authentication and requests for HTTP calls.

The package supports both direct access-token authentication and the full OAuth2 code-exchange flow, including token refresh. It abstracts away the underlying REST API details, letting you work with CRM entities through simple method calls like get_contacts(), create_account(), and update_opportunity(). The library targets Dynamics 365 API version v9.0 and supports Python 3.7 through 3.11.

Use it for:

  • Automate bulk contact or lead imports into Dynamics 365 from external data sources or ETL pipelines.
  • Build a backend service that syncs opportunity or campaign data between Dynamics 365 and another business system.
  • Create a Python script to query and export CRM records for reporting or analytics without manual portal access.
  • Integrate Dynamics 365 CRM data into a web application or bot that needs read/write access to accounts and contacts.
  • Develop a scheduled job that updates lead or campaign records based on external events or triggers.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides a Python client for interacting with Microsoft Dynamics 365 CRM via its Web API, supporting OAuth2 authentication and CRUD operations on contacts, accounts, opportunities, leads, and campaigns.

No—the project is abandoned and will receive no maintenance, bug fixes, or security patches. While the code may still work with current Dynamics 365 instances, you have no recourse if the API changes, dependencies break, or security issues emerge. For production use, seek an actively maintained alternative or consider building directly against the Dynamics 365 REST API.

Install

dynamics365crm-python on PyPI

pip

pip install dynamics365crm-python

uv

uv add dynamics365crm-python

poetry

poetry add dynamics365crm-python

Installing dynamics365crm-python

Before you install

Installation is straightforward with low friction—the package depends only on msal and requests. However, the project is abandoned, meaning no bug fixes or security updates will be issued going forward.

License in practice

Licensed under MIT (permissive), so you can use, modify, and distribute the package freely with minimal restrictions.

Quickstart

pip install dynamics365crm-python

from dynamics365crm.client import Client

client = Client(
    "https://tenant_name.crmX.dynamics.com",
    client_id="CLIENT_ID",
    client_secret="CLIENT_SECRET"
)
contacts = client.get_contacts()

Requires Azure AD application credentials (client_id and client_secret) and a valid Dynamics 365 tenant domain to authenticate and connect.

Verify before relying

  • Whether the package remains compatible with current Dynamics 365 API versions beyond v9.0 or if breaking changes have occurred.
  • Current state of msal and requests dependencies—whether they have introduced breaking changes since the last release.
  • Whether the OAuth2 flow implementation still aligns with current Microsoft Azure AD authentication best practices.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.7,<4.0)
Install friction low — pure-Python wheel
Runtime dependencies 2 — msal, requests
Maintenance abandoned — 1,208 days since the last release
First released
Downloads 79,668/month — #14,343 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: dynamics365crm_python-1.0.2-py3-none-any.whl

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

dynamics 365 crm api clientmicrosoft dynamics 365 pythoncrm contact management apidynamics 365 oauth2 authenticationcrm web api wrapperdynamics 365 lead and opportunity managementazure ad crm integration
crm-integrationmicrosoft-dynamicsoauth2

More WWW/HTTP packages