https://github.com/transcovo/pymarsys
Python client for the Emarsys API
https://github.com/transcovo/pymarsys
api async-await asynchronous asyncio crm emarsys emarsys-api etl python-3 python-client synchronous
Last synced: 2 days ago
JSON representation
Python client for the Emarsys API
- Host: GitHub
- URL: https://github.com/transcovo/pymarsys
- Owner: transcovo
- License: apache-2.0
- Created: 2016-11-22T09:36:24.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-02-26T02:13:38.000Z (about 4 years ago)
- Last Synced: 2025-05-07T11:58:14.563Z (2 days ago)
- Topics: api, async-await, asynchronous, asyncio, crm, emarsys, emarsys-api, etl, python-3, python-client, synchronous
- Language: Python
- Size: 43 KB
- Stars: 9
- Watchers: 45
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pymarsys: Python client for the Emarsys API
[](https://circleci.com/gh/transcovo/pymarsys)
pymarsys allows you to choose the type of execution you want for the client: synchronous or asynchronous.
**Warning**: pymarsys is currently under development and on **Pre-Alpha** version. Use with caution!
Currently implemented endpoints are:* contacts
* contact_fieldsIf you want to make calls to other endpoints, for now you can use the `make_call` method of the `SyncConnection` or `AsyncConnection` classes.
**Python 2.x compatibility**: If you are using python 2.x, don't, just don't.
### Synchronous example:
```python
>>> from pymarsys import SyncConnection, Emarsys
>>> connection = SyncConnection('username', 'secret')
>>> client = Emarsys(connection)
>>> client.contacts.create({'3': '[email protected]'})
{'data': {'id': 19739576}, 'replyCode': 0, 'replyText': 'OK'}
```### Asynchronous example:
```python
>>> from pymarsys import AsyncConnection, Emarsys
>>> async def my_async_func():
... connection = AsyncConnection('username', 'secret')
... client = Emarsys(connection)
... return await client.contacts.create({'3': '[email protected]'})
>>> my_async_func()
```#### You will need an event loop to get the result of your coroutine. Here is an example using asyncio's event loop:
```python
>>> import asyncio
>>> coroutine = my_async_func()
>>> loop = asyncio.get_event_loop()
>>> loop.run_until_complete(coroutine)
{'data': {'id': 19739576}, 'replyCode': 0, 'replyText': 'OK'}
```## Installation
Simply:
```sh
$ pip install pymarsys
🐿
```
## Documentation
Coming soon!##Contributing
1. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.
2. Fork the repository on GitHub to start making your changes.
3. Write a test which shows that the bug was fixed or that the feature works as expected.
4. Send a pull request and bug the maintainer until it gets merged and published.