{ "info": { "author": "Simon Ratcliffe", "author_email": "sratcliffe@ska.ac.za", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Scientific/Engineering :: Astronomy", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "MeerKAT Science Data Processor Telescope State\n==============================================\n\nThis is a client package that allows connection to the Redis database that\nstores telescope state information for the Science Data Processor of the\nMeerKAT radio telescope. This database is colloquially known as *telstate*.\n\nThe Redis database acts as a key-value store. Each key is either a *sensor* or\nan *attribute*. A sensor has multiple timestamped values organised into an\nordered set. An attribute (or *immutable* key) has a single value without a\ntimestamp that is not allowed to change.\n\nThe keys are strings and the values are Python objects serialised via\nMessagePack_, which has been extended to support tuples, complex numbers and\nNumPy arrays. Older versions of the database stored the values as pickles, and\nthe package warns the user if that's the case. Keys can be retrieved from the\ntelstate object using attribute syntax or dict syntax.\n\n.. _MessagePack: http://www.msgpack.org/\n\nDatabases can be accessed via one of two backends: a Redis client backend\nthat allows shared access to an actual Redis server over the network (or a\nsimulated server via fakeredis) and a simplified in-memory backend for\nstand-alone access. Both backends support loading and saving a Redis snapshot\nin the form of an RDB dump file.\n\nIt is possible to have multiple *views* on the same database (one per telstate\ninstance). A view is defined as a list of *prefixes* acting as namespaces that\ngroup keys. When reading from the database, each prefix is prepended to the key\nin turn until a match is found. When writing to the database, the first prefix\nis prepended to the key. The first prefix therefore serves as the primary\nnamespace while the rest are supplementary read-only namespaces.\n\n.. warning::\n\n **WARNING**: The standard warning about Python pickles applies. Never\n retrieve data from an untrusted telstate database with values encoded as\n pickles, or connect to such a database over an untrusted network. Pickle\n support can be disabled by setting KATSDPTELSTATE_ALLOW_PICKLE=0 in the\n environment, which should make it safe to connect to untrusted telstates.\n On the other hand, the package warning can be disabled for trusted databases\n by setting the environment variable KATSDPTELSTATE_ALLOW_PICKLE=1.\n\nGetting Started\n---------------\n\nThe simplest way to test out `katsdptelstate` is to use the in-memory backend.\nIf you want to run a real Redis server you will need to install Redis (version\n2.8.9 or newer) on a suitable machine on the network. For example, do this::\n\n- macOS: ``brew install redis``\n- Ubuntu: ``apt-get install redis-server``\n\nThen ``pip install katsdptelstate`` and run a local ``redis-server``. If you\nalso want to load RDB files, do ``pip install katsdptelstate[rdb]``.\n\nA Simple Example\n----------------\n\n.. code:: python\n\n import time\n import katsdptelstate\n\n # Connect to an actual Redis server via an endpoint or an URL\n telstate = katsdptelstate.TelescopeState('localhost:6379')\n telstate = katsdptelstate.TelescopeState('redis://localhost')\n # Or use the in-memory backend (useful for testing)\n telstate = katsdptelstate.TelescopeState()\n # Load RDB file into Redis if katsdptelstate is installed with [rdb] option\n telstate.load_from_file('dump.rdb')\n\n # Attribute / dict style access returns the latest value\n telstate.add('n_chans', 32768)\n print(telstate.n_chans) # -> 32768\n print(telstate['n_chans']) # -> 32768\n\n # List all keys (attributes and sensors)\n print(telstate.keys()) # -> ['n_chans']\n\n # Sensors are timestamped underneath\n st = time.time()\n telstate.add('n_chans', 4096)\n et = time.time()\n telstate.add('n_chans', 16384)\n # Time ranges can be used and are really fast\n telstate.get_range('n_chans', st=st, et=et) # -> [(4096, 1556112474.453495)]\n # Add an item 10 seconds back\n telstate.add('n_chans', 1024, ts=time.time() - 10)\n\n # Attributes cannot be changed (only deleted)\n telstate.add('no_change', 1234, immutable=True)\n # Adding it again is OK as long as the value doesn't change\n telstate.add('no_change', 1234, immutable=True)\n # Simpler notation for setting attributes\n telstate['no_change'] = 1234\n # Will raise katsdptelstate.ImmutableKeyError\n telstate['no_change'] = 456\n\n # Create a new view with namespace 'ns' and standard underscore separator\n view = telstate.view('ns')\n # Insert a new attribute in this namespace and retrieve it\n view['x'] = 1\n print(view['x']) # -> 1\n print(view.prefixes) # -> ('ns_', '')\n print(view.keys()) # -> ['n_chans', 'no_change', 'ns_x']\n\n\nHistory\n=======\n\n0.8 (2019-05-06)\n----------------\n* The default encoding is now msgpack; warn on loading pickles (#75, #79)\n* The default backend is now in-memory (#76)\n* Add the ability to dump in-memory backend to an RDB file (#77)\n* Construct from RDB file-like objects and Redis URLs (#80, #82)\n* Report keys and prefixes to the user as strings (#73)\n* Add IPython tab completion (#83)\n* RDB reader and writer cleanup (#85, #86)\n\n0.7 (2019-02-12)\n----------------\n* Introduce encodings and add msgpack encoding as alternative to pickle (#64, #65)\n* Introduce backends and add in-memory backend as alternative to redis (#71, #72)\n* Simplify setting attributes via `__setitem__` (#68)\n* Let keys be bytes internally, but allow specification as unicode strings (#63)\n* The GitHub repository is now public as well\n\n0.6 (2018-05-10)\n----------------\n* Initial release of katsdptelstate", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ska-sa/katsdptelstate", "keywords": "meerkat ska", "license": "Modified BSD", "maintainer": "", "maintainer_email": "", "name": "katsdptelstate", "package_url": "https://pypi.org/project/katsdptelstate/", "platform": "OS Independent", "project_url": "https://pypi.org/project/katsdptelstate/", "project_urls": { "Homepage": "https://github.com/ska-sa/katsdptelstate" }, "release_url": "https://pypi.org/project/katsdptelstate/0.8/", "requires_dist": null, "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <4", "summary": "Karoo Array Telescope - Telescope State Client", "version": "0.8" }, "last_serial": 5912919, "releases": { "0.6": [ { "comment_text": "", "digests": { "md5": "d2cbf74fc6bab87782aa4ac1300f67f1", "sha256": "16d86168104303bf157f808626afdf4bcb17c5cac14ccc4af302c43d9f89564a" }, "downloads": -1, "filename": "katsdptelstate-0.6-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "d2cbf74fc6bab87782aa4ac1300f67f1", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <4", "size": 24086, "upload_time": "2018-05-10T15:44:00", "url": "https://files.pythonhosted.org/packages/71/0e/f7ff93229e1c9237862178a07c4d10ed4555a874c576aa5a2b4ad79cd8bf/katsdptelstate-0.6-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c2d53d91b99e88d93b55e0d922330558", "sha256": "84f0faaeaa626bd19d27a876326e9dc553d50b7d803ac834ef4324da1f6a8001" }, "downloads": -1, "filename": "katsdptelstate-0.6.tar.gz", "has_sig": true, "md5_digest": "c2d53d91b99e88d93b55e0d922330558", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <4", "size": 23738, "upload_time": "2018-05-10T15:43:42", "url": "https://files.pythonhosted.org/packages/ab/42/67a18f64ff963979e179e0759cfc997a4bff8277fa2b390d8fec5d87dd81/katsdptelstate-0.6.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "2e54ff292652e3105ee5d3a6c5a8a3af", "sha256": "9076e69be571fedd775840cf7bc285a5eacf51d82d49495c755cb907b5687072" }, "downloads": -1, "filename": "katsdptelstate-0.7-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "2e54ff292652e3105ee5d3a6c5a8a3af", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <4", "size": 39576, "upload_time": "2019-02-12T14:21:51", "url": "https://files.pythonhosted.org/packages/c5/eb/9a24b2eb9441f751b0342ef3e359b2e75049844d433cb8a6321ca9af292c/katsdptelstate-0.7-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "251e836a7184a512cccc2b269df2569b", "sha256": "5bb542278693b10441a1b1a52661f448c8523b027dee9519604791343091324e" }, "downloads": -1, "filename": "katsdptelstate-0.7.tar.gz", "has_sig": true, "md5_digest": "251e836a7184a512cccc2b269df2569b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <4", "size": 33549, "upload_time": "2019-02-12T14:21:42", "url": "https://files.pythonhosted.org/packages/6f/a5/502acd7e6325d90e8ea4014be6861fc145803f46f414894d44824999854d/katsdptelstate-0.7.tar.gz" } ], "0.8": [ { "comment_text": "", "digests": { "md5": "6d375277f12c6bb8e05c89e637e88552", "sha256": "64982ca5536a7d0e0c99b554fcf731f6bb9673e371616e6560598770f20c6fd0" }, "downloads": -1, "filename": "katsdptelstate-0.8-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "6d375277f12c6bb8e05c89e637e88552", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <4", "size": 43259, "upload_time": "2019-05-06T09:48:54", "url": "https://files.pythonhosted.org/packages/5b/27/e41d0118f71771c557d354b08b95e70b953cbaf181e1a17ec49cd570a335/katsdptelstate-0.8-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d919ea79ee28dc96a4467aca771322f5", "sha256": "84b9d6ee7de8cace8822fdf7b4989ec95dfc6d472b9fccbff9b034f824af8772" }, "downloads": -1, "filename": "katsdptelstate-0.8.tar.gz", "has_sig": true, "md5_digest": "d919ea79ee28dc96a4467aca771322f5", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <4", "size": 39942, "upload_time": "2019-05-06T09:48:38", "url": "https://files.pythonhosted.org/packages/63/38/01abeb092436b024c00e60890fc3ff8d0d97306c68c41e48ea533ac79942/katsdptelstate-0.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6d375277f12c6bb8e05c89e637e88552", "sha256": "64982ca5536a7d0e0c99b554fcf731f6bb9673e371616e6560598770f20c6fd0" }, "downloads": -1, "filename": "katsdptelstate-0.8-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "6d375277f12c6bb8e05c89e637e88552", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <4", "size": 43259, "upload_time": "2019-05-06T09:48:54", "url": "https://files.pythonhosted.org/packages/5b/27/e41d0118f71771c557d354b08b95e70b953cbaf181e1a17ec49cd570a335/katsdptelstate-0.8-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d919ea79ee28dc96a4467aca771322f5", "sha256": "84b9d6ee7de8cace8822fdf7b4989ec95dfc6d472b9fccbff9b034f824af8772" }, "downloads": -1, "filename": "katsdptelstate-0.8.tar.gz", "has_sig": true, "md5_digest": "d919ea79ee28dc96a4467aca771322f5", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <4", "size": 39942, "upload_time": "2019-05-06T09:48:38", "url": "https://files.pythonhosted.org/packages/63/38/01abeb092436b024c00e60890fc3ff8d0d97306c68c41e48ea533ac79942/katsdptelstate-0.8.tar.gz" } ] }