{ "info": { "author": "Cameron Simpson", "author_email": "cs@cskk.id.au", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Convenience facilities for objects.\n\nPresents:\n* flavour, for deciding whether an object resembles a mapping or sequence.\n* O, an object subclass with a nice __str__ and convenient __init__.\n* Some O_* functions for working with objects, particularly O subclasses.\n* Proxy, a very simple minded object proxy intended to aid debugging.\n\n## Function `copy(obj, *a, **kw)`\n\nConvenient function to shallow copy an object with simple modifications.\n\nPerforms a shallow copy of `self` using copy.copy.\n\nTreat all positional parameters as attribute names, and\nreplace those attributes with shallow copies of the original\nattribute.\n\nTreat all keyword arguments as (attribute,value) tuples and\nreplace those attributes with the supplied values.\n\n## Function `flavour(obj)`\n\nReturn constants indicating the ``flavour'' of an object:\n* `T_MAP`: DictType, DictionaryType, objects with an __keys__ or keys attribute.\n* `T_SEQ`: TupleType, ListType, objects with an __iter__ attribute.\n* `T_SCALAR`: Anything else.\n\n## Class `O`\n\nA bare object subclass to allow storing arbitrary attributes.\n\nIt also has a nice default `__str__`\nand `__eq__` and `__ne__` based on the `O_attrs` of the object.\n\n## Function `O_attritems(o)`\n\nGenerator yielding `(attr,value)` for relevant attributes of `o`.\n\n## Function `O_attrs(o)`\n\nYield attribute names from `o` which are pertinent to `O_str`.\n\nNote: this calls `getattr(o,attr)` to inspect it in order to\nprune callables.\n\n## Function `O_merge(o, _conflict=None, _overwrite=False, **kw)`\n\nMerge key:value pairs from a mapping into an O as attributes.\n\nIgnore keys that do not start with a letter.\nNew attributes or attributes whose values compare equal are\nmerged in. Unequal values are passed to:\n\n _conflict(o, attr, old_value, new_value)\n\nto resolve the conflict. If _conflict is omitted or None\nthen the new value overwrites the old if _overwrite is true.\n\n## Function `O_str(o, no_recurse=False, seen=None)`\n\nReturn a `str` representation of the object `o`.\n\nParameters:\n* `o`: the object to describe.\n* `no_recurse`: if true, do not recurse into the object's structure.\n Default: `False`.\n* `seen`: a set of previously sighted objects\n to prevent recursion loops.\n\n## Function `obj_as_dict(o, attr_prefix=None, attr_match=None)`\n\nReturn a dictionary with keys mapping to `o` attributes.\n\n## Class `Proxy`\n\nAn extremely simple proxy object\nthat passes all unmatched attribute accesses to the proxied object.\n\nNote that setattr and delattr work directly on the proxy, not the proxied object.\n\n## Class `TrackedClassMixin`\n\nA mixin to track all instances of a particular class.\n\nThis is aimed at checking the global state of objects of a\nparticular type, particularly states like counters. The\ntracking is attached to the class itself.\n\nThe class to be tracked includes this mixin as a superclass and calls:\n\n TrackedClassMixin.__init__(class_to_track)\n\nfrom its __init__ method. Note that `class_to_track` is\ntypically the class name itself, not `type(self)` which would\ntrack the specific subclass. At some relevant point one can call:\n\n self.tcm_dump(class_to_track[, file])\n\n`class_to_track` needs a `tcm_get_state` method to return the\nsalient information, such as this from cs.resources.MultiOpenMixin:\n\n def tcm_get_state(self):\n return {'opened': self.opened, 'opens': self._opens}\n\nSee cs.resources.MultiOpenMixin for example use.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/cameron_simpson/css/commits/all", "keywords": "python2,python3", "license": "", "maintainer": "", "maintainer_email": "", "name": "cs.obj", "package_url": "https://pypi.org/project/cs.obj/", "platform": "", "project_url": "https://pypi.org/project/cs.obj/", "project_urls": { "Homepage": "https://bitbucket.org/cameron_simpson/css/commits/all" }, "release_url": "https://pypi.org/project/cs.obj/20190103/", "requires_dist": null, "requires_python": "", "summary": "Convenience facilities for objects.", "version": "20190103" }, "last_serial": 4654552, "releases": { "20150118": [ { "comment_text": "", "digests": { "md5": "5fcf6edc654e3186eb25d9cbf484f8de", "sha256": "7eb2b0b73599793e6f5487488f5751d51a803a294a57421b3b75b7fa0b8239af" }, "downloads": -1, "filename": "cs.obj-20150118.tar.gz", "has_sig": false, "md5_digest": "5fcf6edc654e3186eb25d9cbf484f8de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3525, "upload_time": "2015-01-18T05:54:36", "url": "https://files.pythonhosted.org/packages/94/6c/effe0ef66e6de15e8856f5ea5b9ec219ef82ef3328c9e38763a821f8f179/cs.obj-20150118.tar.gz" } ], "20160828": [ { "comment_text": "", "digests": { "md5": "43ff750d4b65de8ed159dc5cf99ed2a2", "sha256": "f06f19f4fbd67e797a3d80415809a75ac67ff46cf22400cbf5d8dbe1feb753d8" }, "downloads": -1, "filename": "cs.obj-20160828.tar.gz", "has_sig": false, "md5_digest": "43ff750d4b65de8ed159dc5cf99ed2a2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3874, "upload_time": "2016-08-28T06:08:33", "url": "https://files.pythonhosted.org/packages/c8/8f/e038bc99e06f5c1386c858f78fc63e488764800621cf1a5f0bac5a999ed4/cs.obj-20160828.tar.gz" } ], "20170904": [ { "comment_text": "", "digests": { "md5": "fb9906c4c892556f3addf1f8f92e0764", "sha256": "5b52967030c1f3a1039c9532254575374362bf6027f96ba3c077e2bf08eacb47" }, "downloads": -1, "filename": "cs.obj-20170904.tar.gz", "has_sig": false, "md5_digest": "fb9906c4c892556f3addf1f8f92e0764", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3816, "upload_time": "2017-09-04T00:04:08", "url": "https://files.pythonhosted.org/packages/3c/af/422bedcb69ed8cc1774d493a01ff688198e550aab144f1421103fd910b80/cs.obj-20170904.tar.gz" } ], "20190103": [ { "comment_text": "", "digests": { "md5": "cbf05d8b8b124c92515f157a85eceb8f", "sha256": "74949b05412251c73011323827cfe5db966984a64ebca893a7598a35e1ef7717" }, "downloads": -1, "filename": "cs.obj-20190103.tar.gz", "has_sig": false, "md5_digest": "cbf05d8b8b124c92515f157a85eceb8f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5339, "upload_time": "2019-01-02T23:57:23", "url": "https://files.pythonhosted.org/packages/4a/65/08d04eee0ddea21485868c8551d94ee36b4490f6b3ca658a2dc51ce80628/cs.obj-20190103.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cbf05d8b8b124c92515f157a85eceb8f", "sha256": "74949b05412251c73011323827cfe5db966984a64ebca893a7598a35e1ef7717" }, "downloads": -1, "filename": "cs.obj-20190103.tar.gz", "has_sig": false, "md5_digest": "cbf05d8b8b124c92515f157a85eceb8f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5339, "upload_time": "2019-01-02T23:57:23", "url": "https://files.pythonhosted.org/packages/4a/65/08d04eee0ddea21485868c8551d94ee36b4490f6b3ca658a2dc51ce80628/cs.obj-20190103.tar.gz" } ] }