Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

EmsAuth plugin for HTTPie.

Project Description

This HTTPie auth plugin implements Escher authentication for Emarsys API requests.


Be sure that HTTPie is installed, and install this plugin:

$ pip install httpie-ems-auth

After installing, you will see the option ems-auth under --auth-type if you run $ http --help.


Suiteable if you call the API of Suite

$ http --auth-type=ems-auth --auth=escher_key:escher_secret

The default Escher credential scope is “eu/suite/ems_request” which identifies Suite. If u are calling another service, you have to alter the credential scope like this:

$ http --auth-type=ems-auth --auth=eu/suite/ems_request/escher_key:escher_secret

Check out HTTPie sessions if you would like to save authentication information between your requests.

If you want to use in python code this example can help:
import escherauth
import datetime
from urlparse import urlparse
import requests

escher_key = 'test'
escher_secret = 'test'
options = {
            'algo_prefix': 'EMS',
            'vendor_key': 'EMS',
            'hash_algo': 'SHA256',
            'auth_header_name': 'X-Ems-Auth',
            'date_header_name': 'X-Ems-Date'

credential_scope = "test"

if "/" in escher_key:
    scope = escher_key.split("/")
    escher_key = scope.pop()
    credential_scope = "/".join(scope)

client = {'api_key': escher_key, 'api_secret': escher_secret}
escher = escherauth.Escher(credential_scope, options)

url = ''

r = requests.PreparedRequest()
now = datetime.datetime.utcnow()
r.headers['X-Ems-Date'] = now.strftime('%Y%m%dT%H%M%SZ')
parsed_uri = urlparse(r.url)
r.headers['Host'] = parsed_uri.netloc

f = escher.sign(r, client)
s = requests.Session()


Release History

This version
History Node


History Node


History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Hash SHA256 Hash Help Version File Type Upload Date
(4.6 kB) Copy SHA256 Hash SHA256
2.7 Egg Mar 3, 2016
(2.9 kB) Copy SHA256 Hash SHA256
Source Mar 3, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting