{ "info": { "author": "Gustavo Bezerra", "author_email": "gusutabopb@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: Financial and Insurance Industry", "Intended Audience :: Science/Research", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Database", "Topic :: Database :: Front-Ends", "Topic :: Software Development :: Libraries" ], "description": "corintick\n=========\n\nColumn-based datastore for historical timeseries data. Corintick is\ndesigned mainly to store `pandas `__\nDataFrames that represent timeseries.\n\n\nInstalation\n-----------\n\nIn order to use Corintick you need MongoDB. See installation\ninstructions `here `__.\n\nCorintick itself can be installed with ``pip``:\n\n.. code:: bash\n\n $ pip install corintick\n\n\nQuickstart\n----------\n\nInitialize Corintick:\n\n.. code:: python\n\n from corintick import Corintick\n corin = Corintick()\n\nNow we need a DataFrame to insert into Corintick. For demonstration\npurposes, we will get data from `Quandl `__:\n\n.. code:: python\n\n import quandl\n df1 = quandl.get('TSE/7203')\n\nHere, ``df1`` looks like this:\n\n.. code:: text\n\n Open High Low Close Volume\n Date\n 2012-08-23 3240.0 3270.0 3220.0 3260.0 4652200.0\n 2012-08-24 3225.0 3245.0 3210.0 3235.0 3659600.0\n 2012-08-27 3250.0 3280.0 3215.0 3220.0 3614600.0\n 2012-08-28 3235.0 3260.0 3150.0 3180.0 6759100.0\n 2012-08-29 3180.0 3195.0 3160.0 3175.0 2614800.0\n 2012-08-30 3180.0 3190.0 3160.0 3170.0 3291700.0\n 2012-08-31 3135.0 3155.0 3095.0 3095.0 5663800.0\n ...\n\nWriting\n^^^^^^^\n\nInserting ``df1`` into Corintick is simple:\n\n.. code:: python\n\n corin.write('7203.T', df1, source='Quandl', country='Japan')\n\nThe first argument passed to ``corintick.write`` is an UID (universal\nidentifier) and must be unique for each timeseries inserted in a given\ncollection. The second argument is the dataframe to be inserted. The\nremaining keyword arguments are optional metadata tags that can be\nattached to the dataframe/document for querying.\n\nReading\n^^^^^^^\n\nReading from Corintick is also straightforward:\n\n.. code:: python\n\n df2 = corin.read('7203.T')\n\nYou can also specify ``start`` and ``end`` as ISO-8601 datetime string...\n\n.. code:: python\n\n df2 = corin.read('7203.T', start='2014-01-01', end='2014-12-31')\n\n\n.. code:: text\n\n Open High Low Close Volume\n 2014-01-06 6360.0 6400.0 6280.0 6300.0 12249300.0\n 2014-01-07 6270.0 6340.0 6260.0 6270.0 7891400.0\n 2014-01-08 6310.0 6320.0 6260.0 6300.0 7184100.0\n 2014-01-09 6310.0 6340.0 6260.0 6270.0 8653000.0\n 2014-01-10 6260.0 6310.0 6250.0 6290.0 7815900.0\n ...\n 2014-12-24 7645.0 7687.0 7639.0 7657.0 9287900.0\n 2014-12-25 7600.0 7655.0 7597.0 7611.0 5362700.0\n 2014-12-26 7629.0 7700.0 7615.0 7696.0 6069100.0\n 2014-12-29 7740.0 7746.0 7565.0 7662.0 9942800.0\n 2014-12-30 7652.0 7674.0 7558.0 7558.0 7821200.0\n\n...and which columns you want retrieved:\n\n.. code:: python\n\n df2 = corin.read('7203.T', columns=['Close', 'Volume'], start='2017-05-10')\n\n.. code:: text\n\n Close Volume\n 2017-05-10 6081.0 7823700.0\n 2017-05-11 6123.0 13511900.0\n 2017-05-12 6047.0 8216600.0\n 2017-05-15 6009.0 5925200.0\n 2017-05-16 6093.0 6449300.0\n ...\n\nConfiguration\n^^^^^^^^^^^^^\n\nBy default, Corintick tries to use a MongoDB instance running at ``localhost:27017``.\nThis can be changed through the ``host`` and ``port`` arguments of the ``Corintick`` initializer.\nSimilarly, the database to be used by Corintick defaults to ``corintick`` and can also be changed using\nthe ``db`` parameter.\nAll the data in the ``db`` database is assumed to be Corintick data. Avoid having any\nother process/application reading/writing data to that database.\n\nIn case your MongoDB setup requires authentication, you can use the ``username`` and ``password`` arguments.\n\nSee ``Corintick.__init__`` for details.\n\n\nCollections\n-----------\n\nCorintick can use multiple collections to better organize data. A\nCorintick collection is the same as a MongoDB collection. In each\ncollection, only a single dataframe/document can exist for a given UID\nfor a given time period.\n\nIn case you need to store two different types of data for a same UID\nover an overlapping time frame (i.e.\u00a0trade data and order book data for\na given stock), you should separate the two different types of data into\ndifferent collections.\n\nBy default, data is written to the ``corintick`` collection.\nThis default collection can be changed by assigning a string to\n``Corintick.default_collection``.\n\n.. code:: python\n\n >>> corin.collection = 'another_collection'\n\nCollections can also be specified on a method call basis:\n\n.. code:: python\n\n df = corin.read('7203.T', collection='orderbook')\n\n.. code:: python\n\n corin.write(df, collection='another_collection')\n\n\nCorintick mechanics\n-------------------\n\nDuring writing, Corintick does the following:\n\n1) Takes the input DataFrame and splits into columns\n2) Serializes/compresses each using the LZ4 compression algorithm\n3) Generates a MongoDB document containing the binary blobs\n corresponding to each column and other metadata\n\nDuring reading, the opposite takes places:\n\n1) Documents are fetched\n2) Data is decompressed and converted back to numpy arrays\n3) DataFrame is reconstructed and returned to the user\n\nBackground\n----------\n\nCorintick was inspired by and aims to be a simplified version of Man\nAHL\u2019s `Arctic `__.\n\n\n\nDifferences from Arctic\n^^^^^^^^^^^^^^^^^^^^^^^\n\nCorintick has a single storage engine, which is column-based and not\nversioned, similar to Arctic\u2019s TickStore. However, differently from\nTickStore, it does support non-numerical ``object`` dtype columns by\nparsing them into MessagePack string objects\n\nNaming\n^^^^^^\n\nCorintick aimed from the beginning to be a column-based data storage.\n\"Corintick\" is a blend of \u201cCorinthan\u201d (style of Roman columns) and\n\"tick\".\n\nBenchmarks\n----------\n\n**TODO**\n\n- **vs InfluxDB**\n- **vs vanila MongoDB**\n- **vs MySQL**\n- **vs KDB+ (32-bit)**\n\nContributing\n------------\n\n| To contribute, fork the repository on GitHub, make your changes and\n submit a pull request.\n| Corintick is not a mature project yet, so just simply raising issues\n is also greatly appreciated :)\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/plugaai/corintick", "keywords": "", "license": "GPL", "maintainer": "", "maintainer_email": "", "name": "corintick", "package_url": "https://pypi.org/project/corintick/", "platform": "", "project_url": "https://pypi.org/project/corintick/", "project_urls": { "Homepage": "https://github.com/plugaai/corintick" }, "release_url": "https://pypi.org/project/corintick/0.2.0/", "requires_dist": [ "lz4 (>=1.0.0)", "pandas (>=0.23)", "pymongo (>=3.6)", "numpy", "pytz", "msgpack-python", "pytest; extra == 'test'", "pytest-cov; extra == 'test'", "flake8; extra == 'test'" ], "requires_python": ">=3.6", "summary": "Column-based datastore for historical timeseries", "version": "0.2.0" }, "last_serial": 4144568, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "e8969d913a4a58803469a205fe872875", "sha256": "0017fc157bd0fdf2be1c7bf0028ebf7736f19fb012043c3e9b36ecff8822f43b" }, "downloads": -1, "filename": "corintick-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "e8969d913a4a58803469a205fe872875", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 9420, "upload_time": "2018-08-07T15:11:34", "url": "https://files.pythonhosted.org/packages/c5/8d/3380674228520046992d179751e3ddd5c42c6f232b64e5ef3ec44567e891/corintick-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5856c2012f32dec99c5928ebf63e1bac", "sha256": "72ac41692339cb43bf3aefae7062a2f98ded9d74ec857cbb6847ba3375fc4e06" }, "downloads": -1, "filename": "corintick-0.2.0.tar.gz", "has_sig": false, "md5_digest": "5856c2012f32dec99c5928ebf63e1bac", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 9100, "upload_time": "2018-08-07T15:11:36", "url": "https://files.pythonhosted.org/packages/74/0f/66460fe68466887d624ec9d7341364e6cd94e81dd2ed8ec19c13eebaca91/corintick-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e8969d913a4a58803469a205fe872875", "sha256": "0017fc157bd0fdf2be1c7bf0028ebf7736f19fb012043c3e9b36ecff8822f43b" }, "downloads": -1, "filename": "corintick-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "e8969d913a4a58803469a205fe872875", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 9420, "upload_time": "2018-08-07T15:11:34", "url": "https://files.pythonhosted.org/packages/c5/8d/3380674228520046992d179751e3ddd5c42c6f232b64e5ef3ec44567e891/corintick-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5856c2012f32dec99c5928ebf63e1bac", "sha256": "72ac41692339cb43bf3aefae7062a2f98ded9d74ec857cbb6847ba3375fc4e06" }, "downloads": -1, "filename": "corintick-0.2.0.tar.gz", "has_sig": false, "md5_digest": "5856c2012f32dec99c5928ebf63e1bac", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 9100, "upload_time": "2018-08-07T15:11:36", "url": "https://files.pythonhosted.org/packages/74/0f/66460fe68466887d624ec9d7341364e6cd94e81dd2ed8ec19c13eebaca91/corintick-0.2.0.tar.gz" } ] }