{ "info": { "author": "Alexander Tkachev", "author_email": "sasha64sasha@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "======\nPyRAII\n======\n\n.. image:: https://img.shields.io/travis/sasha-tkachev/pyraii.svg\n :target: https://travis-ci.org/sasha-tkachev/pyraii\n.. image:: https://codecov.io/gh/sasha-tkachev/pyraii/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/sasha-tkachev/pyraii\n\nDeclerative resource management library for python\n\n\nExamples\n--------\n\n\nClosing Resources only on exception::\n\n\n from pyraii.context import closing_on_exception\n\n def wait_for_authenticated_client_connection():\n my_socket = wait_for_client_connection(*args)\n with closing_on_exception(my_socket):\n username = authenticate_connection(my_socket)\n return my_socket, username\n\n\nNothrow closing::\n\n\n from pyraii.context import closing_nothrow\n\n # If the file fails to close no exception will be thrown\n with closing_nothrow(my_file):\n my_file.write(data)\n\nResource owning classes::\n\n\n from pyraii.resource_owner import ResourceOwner\n\n class Server(ResourceOwner):\n def __init__():\n self.socket_a = get_socket()\n self.socket_b = get_other_socket()\n self._log_file = open_log_file()\n self._data = \"asdasd\"\n my_server = Server()\n my_server.close() # will close all sockets and files which are members of the server\n\n\nThis package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\n\n\n* Free software: MIT license\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n\n\n=======\nHistory\n=======\n\n1.0.0 (2019-10-18)\n------------------\n\n* First release on PyPI.\n\n1.0.1 (2019-10-18)\n-------------------\n* Add coverage\n* Fix documentation", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/sasha-tkachev/pyraii", "keywords": "pyraii", "license": "MIT license", "maintainer": "", "maintainer_email": "", "name": "pyraii", "package_url": "https://pypi.org/project/pyraii/", "platform": "", "project_url": "https://pypi.org/project/pyraii/", "project_urls": { "Homepage": "https://github.com/sasha-tkachev/pyraii" }, "release_url": "https://pypi.org/project/pyraii/1.0.1/", "requires_dist": null, "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "summary": "Declerative resource management library for python", "version": "1.0.1" }, "last_serial": 5995831, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "34c6cd188f74cc086d40a76e051e389e", "sha256": "482810720493218e42cfa783519519c01719cc97b92df32f51011c9ef665b71a" }, "downloads": -1, "filename": "pyraii-1.0.0.tar.gz", "has_sig": false, "md5_digest": "34c6cd188f74cc086d40a76e051e389e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 11502, "upload_time": "2019-10-18T13:39:59", "url": "https://files.pythonhosted.org/packages/e6/57/7f6604dbf924c87050730285e4c84b42596ad50a5aa01a731daab2bbeaf1/pyraii-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "bd626e45b459b9dd4bcb003b52601ed5", "sha256": "6552dac366b7d8a16986e5e32567450ec8daa35c8334348a6293ec75883850f3" }, "downloads": -1, "filename": "pyraii-1.0.1.tar.gz", "has_sig": false, "md5_digest": "bd626e45b459b9dd4bcb003b52601ed5", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 11755, "upload_time": "2019-10-18T14:08:29", "url": "https://files.pythonhosted.org/packages/f1/dc/40a0571264477cb283d4217318ef3231e885f2dbcfe7f2347c6ac678ab85/pyraii-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "bd626e45b459b9dd4bcb003b52601ed5", "sha256": "6552dac366b7d8a16986e5e32567450ec8daa35c8334348a6293ec75883850f3" }, "downloads": -1, "filename": "pyraii-1.0.1.tar.gz", "has_sig": false, "md5_digest": "bd626e45b459b9dd4bcb003b52601ed5", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 11755, "upload_time": "2019-10-18T14:08:29", "url": "https://files.pythonhosted.org/packages/f1/dc/40a0571264477cb283d4217318ef3231e885f2dbcfe7f2347c6ac678ab85/pyraii-1.0.1.tar.gz" } ] }