M README.rst +11 -7
@@ 5,7 5,7 @@
sendypy |nlshield|
==============================
:Info: Simple module to interface with the Sendy API (https://sendy.co/api)
-:Version: 0.1.5b
+:Version: 0.2.0
:Author: Peter Sanchez (http://www.petersanchez.com) - (http://www.netlandish.com)
Dependencies
@@ 16,7 16,9 @@ Dependencies
**NOTE:**
-* **Version 1.3b** adds the new "title" variable to the ``create_campaign`` API call. It effects the default ordering of variables in the call. If you're upgrading from a previous version please ensure that you account for the new ordering of variables. This new variable was added in Sendy v2.1.2.6
+* **Version 0.2.0** now requires ``api_key`` varaible for all API calls. This is a required change to the functionality of Sendy as of version 4.0.4. This is a potentially breaking code change. Please update your code to always provide the API key before upgrading to sendypy v0.2.0.
+
+* **Version 0.1.3b** adds the new "title" variable to the ``create_campaign`` API call. It effects the default ordering of variables in the call. If you're upgrading from a previous version please ensure that you account for the new ordering of variables. This new variable was added in Sendy v2.1.2.6
Installation
============
@@ 42,12 44,14 @@ All the variables and response values ar
Usage is simple ::
from sendy.api import SendyAPI
- api = SendyAPI(host='https://your-sendy-install.com/sendy/', api_key='YOUR_API_KEY')
+ api = SendyAPI(
+ host='https://your-sendy-install.com/sendy/',
+ api_key='YOUR_API_KEY',
+ )
-You don't need to set the api_key variable if you're using the
-subscribe or unsubscribe methods. You can also provide the optional
-"debug" variable (defaults to False). This will print debug into to
-stdout when sending a request to your Sendy install.
+You can also provide the optional ``debug`` variable (defaults to False).
+This will print debug into to stdout when sending a request to your Sendy
+install.
**Subscribe** ::
M sendy/__init__.py +3 -1
@@ 1,6 1,8 @@
from __future__ import unicode_literals
-VERSION = (0, 1, 5, 'beta', 0)
+name = 'sendypy'
+
+VERSION = (0, 2, 0, 'final', 0)
def get_version():
M sendy/api.py +1 -3
@@ 11,7 11,7 @@ class SendyAPI:
""" Class used to map to all Sendy API endpoints
"""
- def __init__(self, host, api_key=None, debug=False):
+ def __init__(self, host, api_key, debug=False):
self.host = host
if self.host[-1] != '/':
self.host = '{0}/'.format(self.host)
@@ 27,7 27,6 @@ class SendyAPI:
],
extra_param={'boolean': 'true'},
success_message='1',
- require_auth=False,
method='POST',
)
@@ 36,7 35,6 @@ class SendyAPI:
allowed_param=['list', 'email'],
extra_param={'boolean': 'true'},
success_message='1',
- require_auth=False,
method='POST',
)
M sendy/binder.py +1 -3
@@ 32,7 32,6 @@ def bind_api(**config):
path = config['path']
allowed_param = config.get('allowed_param', [])
method = config.get('method', 'GET')
- require_auth = config.get('require_auth', True)
success_status_code = config.get('success_status_code', 200)
success_message = config.get('success_message', None)
extra_param = config.get('extra_param', None)
@@ 73,8 72,7 @@ def bind_api(**config):
if self.extra_param is not None:
self.parameters.update(self.extra_param)
- if self.require_auth and self.api.api_key is not None:
- self.parameters['api_key'] = self.api.api_key
+ self.parameters['api_key'] = self.api.api_key
def execute(self):
# Build the request URL