{ "info": { "author": "Mediaburst", "author_email": "hello@clockworksms.com", "bugtrack_url": null, "classifiers": [], "description": "# Clockwork SMS API for Python\n\n## Install\n\nThe easiest way to install is through \"pip\":\n\n pip install clockwork\n\n## Requirements\n\n* Python 2.6+\n\n## Usage\n\n### Send a single SMS message\n\n```python\nfrom clockwork import clockwork\napi = clockwork.API('API_KEY_GOES_HERE')\nmessage = clockwork.SMS(to = '441234123456', message = 'This is a test message.')\nresponse = api.send(message)\n\nif response.success:\n print (response.id)\nelse:\n print (response.error_code)\n print (response.error_message)\n```\n\n### Send multiple SMS messages\n\nSimply pass an array of sms objects to the send method. Instead of sending back a single sms response, an array of sms responses will be returned:\n\n```python\nfrom clockwork import clockwork\napi = clockwork.API('API_KEY_GOES_HERE')\nmessage1 = clockwork.SMS(to = '441234123456', message = 'This is a test message 1.')\nmessage2 = clockwork.SMS(to = '441234123457', message = 'This is a test message 2.')\nmessage3 = clockwork.SMS(to = '441234123458', message = 'This is a test message 3.')\nresponse = api.send([message1,message2,message3])\n\nfor sms_response in response:\n if sms_response.success:\n print (sms_response.id)\n else:\n print (sms_response.error_code)\n print (sms_response.error_message)\n```\n\nPassing an array of messages to the send method is much more efficient than making multiple calls to the `send` method; as well making less round-trips to the server the messages are \"batched\" in clockwork, which is significantly better for performance.\n\n### Send messages - available parameters\n\nThis wrapper supports a subset of the available clockwork API parameters for sending (for the full set see [here][2]).\n\n##### Setting parameters for all messages\n\nYou create an `api` object with `api = clockwork.API(api_key,[optional_setting = value,..]`\nThe `optional_setting` parameters allows you to set the following, which will be used for all messages sent through the `api` object:\n\nParameter | Description\n--------- | -----------\nfrom_name | Sets the [from name](http://www.clockworksms.com/doc/clever-stuff/xml-interface/send-sms/#param-from \"from address\")\nconcat | Sets the [concat](http://www.clockworksms.com/doc/clever-stuff/xml-interface/send-sms/#param-concat) setting\ninvalid_char_option | Sets the [InvalidCharOption](http://www.clockworksms.com/doc/clever-stuff/xml-interface/send-sms/#param-invalidcharaction) setting\ntruncate | Sets the [truncate](http://www.clockworksms.com/doc/clever-stuff/xml-interface/send-sms/#param-truncate) setting\n\nSo for example if I want all messages to use the from address 'bobby', I would do:\n\n```python\n api = clockwork.API('MY_API_KEY', from_name = 'Bobby')\n```\n\n##### Setting parameters for each message.\n\nYou create an `sms` object with `sms = clockwork.SMS(to = 'xxx', message = 'xxx', [optional_setting = value,..]`\n\nIn a similar pattern to the API parameters, the `optional_setting` parameters allows you to set the following additional parameters for an individual message:\n\nParameter | Description\n--------- | -----------\nclient_id | Sets the [ClientId](http://www.clockworksms.com/doc/clever-stuff/xml-interface/send-sms/#param-clientid) setting\nfrom_name | Sets the [from name](http://www.clockworksms.com/doc/clever-stuff/xml-interface/send-sms/#param-from \"from address\")\ninvalid_char_option | Sets the [InvalidCharOption](http://www.clockworksms.com/doc/clever-stuff/xml-interface/send-sms/#param-invalidcharaction) setting\ntruncate | Sets the [truncate](http://www.clockworksms.com/doc/clever-stuff/xml-interface/send-sms/#param-truncate) setting\n\nAny parameters defined here will take precedence over the same one defined on the `api` object:\n\n```python\napi = clockwork.API('MY_API_KEY',from_name = 'Bobby')\nsms = clockwork.SMS(to = '441234123456', message = 'This is a test message 1.', from_name = 'Sammy')\nresponse = api.send(sms) # WILL SEND WITH FROM ADDRESS 'Sammy'\n```\n\n### Check balance\n\n```python\nfrom clockwork import clockwork\napi = clockwork.API('API_KEY_GOES_HERE')\nbalance = api.get_balance()\nprint (balance) # => {'currency': None, 'balance': '231.03', 'account_type': 'PAYG'}\n```\n\n## License\n\nThis project is licensed under the MIT open-source license.\n\nA copy of this license can be found in LICENSE.txt\n\n## Contributing\n\nIf you have any feedback on this wrapper drop us an email to [hello@clockworksms.com][3].\n\nThe project is hosted on GitHub at [http://www.github.com/mediaburst/clockwork-python][4].\n\nIf you would like to contribute a bug fix or improvement please fork the project\nand submit a pull request. Please add tests for your use case.\n\n[2]: http://www.clockworksms.com/doc/clever-stuff/xml-interface/send-sms/\n[3]: mailto:hello@clockworksms.com\n[4]: http://www.github.com/mediaburst/clockwork-python\n\n## Changelog\n\n### 1.2.0 (24th February 2016)\n\n* Removed lxml dependency\n \n### 1.1.0 (5th January 2015)\n\n* Python3 Support\n\n### 1.03 (23rd December 2014)\n\n* Replacing Distribute with Setuptools\n\n### 1.0.2 (18th May 2014)\n\n* Unicode support added [MR]\n\n### 1.0.1 (01st September, 2013)\n\n* Minor changes\n\n### 1.0.0 (01st August, 2013)\n\n* Initial release of wrapper [MR]\n\n\n## Credits and Acknowledgements\n\nThanks to [zeroSteiner](https://github.com/zeroSteiner) for removing the lxml dependency and bringing ElementTree into the wrapper.\n\nThanks to [bjornpost](https://github.com/bjornpost) for his work on Python 3 support and replacing Distribute with Setuptools\n\nMany thanks to [cHemingway](https://github.com/cHemingway) for adding Unicode support.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mediaburst/clockwork-python", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "Clockwork", "package_url": "https://pypi.org/project/Clockwork/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/Clockwork/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/mediaburst/clockwork-python" }, "release_url": "https://pypi.org/project/Clockwork/1.2.0/", "requires_dist": null, "requires_python": null, "summary": "Python wrapper for the clockwork SMS Api", "version": "1.2.0" }, "last_serial": 1974651, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "9da896afa8339af41fb2301a27414097", "sha256": "ea24badf44a1b517089084eeb02ecc56a86a72a82f260b642fb058f2fb4b83a1" }, "downloads": -1, "filename": "Clockwork-1.0.tar.gz", "has_sig": false, "md5_digest": "9da896afa8339af41fb2301a27414097", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4700, "upload_time": "2013-08-20T10:01:15", "url": "https://files.pythonhosted.org/packages/c9/70/0657edb13df730eaffe7b33d95b0cbac3a6c956bae6f9081f64ebf3bb708/Clockwork-1.0.tar.gz" }, { "comment_text": "", "digests": { "md5": "95fa1e9eded0f02535f9dec66b2b415e", "sha256": "a1f559c10e079ec2e01b70077397ec85a401ad1942c100c75cb9880d2c1ae667" }, "downloads": -1, "filename": "Clockwork-1.0.zip", "has_sig": false, "md5_digest": "95fa1e9eded0f02535f9dec66b2b415e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8075, "upload_time": "2014-11-10T12:53:40", "url": "https://files.pythonhosted.org/packages/64/08/80291a3c5647d38614927716975b02ec0e40eb2084d4e8987ea692a1098b/Clockwork-1.0.zip" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "988f0ce9fb4a06dfb31fac57d0855927", "sha256": "77d6b914b92b6d9f28a29ba5b939d2c11de2ae4cbb7ad1b8161aa9fa9407bbb3" }, "downloads": -1, "filename": "Clockwork-1.0.1.tar.gz", "has_sig": false, "md5_digest": "988f0ce9fb4a06dfb31fac57d0855927", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5261, "upload_time": "2014-01-16T14:57:48", "url": "https://files.pythonhosted.org/packages/cb/69/1428a00880cc181f206016981da4a4480500b1e1e74e30d1477a1bd31e2c/Clockwork-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "f9e942a5c7d2610630842a45918925de", "sha256": "4bfbca7d22d94ab12d708e9d24c6462b0502b2a58455331f16e4fa5450fba7e8" }, "downloads": -1, "filename": "Clockwork-1.0.2.tar.gz", "has_sig": false, "md5_digest": "f9e942a5c7d2610630842a45918925de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5401, "upload_time": "2014-05-19T09:00:51", "url": "https://files.pythonhosted.org/packages/df/31/076015676a7281cd06eb69b3d359d04e89d704cc4c032e5a4bf673e9ccd3/Clockwork-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "9b3f803cae801b374630fa7aa79b6373", "sha256": "a1fe0a52aa37dcc6831ff97fe1509380fcd2ef7246408edcbb237e8bda9b9234" }, "downloads": -1, "filename": "Clockwork-1.0.3.zip", "has_sig": false, "md5_digest": "9b3f803cae801b374630fa7aa79b6373", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8114, "upload_time": "2014-11-10T12:55:22", "url": "https://files.pythonhosted.org/packages/c4/c7/25c0619a74df44104b389ea473d183da444dc1c27dea98d913ef14222583/Clockwork-1.0.3.zip" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "92a6e09c71fa4d1cf15d87489c03bac9", "sha256": "89356f5d0850e024cd9933cfd9fb6e5e9491d7e4a8aa43388b91474366e3e811" }, "downloads": -1, "filename": "Clockwork-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "92a6e09c71fa4d1cf15d87489c03bac9", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8563, "upload_time": "2015-01-05T11:55:54", "url": "https://files.pythonhosted.org/packages/45/85/fc18f5db58e34b441b47302add927b45dc5a527bea0fafd56946f4a77059/Clockwork-1.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "87a98a36e6396db67b242bd576b954a5", "sha256": "029d5e0e35d10719fc8e8bf2bdbcb94c58a7c0f6542792cfd7536b0485a9f6ee" }, "downloads": -1, "filename": "Clockwork-1.1.0.zip", "has_sig": false, "md5_digest": "87a98a36e6396db67b242bd576b954a5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11853, "upload_time": "2015-01-05T11:55:57", "url": "https://files.pythonhosted.org/packages/01/7a/59d923c571db05cda1d457b305af692d2015a8dc4eb968875da1ca23f9a9/Clockwork-1.1.0.zip" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "efe0419db53138da279395da71dae6f3", "sha256": "0f819eea4b58dc9a6d3115d8cefbe2e33c30f1bf62e1f582b754a8f3c83ba0bd" }, "downloads": -1, "filename": "Clockwork-1.2.0.zip", "has_sig": false, "md5_digest": "efe0419db53138da279395da71dae6f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11592, "upload_time": "2016-02-24T17:30:23", "url": "https://files.pythonhosted.org/packages/7f/bb/1a0dc9f7dcd5babd1a89d8d93a473e32bdcf6e51f6cbfeb51273e693e0b2/Clockwork-1.2.0.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "efe0419db53138da279395da71dae6f3", "sha256": "0f819eea4b58dc9a6d3115d8cefbe2e33c30f1bf62e1f582b754a8f3c83ba0bd" }, "downloads": -1, "filename": "Clockwork-1.2.0.zip", "has_sig": false, "md5_digest": "efe0419db53138da279395da71dae6f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11592, "upload_time": "2016-02-24T17:30:23", "url": "https://files.pythonhosted.org/packages/7f/bb/1a0dc9f7dcd5babd1a89d8d93a473e32bdcf6e51f6cbfeb51273e693e0b2/Clockwork-1.2.0.zip" } ] }