{ "info": { "author": "", "author_email": "", "bugtrack_url": null, "classifiers": [], "description": "# city-trader-python-lib\nA python library for working with OptionsCity Software's City Trader REST API.\n\n#### Prerequisites\n1. [Python 2.7 or greater](https://www.python.org/downloads/release/python-2710/)\n2. [Python setuptools](https://pypi.python.org/pypi/setuptools)\n3. A City Trader Username and Password\n4. A City Trader API client_id and client_secret\n\n#### Installation\n1. [Download the source code](https://github.com/optionshop/city-trader-python-lib/archive/master.zip)\n2. Unzip the archive\n3. Run: ```python setup.py install```\n\n---\n# Examples\n##### Initialize client and retrieve new token\n```python\nfrom citytrader.request_client import RequestClient\nrc = RequestClient(server=\"https://devservices.optionshop.com\", client_id=\"\", client_secret=\"\", username=\"\", password=\"\")\n```\n\n##### Retrieve all orders\n```python\nall_orders = rc.request(request_type=\"GET\", url=\"orders\")\n```\n\n##### Retrieve single order\n```python\nsingle_order = rc.request(request_type=\"GET\", url=\"orders/\")\n```\n\n##### Retrieve all product groups\n```python\nall_productgroups = rc.request(request_type=\"GET\", url=\"productgroups\")\n```\n\n##### Retrieve all instruments\n```python\nall_instruments = rc.request(request_type=\"GET\", url=\"instruments\")\n```\n\n##### Retrieve market data for a single instrument\n```python\nmd_message = rc.request(request_type=\"GET\", url=\"marketdata?instrument_ids=\")\n```\n\n##### Retrieve market data for multiple instruments\n```python\nmd_messages = rc.request(request_type=\"GET\", url=\"marketdata?instrument_ids=&instrument_ids=\")\n```\n\n##### Retrieve market data for just Last and High prices\n```python\nmd_messages_just_last_and_high = rc.request(request_type=\"GET\", url=\"marketdata?instrument_ids=&instrument_ids=&sides=Last&sides=High\")\n```\n\n##### Submit a day limit order\n```python\norder_results = rc.request(request_type=\"POST\", url=\"orderactions\", data={\"acct_id\": , \"action_type\": \"LimitOrderSub\", \"instrument_id\": , \"limit_price\": , \"quantity\": , \"side\": , \"time_in_force\": \"Day\"})\n```", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "Creative Commons Attribution-Noncommercial-Share Alike license", "maintainer": "", "maintainer_email": "", "name": "CityTraderPythonLib", "package_url": "https://pypi.org/project/CityTraderPythonLib/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/CityTraderPythonLib/", "project_urls": null, "release_url": "https://pypi.org/project/CityTraderPythonLib/0.2/", "requires_dist": null, "requires_python": "", "summary": "", "version": "0.2" }, "last_serial": 1929939, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "f4e44547199d5191ed5a1f8c307ec06a", "sha256": "c47ccebb205a0f0394bff818fe860c26ff10fac3969ff0d5720e4852baa71e73" }, "downloads": -1, "filename": "CityTraderPythonLib-0.1-py2.7.egg", "has_sig": false, "md5_digest": "f4e44547199d5191ed5a1f8c307ec06a", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 8781, "upload_time": "2016-01-29T15:44:59", "url": "https://files.pythonhosted.org/packages/5f/2b/1e1f2961ef80d8729f9f79e05f383c0eaaee47902907a54dc46d7715989d/CityTraderPythonLib-0.1-py2.7.egg" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "057ebab0c5f7b774f03960689ebf7881", "sha256": "07680a7b47800d3f9d0161fcbdec7c0b3ce97522aae8b5051ad94ff439b2d85e" }, "downloads": -1, "filename": "CityTraderPythonLib-0.2-py2.7.egg", "has_sig": false, "md5_digest": "057ebab0c5f7b774f03960689ebf7881", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 8781, "upload_time": "2016-01-29T18:20:42", "url": "https://files.pythonhosted.org/packages/cf/6c/9e5e921ac0b63ce5320d29a4c9e2b55b65fb01b8a75bf2313e9b402643cd/CityTraderPythonLib-0.2-py2.7.egg" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "057ebab0c5f7b774f03960689ebf7881", "sha256": "07680a7b47800d3f9d0161fcbdec7c0b3ce97522aae8b5051ad94ff439b2d85e" }, "downloads": -1, "filename": "CityTraderPythonLib-0.2-py2.7.egg", "has_sig": false, "md5_digest": "057ebab0c5f7b774f03960689ebf7881", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 8781, "upload_time": "2016-01-29T18:20:42", "url": "https://files.pythonhosted.org/packages/cf/6c/9e5e921ac0b63ce5320d29a4c9e2b55b65fb01b8a75bf2313e9b402643cd/CityTraderPythonLib-0.2-py2.7.egg" } ] }