Is an asynchronous implementation for AlfaCRM API
Project description
AIOAlfacrm
aioalfacrm - is an asynchronous implementation for the AlfaCRM API
Package is in development
Installation using pip
$ pip install aioalfacrm
Example:
import asyncio
from aioalfacrm import AlfaClient
HOSTNAME = 'demo.s20.online'
EMAIL = 'api-email@email.example'
API_KEY = 'user-api-token'
BRANCH_ID = 1
async def main():
alfa_client = AlfaClient(
hostname=HOSTNAME,
email=EMAIL,
api_key=API_KEY,
branch_id=BRANCH_ID,
)
try:
# Check auth (Optionaly)
if not await alfa_client.check_auth():
print("Authentification error")
return
# Get branches
branches = await alfa_client.branch.list(page=0, count=20)
finally:
await alfa_client.close()
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) # For Windows
asyncio.run(main())
Available CRM objects
alfa_client.branch # Branch
alfa_client.customer # Customer
alfa_client.location # Location
alfa_client.study_status # StudyStatus
alfa_client.subject # Subject
alfa_client.lead_status # LeadStatus
alfa_client.lead_source # LeadSource
Available CRM methods
alfa_client.<object>.list(**filters) # Get objects list
alfa_client.<object>.get(id) # Get one object by id
alfa_client.<object>.create(fields) # Create object
alfa_client.<object>.update(id, fields) # Update object
Paginator
# Get all objects
for page in alfa_client.<object>.get_paginator():
objects = page.items
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
aioalfacrm-0.0.7.tar.gz
(14.4 kB
view hashes)
Built Distribution
aioalfacrm-0.0.7-py3-none-any.whl
(11.8 kB
view hashes)
Close
Hashes for aioalfacrm-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24bd118aa22373db8aa3d24921677c1a6dcf0c19d47a86adc3fea0b3d33cdbc9 |
|
MD5 | c7ac91fff261ca9cf652e0910c90ec2e |
|
BLAKE2b-256 | 0119111129b2644d7129276919489aefd1a1d7f856d793879f6d3328328892f4 |