Connector with a variety of API's with ease.
Project description
Cmotions Nnect
cmo_nnect is a Python library created by Cmotions. This library aims to ease the interaction with different API's of software packages. Examples include Microsoft Dynamics, Exact Online, AFAS Profit etc. You only need the right authentication credentials, and the target endpoints of the source/destination API to start interacting!
From our experience with integrating data from a variety of software packages we decided to publish our connectors to ease the use of the API's with Python. We encourage collaboration to increase the number of connectors and improvements of existing connectors!
The library always returns a Pandas dataframe by default.
Installation
Install cmo_nnect using pip
pip install cmo-nnect
Usage
Choose the connector from the list, and import the connector by using the reference name. For example for AFAS Profit the reference name is afasprofit:
from cmo_nnect import afasprofit
From the connector usage documentation determine the authentication requirements, for example for AFAS Profit we need a token, a company-id, and an optional environment name. We can then initialize a client:
# define authentication credentials
token = "<token><version>1</version><data>54740093832496081845474abcdefghijklmnopq740093832496081841234127</data></token>"
company_id = 12345
environment = "development"
# set up a client to ease interaction
client = afasprofit(token,company_id)
We are now able to start interacting with the API. To extract data you can use the format client.get_data(). In the documentation of the specific connector you can see what is expected for the specific method. For example for AFAS Profit we need to provide a get_connector name, and optional parameters:
# define parameters
params = {"skip": "-1", "take": "-1"}
# extract data from the software package
contacts = client.get_data("get_contacts", params)
Available connectors
- AFAS Profit (afasprofit)
- Nmbrs (nmbrs)
Connector usage
AFAS Profit
Authentication
To authenticate with AFAS Profit you need:
- A profit token (e.g. "154740093832496081845474abcdefghijklmnopq740093832496081841234127")
- A company ID (e.g. 12345) Optionally:
- An environment, defaults to production (e.g. "test")
Interaction
For each interaction you can provide optional parameters in a dictionary (e.g. {"skip": "-1", "take": "-1"}).
Extracting data
To get data, you need:
- A get_connector name of a get connector which is set-up in AFAS profit (e.g. "get_contacts")
Inserting data
T.B.A.
Updating data
T.B.A.
Deleting data
T.B.A.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.
License
GNU General Public License v3.0
Contributors
Thijs van der Velden, Koen Leijsten
Contact us
Project details
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
Hashes for cmo_nnect-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8978db3c8d6341d0dde1a8e06242f5b780018c8938db85363d6d7fa6ee5c55f4 |
|
MD5 | d46c29b08afe27c2dc8b5f3a6d17d522 |
|
BLAKE2b-256 | 1b9cca89beec4f525dc7184ec145f82aedeb870b93b4e9dcbdba1e2c85b53003 |