Giter Site home page Giter Site logo

pymarsys's Introduction

pymarsys: Python client for the Emarsys API

CircleCI

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_fields

If 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:

    >>> 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:

    >>> 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()
    <coroutine object AsyncConnection.make_call at 0x10c44bd58>

You will need an event loop to get the result of your coroutine. Here is an example using asyncio's event loop:

    >>> 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:

  $ 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.

pymarsys's People

Contributors

gcoupelant avatar joelfillon avatar misterjoa avatar perados avatar perrinstephane avatar ygrandmaitre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.