Metadata-Version: 2.4
Name: dataverse_rest_api
Version: 0.4.3
Summary: Lightweight Python client for connecting to the Dataverse REST API.
Home-page: https://github.com/tle-nate/dataverse-rest-api_python
Author: tlenate
License: MIT
Project-URL: Source, https://github.com/tle-nate/dataverse-rest-api_python
Project-URL: Issue Tracker, https://github.com/tle-nate/dataverse-rest-api_python/issues
Keywords: dataverse dynamics365 msal device-flow rest api client
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: msal>=1.0.0
Requires-Dist: requests>=2.20.0
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: project-url
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary


A lightweight Python client for connecting to the Dataverse (Dynamics 365) REST API 
with no-fuss browser based login.  

## Installation

```bash
pip install dataverse-rest-api
```

## Usage

```python
from dataverse_rest_api import DataverseClient

client = DataverseClient("https://yourorg.crm.dynamics.com")

client.authenticate()

# Query top 5 contacts
contacts = client.query("contacts", odata="$top=5")
print(contacts)

# Create a new contact
new_contact_id = client.create(
    "contacts", 
    {"firstname": "Sam", "lastname": "Smith"}
)
print(new_contact_id)

# Update that contact
client.patch_record(
    "contacts", 
    new_contact_id,
    {"jobtitle": "Software Engineer"}
)

# Delete the contact
client.delete_record("contacts", new_contact_id)

# Or send a fully custom request
resp = client.send_request(
    method="POST",
    endpoint="api/data/v9.2/tle_mycustomapi",
    data={}
)
print(resp.json())

# Reset the client and clear any cached access tokens 
client.reset() 
```
