{ "info": { "author": "Tictail AB", "author_email": "tech@tictail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Topic :: Software Development :: Libraries" ], "description": "tictail-python\n==============\n\n[![Build Status](https://travis-ci.org/tictail/tictail-python.svg?branch=master)](https://travis-ci.org/tictail/tictail-python)\n\nPython bindings for the Tictail API ([API reference](https://tictail.com/developers/documentation/api-reference/)).\n\n### Installation\n\nThe easiest way to install `tictail-python` is via `pip`:\n\n```shell\n$ pip install tictail\n```\n\nAlternatively, you can download the [source](https://github.com/tictail/tictail-python/releases) and then run:\n\n```shell\n$ python setup.py install\n```\n\n#### Mac OS X\n\nYou might get the following error on Mac OS X:\n\n```\nclang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]\n```\n\nThis is caused by the latest (5.1) version of Xcode which ships with a compiler\nthat treats unknown passed parameters as errors. The workaround is to set the\nARCHFLAGS environment variable to treat such errors as warnings:\n\n```shell\n$ ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install tictail\n```\n\n### Version Support\n\n`tictail-python` supports Python 2.6 and 2.7. Python 3.2+ support is coming soon.\n\n### Dependencies\n\nThe following packages will be installed together with `tictail-python`:\n\n- `requests==2.2.1`\n- `pyasn1==0.1.6`\n- `pyOpenSSL==0.13`\n- `ndg-httpsclient==0.3.2`\n\n### Contributing\n\nFor bugs and feature requests, please open an [issue](https://github.com/tictail/tictail-python/issues). If you'd like to contribute\nto the development of `tictail-python` \u2013 a fact of grandiose awesomeness \u2013 then clone the repo, install the development dependencies and hack away. Make sure you include tests, update the changelog and add your name to the contributors list.\n\n### Testing\n\nThe library uses `pytest` and `coverage` for unit and integration tests. Run `make test` to\nrun all the tests. Alternatively, you can use the `py.test` binary to run specific tests.\n\n### Quickstart\n\nThe Tictail platform uses OAuth 2.0 for authentication so you need to create your application and obtain an access token for a store. The details of how to do that are not in the scope of this document, but the [authentication](https://tictail.com/developers/documentation/authentication/) section of the documentation has a nice set of instructions and best practices.\n\nOnce you have an access token you can instantiate the `Tictail` client and get the store associated with the token:\n\n```python\nfrom tictail import Tictail\n\nclient = Tictail('')\nstore = client.me()\n```\n\n### Configuration\n\nThe `Tictail` client comes preconfigured with sane defaults. If you wish to\noverride the default configuration, you can supply the constructor with a configuration\ndictionary:\n\n```python\nfrom tictail import Tictail\n\nconfig = {\n 'timeout': 40\n}\nclient = Tictail('', config=config)\n```\n\nSee `client.py` for details on what can be overriden.\n\n### Usage & Examples\n\n#### Store\n\nReference: [Store](https://tictail.com/developers/documentation/api-reference/#Store)\n\nThe `Store` resource is the only top-level API object and exposes properties for\nall its subresources which are documented further below.\n\n**Retrieving a store**\n\n```python\nfrom tictail import Tictail\n\nclient = Tictail('')\nstore = client.me()\n```\n\nAn example (partial) response:\n\n```python\n>>> print store\nStore({\n 'contact_email': u'thestartupstore@example.com',\n 'country': u'SE',\n 'currency': u'SEK',\n 'dashboard_url': u'https://tictail.com/dashboard/store/thestartupstore',\n 'description': u'Support your local Startup! ...',\n 'id': u't',\n 'language': u'en',\n 'logotype': [...],\n 'name': u'The Startup Store',\n 'sandbox': False,\n 'storekeeper_email': u'johndoe@example.com',\n 'url': u'http://thestartupstore.tictail.com'\n})\n```\n\n#### Card\n\nReference: [Card](https://tictail.com/developers/documentation/api-reference/#Card)\n\nCards are how you get your content into the feed of the store. The `Card` resource\nonly allows for creating cards at this point.\n\n**Creating a new card**\n\n```python\nfrom tictail import Tictail\n\nclient = Tictail('')\nstore = client.me()\ncard = store.cards.create({\n 'title': 'Check out this amazing site',\n 'action': 'http://example.com',\n 'card_type': 'media',\n 'content': {\n 'header': 'You will not regret this'\n }\n})\n```\n\nAn example response:\n\n```python\n>>> print card\nCard({\n 'action': u'http://example.com',\n 'card_type': u'media',\n 'content': {\n u'header': u'You will not regret this'\n },\n 'created_at': u'2014-04-23T20:25:47.745085',\n 'id': u'fREx',\n 'modified_at': u'2014-04-23T20:25:47.752799',\n 'title': u'Check out this amazing site'\n})\n```\n\n#### Product\n\nReference: [Product](https://tictail.com/developers/documentation/api-reference/#Product)\n\nUsing the `Product` resource you can list all the visible products of a store or get a specific product by id.\nListing products accepts four optional query parameters:\n\n- `limit` for page size\n- `before` and `after` for paginating on products created before or after a product with a given id\n- `categories` for filtering products on certain categories\n\n**List 50 products created after the product with id '7bxv'**\n\n```python\nfrom tictail import Tictail\n\nclient = Tictail('')\nstore = client.me()\nproducts = store.products.all(after='7bxv', limit=50)\n```\n\n**List all shirts (id:'aVr') and jeans (id: 'bEt2')**\n\n```python\nfrom tictail import Tictail\n\nclient = Tictail('')\nstore = client.me()\nproducts = store.products.all(categories=['aVr', 'bEt2'])\n```\n\n**Retrieve a specific product**\n\n```python\nfrom tictail import Tictail\n\nclient = Tictail('')\nstore = client.me()\nproduct = store.products.get('7bxv')\n```\n\nAn example response:\n\n```python\n>>> print product\nProduct({\n 'created_at': u'2014-01-29T13:41:43',\n 'currency': u'PLN',\n 'description': u'',\n 'id': u'7bxv',\n 'images': [],\n 'modified_at': u'2014-01-29T13:41:43',\n 'price': 1200,\n 'price_includes_tax': True,\n 'quantity': None,\n 'slug': u'super-duper-tshirt',\n 'status': u'published',\n 'store_id': u'scV',\n 'title': u'super duper tshirt',\n 'unlimited': True,\n 'variations': []\n})\n```\n\n#### Customer\n\nReference: [Customer](https://tictail.com/developers/documentation/api-reference/#Customer)\n\nThe `Customer` resource returns all the customers of a store, i.e people that bought\nsomething at least once from that store. Listing customers accepts three optional\nquery parameters:\n\n- `limit` for page size\n- `before` and `after` for paginating on customers created before or after a customers with a given id\n\n**Retrieve a specific customer**\n\n```python\nfrom tictail import Tictail\n\nclient = Tictail('')\nstore = client.me()\ncustomer = store.customers.get('7')\n```\n\n**List all customers**\n\n```python\nfrom tictail import Tictail\n\nclient = Tictail('')\nstore = client.me()\ncustomers = store.customers.all()\n```\n\nAn example response:\n\n```python\n>>> print customer\nCustomer({\n 'country': u'SE',\n 'created_at': u'2012-12-10T19:31:07',\n 'email': u'johndoe@example.com',\n 'id': u'bz21',\n 'language': u'en',\n 'modified_at': None,\n 'name': u'John Doe'\n})\n```\n\n#### Follower\n\nReference: [Follower](https://tictail.com/developers/documentation/api-reference/#Follower)\n\nThe `Follower` resource returns all the followers of a store. Listing followers accepts three optional\nquery parameters:\n\n- `limit` for page size\n- `before` and `after` for paginating on followers created before or after a follower with a given id\n\n**Create a follower**\n\n```python\nfrom tictail import Tictail\n\nclient = Tictail('')\nstore = client.me()\nfollower = store.followers.create({'email': 'newfollower@example.com'})\n```\n\n**Delete a follower**\n```python\nfrom tictail import Tictail\n\nclient = Tictail('')\nstore = client.me()\n\n# You can either delete a follower from the `Collection`...\ndeleted = store.followers.delete(7)\nassert deleted\n\n# ...or from the `Resource` itself.\nfollower = store.followers.all()[0]\ndeleted = follower.delete()\nassert deleted\n```\n\n**List all followers**\n\n```python\nfrom tictail import Tictail\n\nclient = Tictail('')\nstore = client.me()\nfollowers = store.followers.all()\n```\n\n**List all followers created before the follower with id '7aN'**\n\n```python\nfrom tictail import Tictail\n\nclient = Tictail('')\nstore = client.me()\nfollowers = store.followers.all(before='7aN')\n```\n\nAn example response:\n\n```python\n>>> print follower\nFollower({\n 'created_at': u'2013-12-10T19:31:07',\n 'modified_at': None,\n 'email': u'johndoe@example.com',\n 'id': u'NZUr'\n})\n```\n\n#### Order\n\nReference: [Order](https://tictail.com/developers/documentation/api-reference/#Order)\n\nThe `Order` resource returns all the orders of a store. If you wish to get the customers\nof the store then use the `Customer` resource instead. Listing orders accepts\nfive optional query parameters:\n\n- `limit` for page size\n- `before` and `after` for for paginating on orders created before or after a orders with a given id\n- `modified_before` and `modified_after` for paginating on orders modified before or after a given date (the date\n can be either a string in `ISO 8601` format or a `datetime` object)\n\n**List all orders after a specific id**\n\n```python\nfrom tictail import Tictail\n\nclient = Tictail('')\nstore = client.me()\norders = store.orders.all(after='aFQX')\n```\n\n**List all orders modified after a date**\n\n```python\nfrom datetime import datetime\nfrom tictail import Tictail\n\nclient = Tictail('')\nstore = client.me()\n\n# Using a datetime object...\nnow = datetime.now()\norders = store.orders.all(modified_after=now)\n\n# ...or a string.\norders = store.orders.all(modified_after=now.isoformat())\n```\n\n**Retrieve a specific order**\n\n```python\nfrom tictail import Tictail\n\nclient = Tictail('')\nstore = client.me()\norder = store.orders.get('aFQX')\n```\n\nAn example (partial) response:\n\n```python\n>>> print order\nOrder({\n 'customer': {\n 'name': u'John Doe',\n ...\n },\n 'transaction': {\n 'status': u'paid',\n ...\n },\n 'prices_include_vat': True,\n 'discounts': [],\n 'items': [{\n 'currency': u'SEK',\n 'price': 0,\n ...\n },\n ...\n ],\n 'fullfilment': {\n 'status': u'unhandled',\n ...\n },\n 'price': 0,\n 'id': u'aFQX',\n 'vat': {\n 'price': 0,\n 'rate': u'0.250000'\n }\n})\n```\n\n#### Theme\n\nReference: [Theme](https://tictail.com/developers/documentation/api-reference/#Theme)\n\nThe `Theme` resource is a singleton resource that returns the currently active\ntheme of the store.\n\n**Get the theme**\n\n```python\nfrom tictail import Tictail\n\nclient = Tictail('')\nstore = client.me()\ntheme = store.theme.get()\n```\n\nAn example (partial) response:\n\n```python\n>>> print theme\nTheme({\n 'id': u'Ag',\n 'markup': u'\\n\\n\\n...'\n})\n```\n\n#### Category\n\nReference: [Category](https://tictail.com/developers/documentation/api-reference/#Category)\n\nThe `Category` resource returns the categories which make up the store's navigation.\nThey are implemented as a classical parent-child hierarchy, limited to one level of depth.\n\n**List all categories**\n\n```python\nfrom tictail import Tictail\n\nclient = Tictail('')\nstore = client.me()\ncategories = store.categories.all()\n```\n\nAn example (partial) response:\n\n```python\n>>> print categories\n[\n Category({\n 'created_at': u'2012-05-01T00:47:16',\n 'id': u'dn',\n 'modified_at': u'2012-02-13T16:58:40',\n 'parent_id': None,\n 'position': 0,\n 'title': u'Stickers'\n }),\n Category({\n 'created_at': u'2012-10-29T12:02:09',\n 'id': u'dA',\n 'modified_at': None,\n 'parent_id': u'dn',\n 'position': 1,\n 'title': u'DevAwsmbx'\n })\n ...\n]\n```", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/tictail/tictail-python/releases", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/tictail/tictail-python", "keywords": "tictail,rest,api", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "tictail", "package_url": "https://pypi.org/project/tictail/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/tictail/", "project_urls": { "Download": "https://github.com/tictail/tictail-python/releases", "Homepage": "https://github.com/tictail/tictail-python" }, "release_url": "https://pypi.org/project/tictail/0.2.2/", "requires_dist": null, "requires_python": null, "summary": "Python bindings for the Tictail API", "version": "0.2.2" }, "last_serial": 1103300, "releases": { "-0.1-": [], "0.2.0": [ { "comment_text": "", "digests": { "md5": "5181cd1bd09b0c28061cd1bc459d6bc7", "sha256": "679ddc5958cf9d8b3c695601f1b581ca807d474d0748937f95a8dcd24ba4998a" }, "downloads": -1, "filename": "tictail-0.2.0.tar.gz", "has_sig": false, "md5_digest": "5181cd1bd09b0c28061cd1bc459d6bc7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14345, "upload_time": "2014-05-24T22:46:41", "url": "https://files.pythonhosted.org/packages/c8/d9/bd032668a6581d5863cbc898d060920140be26a556fbae59ad447807c06f/tictail-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "597167cf171e7174adc709e4f5c832fe", "sha256": "ac520d8200297288574c76fc24402f9854f6b6aabd68fb3ddc9a156b37852f2c" }, "downloads": -1, "filename": "tictail-0.2.1.tar.gz", "has_sig": false, "md5_digest": "597167cf171e7174adc709e4f5c832fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15460, "upload_time": "2014-05-24T22:57:03", "url": "https://files.pythonhosted.org/packages/26/5e/ee73192a13afe872e56a279c54c99390154280b9271a642485046b55e984/tictail-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "baf3026173f58c5b6baa2d51c69c5f4e", "sha256": "e9cd52ca8bdf22ca2006692c7a75843b100e58d4291d0454ce8af4a895996015" }, "downloads": -1, "filename": "tictail-0.2.2.tar.gz", "has_sig": false, "md5_digest": "baf3026173f58c5b6baa2d51c69c5f4e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15990, "upload_time": "2014-05-24T23:04:32", "url": "https://files.pythonhosted.org/packages/85/d4/ac54e94e30f48e08aab99c573e055a2da02d5992ded0ddd4eb3e08a848dc/tictail-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "baf3026173f58c5b6baa2d51c69c5f4e", "sha256": "e9cd52ca8bdf22ca2006692c7a75843b100e58d4291d0454ce8af4a895996015" }, "downloads": -1, "filename": "tictail-0.2.2.tar.gz", "has_sig": false, "md5_digest": "baf3026173f58c5b6baa2d51c69c5f4e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15990, "upload_time": "2014-05-24T23:04:32", "url": "https://files.pythonhosted.org/packages/85/d4/ac54e94e30f48e08aab99c573e055a2da02d5992ded0ddd4eb3e08a848dc/tictail-0.2.2.tar.gz" } ] }