{ "info": { "author": "Kaappo Raivio", "author_email": "kaappo.raivio@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Findbyid\n\n### What is It?\nThe ```findbyid``` utility is a package that can keep track of all objects that are created from a class that inherits from the ```findbyid.FindByIDFactory``` metaclass.\nIt creates automatically a specific _ID_ for the instance-in-question and provides ```classmethod```s to retrieve the object later by its _ID_.\n\n### What Should I use if For?\n\nLet's say that we have a web server and a client. \nThe server provides the client and interface to an object and needs \nto pass the client a reference to the object of which interface the client is using. \nWithout the ```findbyid``` package, \nthe only way would be to serialize the object and send it to the client somehow. \nNot only would that be not very practical in terms of the amount of network traffic, \nbut also it would make dynamic changes to the object impossible. \nWith the ```findbyid``` module though, we can just pass the _reference ID_ to the client.\nThat way the client can access the object by its _ID_, \nso that the actual data doesn't need to be carried over.\n\nIt is also handy when you have to access a certain object \nfrom two different contexts: you just pass the _ID_ instead of \nthe whole object to the other context.\n\n\n### How do I use It?\nThe usage of the package is simple:\n```python\nimport findbyid\n\nclass ExampleClass(findbyid.FindByIDFactory):\n def __init__(self, example_val):\n super().__init__()\n\n self.example_val = example_val\n\n ...\n\ninstance = ExampleClass(\"Foo\")\nprint(instance.ID)\nprint(instance is ExampleClass.findByID(instance.ID))\n```\n---\n```bash\n>>> 98658\n>>> True\n```\n The _ID_ is random so do not be confused if your _ID_ is different.\n\n\n### In-depth Look\n\n#### Method signatures and such\n* ```def __init__(self: object, *args, **kwargs) -> None``` \n All subclasses need to call the instantiator for the utility to work properly.\n\n\n* ```def findByID(cls, ID: int) -> object:``` \n Returns an object with the given _ID_. If no object is found, a ```NotFoundException``` is raised. \n ```@classmethod```.\n\n* ```def getInstances(cls) -> list[object]:``` \n Returns all objects of a class. \n ```@classmethod```.\n* ```ID``` \n The specific tag that is assigned to every instance of a class inheriting from the ```findbyid.FindByIDFactory``` metaclass.\n\n ### Features to be Added\n * A possibility to be able to serialize and save an object to disk and retrieve it using\n the same ways that it is done currenty with RAM.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/NoSocksForYou/findbyid.git", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "findbyid", "package_url": "https://pypi.org/project/findbyid/", "platform": "", "project_url": "https://pypi.org/project/findbyid/", "project_urls": { "Homepage": "https://github.com/NoSocksForYou/findbyid.git" }, "release_url": "https://pypi.org/project/findbyid/0.0.7/", "requires_dist": null, "requires_python": "", "summary": "A package that allows any instance of a class to be referenced with its ID that is provided by this package", "version": "0.0.7" }, "last_serial": 4443538, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "d68fe6b0e3c6530e1648b720ba352df7", "sha256": "3460b345c6e2c52e2123c079d02b3367e3fe2a0d4365dd774049011b13a4ba1c" }, "downloads": -1, "filename": "findbyid-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "d68fe6b0e3c6530e1648b720ba352df7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2887, "upload_time": "2018-07-11T16:21:20", "url": "https://files.pythonhosted.org/packages/7f/a1/9105cbc4e5585f0ddb4f44a7b50bc3db45ccc94b5ba72e7dc133aaa3a37f/findbyid-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c363f17a3fc702dacffed58fdfbf3aa6", "sha256": "0945892c53c3f18a901ec5787021e918ad179e6c01edeb5170df3d4a3b2248eb" }, "downloads": -1, "filename": "findbyid-0.0.2.tar.gz", "has_sig": false, "md5_digest": "c363f17a3fc702dacffed58fdfbf3aa6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2752, "upload_time": "2018-07-11T16:21:21", "url": "https://files.pythonhosted.org/packages/74/06/82b4975bb30ac0d2028c8a711155f063f48d63194390ad5d89792899200f/findbyid-0.0.2.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "3fff108cab8aa4a240aaac34dd23b54f", "sha256": "597f1ee0833d2e81913d3a683bdc2617064e01d841fce3374c3f66ca5b4027e9" }, "downloads": -1, "filename": "findbyid-0.0.4.tar.gz", "has_sig": false, "md5_digest": "3fff108cab8aa4a240aaac34dd23b54f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2762, "upload_time": "2018-07-13T17:20:04", "url": "https://files.pythonhosted.org/packages/8c/d4/dcbc65ed627361f780c01d44223d3e876478143ca71cc0d47bd881e904ac/findbyid-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "e4baf8564a95a86c8c3f3fa754f04027", "sha256": "79109c6f61d484e02eeab3d6af00939341d4978440af6ec20002e63607c8ccf9" }, "downloads": -1, "filename": "findbyid-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "e4baf8564a95a86c8c3f3fa754f04027", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4559, "upload_time": "2018-11-02T07:34:18", "url": "https://files.pythonhosted.org/packages/3a/8f/7b8ed81bf4afcde312d01734074cdeca3ea06ac71f61f3d8c78769f2422a/findbyid-0.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b4d5a6440c690e599f235d9eabc6110e", "sha256": "889e3f3d68eadaa810c1d6debb2789478899bd6e3c135de0538582ef29c3965d" }, "downloads": -1, "filename": "findbyid-0.0.5.tar.gz", "has_sig": false, "md5_digest": "b4d5a6440c690e599f235d9eabc6110e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3021, "upload_time": "2018-11-02T07:34:19", "url": "https://files.pythonhosted.org/packages/35/13/dc0d0c877e81bf5baa61e5d58b55c69bf0a76985bbc9826a11196aae0f15/findbyid-0.0.5.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "b1118c8ce8eae0d4954cb5e40a4218a8", "sha256": "12e40ca1e6c55b757f63a37631c842dc04e6d431e0eb9e2a42a7ddfd684714be" }, "downloads": -1, "filename": "findbyid-0.0.7-py3-none-any.whl", "has_sig": false, "md5_digest": "b1118c8ce8eae0d4954cb5e40a4218a8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4545, "upload_time": "2018-11-02T07:40:07", "url": "https://files.pythonhosted.org/packages/cc/48/74c39fd28bd419609587b387cb56f0524f6ce909edffb79dac6d53b38206/findbyid-0.0.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d32fa4effa4549510f9e5b9cf52271b9", "sha256": "15e61e2aa264ded72f7313c5e4d4b42569c3b7a41f8ea18fe72c4f72567db7a9" }, "downloads": -1, "filename": "findbyid-0.0.7.tar.gz", "has_sig": false, "md5_digest": "d32fa4effa4549510f9e5b9cf52271b9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3027, "upload_time": "2018-11-02T07:40:09", "url": "https://files.pythonhosted.org/packages/3e/b8/da0c76207875b1975cc43499e649d60f55abfea8bb9470f975fe45d337e7/findbyid-0.0.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b1118c8ce8eae0d4954cb5e40a4218a8", "sha256": "12e40ca1e6c55b757f63a37631c842dc04e6d431e0eb9e2a42a7ddfd684714be" }, "downloads": -1, "filename": "findbyid-0.0.7-py3-none-any.whl", "has_sig": false, "md5_digest": "b1118c8ce8eae0d4954cb5e40a4218a8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4545, "upload_time": "2018-11-02T07:40:07", "url": "https://files.pythonhosted.org/packages/cc/48/74c39fd28bd419609587b387cb56f0524f6ce909edffb79dac6d53b38206/findbyid-0.0.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d32fa4effa4549510f9e5b9cf52271b9", "sha256": "15e61e2aa264ded72f7313c5e4d4b42569c3b7a41f8ea18fe72c4f72567db7a9" }, "downloads": -1, "filename": "findbyid-0.0.7.tar.gz", "has_sig": false, "md5_digest": "d32fa4effa4549510f9e5b9cf52271b9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3027, "upload_time": "2018-11-02T07:40:09", "url": "https://files.pythonhosted.org/packages/3e/b8/da0c76207875b1975cc43499e649d60f55abfea8bb9470f975fe45d337e7/findbyid-0.0.7.tar.gz" } ] }