PyDynamics
Client and Query Builder for On-Premise Microsoft Dynamics CRM.
Getting an Auth Token
The first task would be to fetch an authentication token. To do this pass your username and password to the token.get() function along with the URL of your CRM instance.
from pydynamics import token
tok = token.get('https://crm.domain.com/', 'DOMAIN\\username', 'password')
The returned token can then be used in subsequent client calls.
Create a client instance
Pass the token generated above to the Client constructor along with the API URL.
from pydynamics.client import Client
client = Client(tok, 'https://crm.domain.com/INSTANCE/api/data/v8.1/')
Building Queries
The package includes a query builder.
Select a single item
The below example returns a single contact record, selected on its GUID and selects 3 specific fields to return. the select() part is optional, a default field set will be returned if it is omitted.
from pydynamics.querybuilder import QueryBuilder
q = QueryBuilder('contacts').guid('1bf1c4cf-1ed1-e311-941c-0050568a018c').\
select(['firstname','lastname', 'emailaddress1'])
result = client.select(q)
Select based on filters
The below example returns the first 2, based on the limit(), contacts that contain the string "flowplex" within the emailaddress1 field and implements ordering and return field selection.
from pydynamics.querybuilder import QueryBuilder
q = QueryBuilder('contacts').\
filter('emailaddress1', 'contains', 'flowplex', 'str').\
select(['firstname','lastname', 'emailaddress1']).\
order(['lastname'],'asc').limit(0 ,2)
result = client.select(q)
Create a record
The below creates a contact entity with the data provided to the query builder. The GUID of the new item will be returned if successful.
from pydynamics.querybuilder import QueryBuilder
q = QueryBuilder('contacts').data({
'firstname': 'Dan',
'lastname': 'Test',
'emailaddress1': 'dan@fdsdsds.com'
})
guid = client.create(q)
Update a record
The below updates the firstname field on the specific contact record.
from pydynamics.querybuilder import QueryBuilder
q = QueryBuilder('contacts').guid('1bf1c4cf-1ed1-e311-941c-0050568a018c').\
data({'firstname': 'Daniel'})
client.update(q)
Metadata
Release files for pydynamics 0.0.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pydynamics-0.0.10.tar.gz | 6.8 kB | Without provenance | Details for pydynamics-0.0.10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pydynamics-0.0.10-py3-none-any.whl | Python 3 | none | any | Details for pydynamics-0.0.10-py3-none-any.whl |
Total release size: 14.2 kB
Release files / pydynamics-0.0.10.tar.gz
| Download URL | pydynamics-0.0.10.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3fc6d1ced2128f3ff9d30084ff3afa1a9bd687e9208f8b4b5b15ec3d525046b6
|
|
BLAKE2b-256 checksum How to use checksums |
ce7ac33fae0c78ae3e8b65d933a152a58109efe6f1be391ff41457cba4eee78e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / pydynamics-0.0.10-py3-none-any.whl
| Download URL | pydynamics-0.0.10-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9225862a9779c50e0be28638393ef96caf19497eeaed9aa97547f3a2627b4e68
|
|
BLAKE2b-256 checksum How to use checksums |
baf2577e2a02e28ad18478d4ae73a8d41315fb450847e0b2665ec820063fa964
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Security for pydynamics 0.0.10
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.