Eloqua library
Project description
Eloqua Python Connector
Python 3 library for using the Eloqua API
Features
Manage your connection
elq = EloquaConnection(COMPANY, USERNAME, PASSWORD)
CRUD actions with Eloqua Assets (Custom Objects, Forms, Emails, Landing Pages)
dog_owner_custom_object = CustomObject()
dog_owner_custom_object.raw_data = {
"name": "TEST_Dog_Owner",
"description": "Testing Custom Object for dog owners",
"fields": [
{
"name": "DogBreed",
"displayType": "text",
"dataType": "text"
},
{
"name": "StartOfOwnership",
"displayType": "text",
"dataType": "date"
},
{
"name": "AgeAtStartOfOwnership",
"displayType": "text",
"dataType": "number"
},
{
"name": "DogColor",
"displayType": "text",
"dataType": "text"
},
{
"name": "DogName",
"displayType": "text",
"dataType": "text"
}
]
}
elq.create(dog_owner_custom_object)
Generate Usable Models from Custom Objects
Generate model code. Useful for when you have data stored in Eloqua like a database.
object_code = elq.generate_custom_object_code("Dog_Owner_0003", class_name="DogOwner")
print (object_code)
Yields:
class DogOwner(CustomObjectModel):
NAME = "Dog_Owner_0003"
PARENT_ID = "501"
FIELDS = ["DogName1", "Breed1", "DateOfOwnership1"]
ID_FIELD_MAP = {
"123" : "DogName1",
"124" : "Breed1",
"125" : "DateOfOwnership1"
}
DogName1 = None
Breed1 = None
DateOfOwnership1 = None
CRUD actions with Custom Object Data Models
first_dog_owner = elq.get(DogOwner, record_id='1')
all_corgi_dog_owners = elq.get_list(DogOwner,
params={
"search" : "Breed1='Corgi'"
}
)
first_dog_owner.name = "New Dog Name"
elq.update(first_dog_owner)
elq.delete(first_dog_owner)
Variable Paths
The paths.py holds all the paths used for interaction with the API.
Sometimes, a certain API versions works better than others so this is a place where you can change that.
# Login
DEFAULT_LOGIN_URL = "https://login.eloqua.com/id"
# Forms
FORM_CREATE_PATH = "/api/REST/2.0/assets/form"
FORM_DELETE_PATH = "/api/REST/2.0/assets/form/{id}"
FORM_UPDATE_PATH = "/api/REST/2.0/assets/form/{id}"
FORM_GET_PATH = "/api/REST/2.0/assets/form/{id}"
FORM_GET_LIST_PATH = "/api/REST/2.0/assets/forms"
# Custom Objects
CUSTOM_OBJECT_CREATE_PATH = "/api/REST/2.0/assets/customObject"
CUSTOM_OBJECT_DELETE_PATH = "/api/REST/2.0/assets/customObject/{id}"
CUSTOM_OBJECT_UPDATE_PATH = "/api/REST/2.0/assets/customObject/{id}"
CUSTOM_OBJECT_GET_PATH = "/api/REST/2.0/assets/customObject/{id}"
CUSTOM_OBJECT_GET_LIST_PATH = "/api/REST/2.0/assets/customObjects"
...
Testing
To perform testing, it is preferable to use your sandbox instance.
- Create a
eloqua/test/creds.pyfile. An outline is provided in example_creds.py - Run
eloqua/test/test.pyunittests
Requirements
- Python 3
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file eloqua-lib-0.0.1.tar.gz.
File metadata
- Download URL: eloqua-lib-0.0.1.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
078dadedc417098ab9dd5f2107024ea1bf6ef580e12633a5594d359b8d2aedf8
|
|
| MD5 |
c5e0701269bd71196e59a8ea0451fe8e
|
|
| BLAKE2b-256 |
cce71bfc09aac38e533d3960ef12ec9253cfc3468f168bb567e817eed9286c44
|
File details
Details for the file eloqua_lib-0.0.1-py3-none-any.whl.
File metadata
- Download URL: eloqua_lib-0.0.1-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d05018ac52b64429f45fcd7bc783da99d809585af125011c09c35b91f1caf6bc
|
|
| MD5 |
f3aade972f0b5c48b3300a749ef6a0d6
|
|
| BLAKE2b-256 |
eb56d08b4036d9d5233321824c0d6f698f8b9a76a3049ccd85ceec9fe31839de
|