{ "info": { "author": "Franco Zanuso", "author_email": "francozanuso89@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Topic :: Office/Business :: Financial :: Investment", "Topic :: Software Development" ], "description": "Welcome to pyRofex's Documentation\n===================================\n\nOverview\n--------\n*pyRofex* is a python library that allows interactions with ROFEX's Rest and Websocket APIs.\n\nThe library is designed to avoid developers hours of research and coding needed to connect with ROFEX APIs, so they could focused on the important part of their software.\n\nAlthough, we recommend to take a look at the official `API documentation `_ to get familiarize with the API Responses and functionality.\n\nInstalling\n----------\n*pyRofex* is available at the `Python Package Index `_ repository. Install and update using `pip `_\\ :\n\n.. code-block:: python\n\n pip install -U pyRofex\n\n\nAPI Credentials\n---------------\nIn order to use the library you need to have the correct authentication credentials for the environment.\n\nTo get new credentials:\n\n- **REMARKET**: go to `Remarket Website `_ and create an account for free.\n\n- **LIVE**: contact MPI (Market and Platform Integration) team. (mail: mpi@primary.com.ar)\n\nDependencies\n------------\n- `requests `_\\: 2.20.0 or higher\n- `simplejson `_\\: 3.10.0 or higher\n- `enum34 `_\\: 1.1.6 or higher\n- `websocket-client `_\\: 0.54.0 or higher\n\nFeatures\n--------\nThis sections describe the functionality and components of the library.\n\nAvailable methods\n^^^^^^^^^^^^^^^^^\n\nInitialization\n~~~~~~~~~~~~~~\n\nBefore you start using the library, you need to initialize the environment that you want to connect with.\n\nFunctions\n\"\"\"\"\"\"\"\"\"\n* **initialize**: Initialize the specified environment. Set the default user, password and account for the environment.\n* **set_default_environment**: Set default environment. The default environment that is going to be used when no environment is specified.\n\nRest\n~~~~\n\nThe library provides functions to make requests to the REST API and return the corresponding response.\n\nFunctions\n\"\"\"\"\"\"\"\"\"\n\n* **get_segments**\\ : gets a list of valid segments.\n* **get_all_instruments**\\ : gets a list of all available instruments.\n* **get_detailed_instruments**\\ : gets a detailed list of all available instruments.\n* **get_instrument_details**\\ : gets the details of a single instrument.\n* **get_market_data**\\ : gets market data information for an instrument.\n* **get_trade_history**\\ : gets a list of historic trades for an instrument.\n* **send_order**\\ : sends a new order to the Market.\n* **cancel_order**\\ : cancels an order.\n* **get_order_status**\\ : gets the status of the specified order.\n* **get_all_orders_status**\\ : gets the status of all the orders associated with an account.\n\n..\n\n *All functions return a dict of the JSON response.*\n\n\nWebsocket\n~~~~~~~~~\n\nThe library allows users to start a connection to the websocket API. The connection will be monitored by a separated thread, so its very important to set the proper handlers to process new incoming messages.\n\nFunctions\n\"\"\"\"\"\"\"\"\"\n\n* **init_websocket_connection**\\ : configure the Websocket Client with the handlers and then start a Websocket connection with API.\n* **close_websocket_connection**\\ : close the connection with the API.\n* **market_data_subscription**\\ : sends a Market Data Subscription Message through the connection.\n* **order_report_subscription**\\ : sends an Order Report Subscription Message through the connection.\n* **add_websocket_market_data_handler** \\**: adds a new Market Data handler to the Websocket Client. This handler is going to be call when a new Market Data Message is received.\n* **remove_websocket_market_data_handler** \\**: removes a Market Data handler from the handlers list in the Websocket Client.\n* **add_websocket_order_report_handler** \\**: adds a new Order Report handler to the Websocket Client. This handler is going to be call when a new Order Report Message is received.\n* **remove_websocket_order_report_handler** \\**: removes an Order Report handler from the handlers list in the Websocket Client.\n* **add_websocket_error_handler** \\**: adds a new Error handler to the Websocket Client. This handler is going to be call when a new Error Message is received.\n* **remove_websocket_error_handler** \\**: removes an Error handler from the handlers list in the Websocket Client.\n* **set_websocket_exception_handler**: sets an exception handler to the Websocket Client. This handler is going to be called when an Exception occurred in the client.\n\n** **handlers** are pythons functions that will be call whenever the specific event occurred.\n\nEnumerations\n^^^^^^^^^^^^\n\nThe library also provides some enumerations to help developers avoid errors and improve readability. Next, you have the list of available enums:\n\n* **Environment**: Identifies the environment to use. (REMARKET: Demo environment; LIVE: Production environment)\n* **MarketDataEntry**: Identifies market data entries for an instrument.\n* **Market**: Market ID associated to the instruments.\n* **OrderType**: Identifies the different order types.\n* **Side**\\ : Identifies the side of an order.\n* **TimeInForce**: Time modifier of the order that defines the time the order will be active.\n\nHow to use it\n-------------\n\nOnce the library is install, we import and initialize it.\n\nThe initialization sets the user, password and account to the environment specified. Then, try to authenticate with the given user/password.\n\nIf the authentication fails, an ApiException is raised.\n\nFinally, sets the environment as the default one. (you can change it with the set_default_environment function)\n\n.. code-block:: python\n\n import pyRofex\n\n # Set the the parameter for the REMARKET environment\n pyRofex.initialize(user=\"sampleUser\",\n password=\"samplePassword\",\n account=\"sampleAccount\",\n environment=pyRofex.Environment.REMARKET)\n\n\nRest\n^^^^\n.. code-block:: python\n\n # Makes a request to the Rest API and get the last price\n # Use the MarketDataEntry enum to specify the data\n pyRofex.get_market_data(ticker=\"DODic19\",\n entries=[pyRofex.MarketDataEntry.LAST])\n\n # Gets all segments\n pyRofex.get_segments()\n\n # Gets available instruments list\n pyRofex.get_all_instruments()\n\n # Gets detailed instruments list\n pyRofex.get_detailed_instruments()\n\n # Get all order report for the configured account\n pyRofex.get_all_orders_status()\n\n # Gets historic trades\n pyRofex.get_trade_history(ticker=\"DOJun19\",\n start_date=\"2018-12-01\",\n end_date=\"2019-01-10\")\n\n # Sends a Limit order to the market\n order = pyRofex.send_order(ticker=\"DODic19\",\n side=pyRofex.Side.BUY,\n size=10,\n price=55.8,\n order_type=pyRofex.OrderType.LIMIT)\n\n # Gets the last order status for the previous order\n pyRofex.get_order_status(order[\"order\"][\"clientId\"])\n\n # Cancels the previous order\n cancel_order = pyRofex.cancel_order(order[\"order\"][\"clientId\"])\n\n # Checks the order status of the cancellation order\n pyRofex.get_order_status(cancel_order[\"order\"][\"clientId\"])\n\nWebsocket\n^^^^^^^^^\n\n.. code-block:: python\n\n # First we define the handlers that will process the messages and exceptions.\n def market_data_handler(message):\n print(\"Market Data Message Received: {0}\".format(message))\n def order_report_handler(message):\n print(\"Order Report Message Received: {0}\".format(message))\n def error_handler(message):\n print(\"Error Message Received: {0}\".format(message))\n def exception_handler(e):\n print(\"Exception Occurred: {0}\".format(e.message))\n\n # Initiate Websocket Connection\n pyRofex.init_websocket_connection(market_data_handler=market_data_handler,\n order_report_handler=order_report_handler,\n error_handler=error_handler,\n exception_handler=exception_handler)\n\n # Instruments list to subscribe\n instruments = [\"DONov19\", \"DODic19\"]\n # Uses the MarketDataEntry enum to define the entries we want to subscribe to\n entries = [pyRofex.MarketDataEntry.BIDS,\n pyRofex.MarketDataEntry.OFFERS,\n pyRofex.MarketDataEntry.LAST]\n\n # Subscribes to receive market data messages **\n pyRofex.market_data_subscription(tickers=instruments,\n entries=entries)\n\n # Subscribes to receive order report messages (default account will be used) **\n pyRofex.order_report_subscription()\n\n** Every time a new message is received, the correct handler will be call.\n\nOfficial API Documentation\n==========================\n\nFor more detailed information about ROFEX Rest and Websocket APIs go to the `Primary API Documentation `_.\n\nAcknowledgements\n================\n\nDevelopment of this software was driven by\n`Primary `_ as part of an Open Source\ninitiative of `Grupo Rofex `_.\n\nAuthor/Maintainer\n-----------------\n\n* `Franco Zanuso `_\n\n", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/gruporofex/pyRofex", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "pyRofex", "package_url": "https://pypi.org/project/pyRofex/", "platform": "", "project_url": "https://pypi.org/project/pyRofex/", "project_urls": { "Homepage": "https://github.com/gruporofex/pyRofex" }, "release_url": "https://pypi.org/project/pyRofex/0.2.0/", "requires_dist": [ "requests (>=2.20.0)", "simplejson (>=3.10.0)", "enum34 (>=1.1.6)", "websocket-client (>=0.54.0)" ], "requires_python": "", "summary": "Python connector for ROFEX's Rest and Websocket APIs.", "version": "0.2.0" }, "last_serial": 5699753, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "9c21a45fadd18a19ed76660b822f8a00", "sha256": "bf59468e57335cee9559a40481c0cfd9270a06ca21078e860084e06682fcc511" }, "downloads": -1, "filename": "pyRofex-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "9c21a45fadd18a19ed76660b822f8a00", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 17487, "upload_time": "2019-08-12T17:54:00", "url": "https://files.pythonhosted.org/packages/c1/3d/73f0df1e159b43e49b41be0c0063a544823bc15e331f08ff9366bf0afc59/pyRofex-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "15a1f11d26e95d4e7a548bbd5698f0f9", "sha256": "f94e45c9e687455cc3547cd63d20a202d2687f2e9700bcd4fe196638822604f1" }, "downloads": -1, "filename": "pyRofex-0.1.0.tar.gz", "has_sig": false, "md5_digest": "15a1f11d26e95d4e7a548bbd5698f0f9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15718, "upload_time": "2019-08-12T17:54:02", "url": "https://files.pythonhosted.org/packages/25/ff/fd26eb404c442bf4516aabbeddaf5150fc618f6dd73ce32b10128c7cfd28/pyRofex-0.1.0.tar.gz" } ], "0.1.0rc1": [ { "comment_text": "", "digests": { "md5": "fe18a3eb4d87aec9afc04869c6820f4d", "sha256": "c8cac976fc1e2604b4fef2567a4df86e5f5e043beacb6e26ca1f689b33ffb132" }, "downloads": -1, "filename": "pyRofex-0.1.0rc1-py3-none-any.whl", "has_sig": false, "md5_digest": "fe18a3eb4d87aec9afc04869c6820f4d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 17278, "upload_time": "2019-08-07T20:59:53", "url": "https://files.pythonhosted.org/packages/81/af/ab1fea8255af6923a95ed4eff4a0b929b8fe75b7753885745269f7baa537/pyRofex-0.1.0rc1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "05f626dd161675766abc3cb1b2f55bbe", "sha256": "e0cfe7400c12ceb5a30fc950f795739261bc8661ee8e7e96203feccdc4abdb7b" }, "downloads": -1, "filename": "pyRofex-0.1.0rc1.tar.gz", "has_sig": false, "md5_digest": "05f626dd161675766abc3cb1b2f55bbe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15187, "upload_time": "2019-08-07T20:59:55", "url": "https://files.pythonhosted.org/packages/bb/a6/6927a44092da0da2f0bc26b697b77800753f08c9e03a25f5975750325608/pyRofex-0.1.0rc1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "630924a43afc592aa8b446892f3fa911", "sha256": "b8d1806d682a1525160cffe0833ea90a3792fda0f588187abd65b949dce81ada" }, "downloads": -1, "filename": "pyRofex-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "630924a43afc592aa8b446892f3fa911", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 18480, "upload_time": "2019-08-19T18:28:28", "url": "https://files.pythonhosted.org/packages/09/a0/6aed2b3991cfa40c65daa293c613fe1a1f376a33093f2f356b2d24fd63cf/pyRofex-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "478ff113f4f14dde3c853fbeae5ab22c", "sha256": "c6353684bb5534ad620d3283588658ee22ae3a37fd524328537b20676d40b9c2" }, "downloads": -1, "filename": "pyRofex-0.2.0.tar.gz", "has_sig": false, "md5_digest": "478ff113f4f14dde3c853fbeae5ab22c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16681, "upload_time": "2019-08-19T18:28:30", "url": "https://files.pythonhosted.org/packages/24/1c/4452d0e45fb69e32b344433b7ea9efe001cb271839cfb2404cdff16fd159/pyRofex-0.2.0.tar.gz" } ], "0.2.0rc1": [ { "comment_text": "", "digests": { "md5": "1a73c121d3071989a7df3d7d0a3e9b73", "sha256": "01045f17e5908bd583102d0f770f91541eb191c59f139e1c15a721a149657ed0" }, "downloads": -1, "filename": "pyRofex-0.2.0rc1-py3-none-any.whl", "has_sig": false, "md5_digest": "1a73c121d3071989a7df3d7d0a3e9b73", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 18520, "upload_time": "2019-08-19T18:15:45", "url": "https://files.pythonhosted.org/packages/75/b1/591e7636717546b6fe7e667325099585b14067e10a27018d26c5b56e1c35/pyRofex-0.2.0rc1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0e3f8c46910218be0a72a961337aaa6a", "sha256": "20b8a2d3f1ef0aa43c291c49321fe8cad212ba430953fcbf6a526f8e85ec44a2" }, "downloads": -1, "filename": "pyRofex-0.2.0rc1.tar.gz", "has_sig": false, "md5_digest": "0e3f8c46910218be0a72a961337aaa6a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16690, "upload_time": "2019-08-19T18:15:47", "url": "https://files.pythonhosted.org/packages/60/e1/1d062a0d466218fa2de3fd487dd099ba1cf7768321e206faf6beda17d402/pyRofex-0.2.0rc1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "630924a43afc592aa8b446892f3fa911", "sha256": "b8d1806d682a1525160cffe0833ea90a3792fda0f588187abd65b949dce81ada" }, "downloads": -1, "filename": "pyRofex-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "630924a43afc592aa8b446892f3fa911", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 18480, "upload_time": "2019-08-19T18:28:28", "url": "https://files.pythonhosted.org/packages/09/a0/6aed2b3991cfa40c65daa293c613fe1a1f376a33093f2f356b2d24fd63cf/pyRofex-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "478ff113f4f14dde3c853fbeae5ab22c", "sha256": "c6353684bb5534ad620d3283588658ee22ae3a37fd524328537b20676d40b9c2" }, "downloads": -1, "filename": "pyRofex-0.2.0.tar.gz", "has_sig": false, "md5_digest": "478ff113f4f14dde3c853fbeae5ab22c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16681, "upload_time": "2019-08-19T18:28:30", "url": "https://files.pythonhosted.org/packages/24/1c/4452d0e45fb69e32b344433b7ea9efe001cb271839cfb2404cdff16fd159/pyRofex-0.2.0.tar.gz" } ] }