{ "info": { "author": "Alessandro Iob", "author_email": "alessandro.iob@toptal.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "currencycloud-python\n====================\n\n|Build Status|\n\nCurrency Cloud\n==============\n\nThis is the official Python SDK for v2 of Currency Cloud's API.\nAdditional documentation for each API endpoint can be found at\n`connect.currencycloud.com `__.\nIf you have any queries or you require support, please contact our\nimplementation team at implementation@currencycloud.com.\n\nThe full source code, tests and examples can be always found on\n`github `__.\n\nInstallation\n------------\n\nWe supports installation using standard Python \u201cdistutils\u201d or\n\u201csetuptools\u201d methodologies. An overview of potential setups is as\nfollows:\n\n- **Plain Python Distutis** - The library can be installed with a clean\n Python install using the services provided via Python Distutils,\n using the setup.py script.\n- **Setuptools or Distribute** - When using\n `setuptools `__, the\n library can be installed via setup.py or easy\\_install.\n- **pip** - `pip `__ is an installer\n that rides on top of setuptools or distribute, replacing the usage of\n easy\\_install. It is often preferred for its simpler mode of usage.\n\nInstall via pip\n~~~~~~~~~~~~~~~\n\nWhen pip is available, the distribution can be downloaded from PyPi and\ninstalled in one step:\n\n::\n\n pip install currencycloud\n\nThis command will download the latest released version of the library\nfrom the Python Cheese Shop and install it to your system.\n\nInstall using setup.py\n~~~~~~~~~~~~~~~~~~~~~~\n\nOtherwise, you can install from the distribution using the setup.py\nscript:\n\n::\n\n python setup.py install\n\nSupported Python versions\n-------------------------\n\nThis library aims to support and is `tested\nagainst `__ the\nfollowing Ruby implementations:\n\n- CPython 2.6\n- CPython 2.7\n- CPython 3.2\n- CPython 3.3\n- CPython 3.4\n- pypy\n\nUsage\n=====\n\n.. code:: python\n\n >>> import currencycloud\n\n ## Configure ##\n >>> currencycloud.login_id = ''\n >>> currencycloud.api_key = ''\n >>> currencycloud.environment = currencycloud.ENV_DEMOSTRATION # use currencycloud.ENV_PRODUCTION when ready\n\n ## Make API calls ##\n >>> currencies = currencycloud.Reference.currencies()\n >>> currencies\n [,\n ,\n ,\n \u2026\n ]\n\n >>> balances = currencycloud.Balance.find()\n >>> balances\n []\n\n >>> balances.pagination\n AttrDict({u'next_page': -1, u'previous_page': -1, u'total_entries': 1, u'current_page': 1, u'total_pages': 1, u'order_asc_desc': u'asc', u'per_page': 25, u'order': u'created_at'})\n\n >>> balances[0].currency\n u'GBP'\n\n >>> currency_usd = balances[0].currency_with_code('USD')\n >>> currency_usd\n \n\n ## Access attributes ##\n >>> currency_usd.currency\n u'USD'\n\n >>> currency_usd['currency']\n u'USD'\n\nOn Behalf Of\n------------\n\nIf you want to make calls on behalf of another user (e.g. someone who\nhas a sub-account with you), you can execute certain commands 'on behalf\nof' the user's contact\\_id. Here is an example:\n\n.. code:: python\n\n with currencycloud.on_behalf_of('c6ece846-6df1-461d-acaa-b42a6aa74045'):\n beneficiary = currencycloud.Beneficiary.create()\n conversion = currencycloud.Conversion.create()\n payment = currencycloud.Payment.create()\n\nAlternatively, you can just add ``on_behalf_of`` to the call parameters,\nfor example:\n\n.. code:: python\n\n currencycloud.Account.create(account_name='My Test User', on_behalf_of='c6ece846-6df1-461d-acaa-b42a6aa74045')\n\nEach of the above transactions will be executed in scope of the permissions\nfor that contact and linked to that contact. Note that the real user who\nexecuted the transaction will also be stored.\n\nErrors\n------\n\nWhen an error occurs in the API, the library aims to give us much\ninformation as possible. Here is an example:\n\n.. code:: yaml\n\n BadRequestError\n ---\n errors:\n - code: term_agreement_is_required\n field: term_agreement\n message: term_agreement is required\n params: {}\n - code: term_agreement_type_is_wrong\n field: term_agreement\n message: term_agreement should be of boolean type\n params:\n type: boolean\n platform: python - 2.7.6 (default, Sep 9 2014, 15:04:36) - CPython\n request:\n parameters:\n amount:\n - '1000'\n buy_currency:\n - GBP\n fixed_side:\n - buy\n reason:\n - mortage\n sell_currency:\n - USD\n url: https://devapi.thecurrencycloud.com/v2/conversions/create\n verb: post\n response:\n date: Thu, 25 Jun 2015 16:46:42 GMT\n request_id: 2816384323363505615\n status_code: 400\n\nThis is split into 5 sections:\n\n1. Error Type: In this case ``BadRequestError`` represents an HTTP 400\n error\n2. Platform: The Python implementation that was used e.g. 'python -\n 2.7.6'\n3. Request: Details about the HTTP request that was made e.g. the POST\n parameters\n4. Response: Details about the HTTP response that was returned e.g. HTTP\n status code\n5. Errors: A list of errors that provide additional information\n\nThe errors section contains valuable information:\n\n- Field: The parameter that the error is linked to\n- Code: A code representing this error\n- Message: A human readable message that explains the error\n- Params: A hash that contains dynamic parts of the error message for\n building custom error messages\n\nWhen troubleshooting API calls with Currency Cloud support, including\nthe full error in any correspondence can be very helpful.\n\nDevelopment\n===========\n\nTo run the test cases we use\n`tox `__, a generic virtualenv\nmanagement and test command line tool. It can be easily installed with\n`pip `__\n\n::\n\n pip install tox\n\nor with `setuptools `__\n\n::\n\n easy_install tox\n\nTo run the tests\n\n::\n\n tox\n\nDependencies\n------------\n\n- `requests `__\n- `pyYAML `__\n- `attrdict `__\n\nVersioning\n----------\n\nThis project uses `semantic versioning `__. You can\nsafely express a dependency on a major version and expect all minor and\npatch versions to be backwards compatible.\n\nCopyright\n=========\n\nCopyright (c) 2015 Currency Cloud. See `LICENSE `__ for\ndetails.\n\n.. |Build Status| image:: https://travis-ci.org/CurrencyCloud/currencycloud-python.png?branch=master\n :target: https://travis-ci.org/CurrencyCloud/currencycloud-python", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://connect.currencycloud.com/documentation/getting-started/introduction", "keywords": "urllib httplib threadsafe filepost http https ssl pooling", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "currencycloud", "package_url": "https://pypi.org/project/currencycloud/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/currencycloud/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://connect.currencycloud.com/documentation/getting-started/introduction" }, "release_url": "https://pypi.org/project/currencycloud/0.7.0/", "requires_dist": null, "requires_python": null, "summary": "Python SDK for the Currency Cloud API.", "version": "0.7.0" }, "last_serial": 1618310, "releases": { "0.7.0": [ { "comment_text": "", "digests": { "md5": "222807698a54358c0395c64c8b2637b3", "sha256": "862758f411dbd8035ac29721106f99faa232dd9a8c6a4578003aa88ea152fc75" }, "downloads": -1, "filename": "currencycloud-0.7.0.tar.gz", "has_sig": false, "md5_digest": "222807698a54358c0395c64c8b2637b3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29618, "upload_time": "2015-07-03T16:48:39", "url": "https://files.pythonhosted.org/packages/02/35/d050bea78de5c38e321bf9d166efba1da856e27fad063ad63b29bf48ff08/currencycloud-0.7.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "222807698a54358c0395c64c8b2637b3", "sha256": "862758f411dbd8035ac29721106f99faa232dd9a8c6a4578003aa88ea152fc75" }, "downloads": -1, "filename": "currencycloud-0.7.0.tar.gz", "has_sig": false, "md5_digest": "222807698a54358c0395c64c8b2637b3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29618, "upload_time": "2015-07-03T16:48:39", "url": "https://files.pythonhosted.org/packages/02/35/d050bea78de5c38e321bf9d166efba1da856e27fad063ad63b29bf48ff08/currencycloud-0.7.0.tar.gz" } ] }