{ "info": { "author": "Ranx", "author_email": "mod34@yandex.ru", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Libraries" ], "description": "# rupdater\n\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/c1d9a929a0004ed28d7f447067dd2287)](https://app.codacy.com/app/justr4nx/rupdater?utm_source=github.com&utm_medium=referral&utm_content=r4nx/rupdater&utm_campaign=Badge_Grade_Settings)\n\nrupdater is a super lightweight and dependency-free updater, that provide\nremote version parsing, downloading and getting hash sum of an update.\n\n## Installation\n\nrupdater can be install from PyPi by running:\n\n```bash\npip install rupdater\n```\n\n## Usage\n\nFirst of all, create new instance of Updater. It takes 2 arguments:\ncurrent local version and URL of the remote version data file:\n```python\nfrom rupdater import Updater\nupdater = Updater('1.0.0a0', 'https://example.com/remote_version.json', use_json=True)\n```\n\nNow you can check for an update by calling the `check()` method:\n```python\nif updater.check():\n print('Update found!')\n```\n\nAfter checking, you may want to download the update. This can be done\nwith `download()` method, that returns a file-like object (byte-mode)\nof the downloaded update (it stores in a temp file).\nYou should use it only with context manager.\n\n```python\nwith updater.download() as update_file, open('update.zip', 'w+b') as f:\n f.write(update_file.read())\n```\n\nThis example will read the data from update_file and write it to the update.zip.\n\nMore complicated example with chunk-by-chunk reading/writing:\n```python\nwith updater.download() as update_file, open('update.zip', 'w+b') as f:\n for chunk in iter(lambda: update_file.read(1024 * 16), b''):\n f.write(chunk)\n```\n\nrupdater also has hash static method, that takes 2 required arguments and 1 optional:\nfile-like object, hashing algorithm (as string) and chunk size, which is\n1024 * 16 by default. This is the example of usage:\n```python\nwith updater.download() as update_file:\n hashes_match = Updater.hash_file(update_file, updater.hash_algo) == updater.hash\n```\n\nWarning! If you want to reuse the update file, you have to `seek(0)`. Example:\n```python\nwith updater.download() as update_file, open('update.zip', 'w+b') as f:\n for chunk in iter(lambda: update_file.read(1024 * 16), b''):\n f.write(chunk)\n f.seek(0)\n assert Updater.hash_file(f, updater.hash_algo) == updater.hash\n```\n\nYou can also parse version data again manually by calling `get_version_data()`.\n\n## Portability\n`rupdater.py` is absolutely independent of anything at the moment.\nPython Standard Library is the only requirement. So if you need,\nyou can just copy this file and use it like a single module.\n\n## Exceptions handling\nrupdater does not catch any errors, you have to do it yourself as prefer.\nIn addition, rupdater may raise ValueError when incorrect input data was given\n(version data file does not formatted properly, unknown hashing algorithm etc).", "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/r4nx/rupdater", "keywords": "update,updater", "license": "GPLv3", "maintainer": "", "maintainer_email": "", "name": "rupdater", "package_url": "https://pypi.org/project/rupdater/", "platform": "", "project_url": "https://pypi.org/project/rupdater/", "project_urls": { "Homepage": "https://github.com/r4nx/rupdater" }, "release_url": "https://pypi.org/project/rupdater/1.1.1a2/", "requires_dist": null, "requires_python": ">=3.5", "summary": "Lightweight dependency free update software", "version": "1.1.1a2" }, "last_serial": 4328466, "releases": { "1.1.0a0": [ { "comment_text": "", "digests": { "md5": "a64233725f83feb1b92a770cdf3c8442", "sha256": "2a2686d263dfd6c1b279e130291c8f1642ea49cdee81b36745507c4eba22d7b5" }, "downloads": -1, "filename": "rupdater-1.1.0a0.tar.gz", "has_sig": false, "md5_digest": "a64233725f83feb1b92a770cdf3c8442", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 2875, "upload_time": "2018-08-27T12:14:54", "url": "https://files.pythonhosted.org/packages/20/c2/c29bcb945bb400555374f07b1805df8015b547e5f7f40bbfb26fdfe61507/rupdater-1.1.0a0.tar.gz" } ], "1.1.1a0": [ { "comment_text": "", "digests": { "md5": "cb81ba2703f1472fe1e0cb83ec434ebc", "sha256": "7ee686d5da37bf31fef0fd4da1b7280d9c5ff3dde731b6b6207f5f8b14f9f6d2" }, "downloads": -1, "filename": "rupdater-1.1.1a0.tar.gz", "has_sig": false, "md5_digest": "cb81ba2703f1472fe1e0cb83ec434ebc", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 4071, "upload_time": "2018-08-27T14:53:38", "url": "https://files.pythonhosted.org/packages/c5/38/5e68377249eb38341f9bba42282f6cda9cf9eeff8df6690b2c5b4c0edcd3/rupdater-1.1.1a0.tar.gz" } ], "1.1.1a1": [ { "comment_text": "", "digests": { "md5": "cf81b32c7ced544faf57e672b77f8df9", "sha256": "060fcefe2b78baee9b80be42d7753aece715c81c9994adb57661620e9e05dd86" }, "downloads": -1, "filename": "rupdater-1.1.1a1.tar.gz", "has_sig": false, "md5_digest": "cf81b32c7ced544faf57e672b77f8df9", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 4124, "upload_time": "2018-09-01T17:38:11", "url": "https://files.pythonhosted.org/packages/5a/bc/a3e9d39ba53fb744e9f5de06807bac3b01d1d2f81e61c445d4f8fb963b1d/rupdater-1.1.1a1.tar.gz" } ], "1.1.1a2": [ { "comment_text": "", "digests": { "md5": "6e86aab7830133f586692eaf88eef064", "sha256": "a351faa30d8e76939db0197e8188d4bc96bbf5e09c7e2c9b920dc8f779544c2e" }, "downloads": -1, "filename": "rupdater-1.1.1a2.tar.gz", "has_sig": false, "md5_digest": "6e86aab7830133f586692eaf88eef064", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 4230, "upload_time": "2018-10-01T13:32:13", "url": "https://files.pythonhosted.org/packages/2a/f8/61423912ad980f052ea5602369a563b6e0a41d68d33f342b5e363bb148d2/rupdater-1.1.1a2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6e86aab7830133f586692eaf88eef064", "sha256": "a351faa30d8e76939db0197e8188d4bc96bbf5e09c7e2c9b920dc8f779544c2e" }, "downloads": -1, "filename": "rupdater-1.1.1a2.tar.gz", "has_sig": false, "md5_digest": "6e86aab7830133f586692eaf88eef064", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 4230, "upload_time": "2018-10-01T13:32:13", "url": "https://files.pythonhosted.org/packages/2a/f8/61423912ad980f052ea5602369a563b6e0a41d68d33f342b5e363bb148d2/rupdater-1.1.1a2.tar.gz" } ] }