{ "info": { "author": "Forfunckle", "author_email": "cosminjames555@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7" ], "description": "# qrange\nA small, easy-to-use library for working with ranges.\n\n## Installation\nThis package can be installed with the command:\n```\npip install qrange\n```\n## How to use\nUse qrange in your project by adding the following line at the top of your file:\n```\nimport qrange\n```\nThis library provides a set of functions for making it easier to work with ranges:\n- `set_min_max(x, min_max, min_max_new)`: Takes an `x` that's between `min_max[0]` and `min_max[1]`, and changes the limits to `min_max_new[0]` and `min_max_new[1]`. Example usage:\n```py\ncolor = [128, 0, 0]\ncolor[0] = set_min_max(color[0], [0, 255], [0, 1]) #converts 0-255 color to 0-1 color range.\n```\n![set_min_max](https://raw.githubusercontent.com/Forfunckle/images/master/set_min_max.gif)\n----\n- `reverse_range(x, min_max)`: Reverses an `x` value in a `min_max` range. Suppose you have a `softness` variable, but you made the program so that the higher the softness is, the harder it gets. `reverse_range` can fix that for you:\n```py\nsoftness = reverse_range(softness, [0, 10])\n# If the variable was 0, this function made it 10.\n# similarly, if it had a value of 10, it is now 0.\n```\n![reverse_range](https://raw.githubusercontent.com/Forfunckle/images/master/reverse_range.gif)\n----\n- `is_in_range(x, min_max, limits = ['c', 'c'])`: Checks if an `x` value is between `min_max[0]` and `min_max[1]`. The limits of the range are closed by default, so if `x` is equal to one of them, the function returns `True`. However, you can choose between `c` and `o` (closed/open) for each one of the two limits.\nAn example:\n```py\nisBetween = is_in_range(var, [25, 75])\n```\n![is_in_range](https://raw.githubusercontent.com/Forfunckle/images/master/is_in_range.gif)\n----\n- `range_lerp(min_max, t)`: Returns the linear interpolation between `min_max[0]` and `min_max[1]`. The following line prints the value halfway between 1 and 5:\n```py\nprint(range_lerp([1, 5], 0.5))\n# outputs 3\n```\n![range_lerp](https://raw.githubusercontent.com/Forfunckle/images/master/range_lerp.gif)\n----\n- `find_lerp(x, min_max)`: returns the corresponding `t` value (between 0 and 1) of an `x` value between `min_max[0]` and `min_max[1]`. Consider the following examples:\n```py\nprint(find_lerp(5, [5, 10])) #outputs 0\nprint(find_lerp(10, [5, 10])) #outputs 1\nprint(find_lerp(8, [5, 10])) #outputs 0.6\n```\n![find_lerp](https://raw.githubusercontent.com/Forfunckle/images/master/find_lerp.gif)\n----\n- `clamp(x, min_max)`: Restricts the value to stay within the limits `min_max[0]` and `min_max[1]`.\n```py\nvar = clamp(var, [25, 75])\n```\n![clamp](https://raw.githubusercontent.com/Forfunckle/images/master/clamp.gif)\n\n## Changelog\n### Version 1.0.0\n- qrange has been created\n\n## About the author\nHi! I am a solo software developer. I created **qrange** as an open source library to simplify the process of using ranges in Python. Check out my [other repositories](https://github.com/Forfunckle?tab=repositories) as well.\nIf you want to support me, please [buy me a coffee here](https://www.paypal.me/forfunckle). Any amount is appreciated! :)\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/Forfunckle/qrange", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "qrange", "package_url": "https://pypi.org/project/qrange/", "platform": "", "project_url": "https://pypi.org/project/qrange/", "project_urls": { "Homepage": "https://github.com/Forfunckle/qrange" }, "release_url": "https://pypi.org/project/qrange/1.0.6/", "requires_dist": null, "requires_python": "", "summary": "Working with ranges made simple", "version": "1.0.6" }, "last_serial": 5596111, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "6de94042f9fed664715d2e8125c5e98d", "sha256": "9d70c44df4b6c65a7f26c29889168254a497380e813a079259717ff0104c06bf" }, "downloads": -1, "filename": "qrange-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "6de94042f9fed664715d2e8125c5e98d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2318, "upload_time": "2019-07-28T13:35:09", "url": "https://files.pythonhosted.org/packages/3d/1c/923fb1361fcce90403647304204e64a80a1f415b911f13e87dc5b138fbed/qrange-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9ca5465c6e8fa48fa0c4c3f9ffbd219f", "sha256": "0e135fa527af2406731f856fa4e53f99da02e078c22b3291f2e49e27b64611fa" }, "downloads": -1, "filename": "qrange-1.0.0.tar.gz", "has_sig": false, "md5_digest": "9ca5465c6e8fa48fa0c4c3f9ffbd219f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2409, "upload_time": "2019-07-28T13:35:11", "url": "https://files.pythonhosted.org/packages/30/2b/b04ea0ebe92f24f7f78e45923cacd64eff70c4fd3ae5a5105d48050353db/qrange-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "a120b6f2f54f14e308c9da1b97b71502", "sha256": "22dd9c3b4d09276787a6f2862658124e3b2e14cee1be25dcbd7e56ffaee2dc4d" }, "downloads": -1, "filename": "qrange-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a120b6f2f54f14e308c9da1b97b71502", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2571, "upload_time": "2019-07-28T13:49:50", "url": "https://files.pythonhosted.org/packages/fc/aa/3f01511ce488470d0a324603f9e827cb58d8905e4b7118ba7a8e7e2d88a0/qrange-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "212e7b1648cb96ac15d3a445fdd6119b", "sha256": "a623079f313aa2981cd34da5bed52c85cea0be91f9a135bd8e4e6719667f30ba" }, "downloads": -1, "filename": "qrange-1.0.1.tar.gz", "has_sig": false, "md5_digest": "212e7b1648cb96ac15d3a445fdd6119b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2513, "upload_time": "2019-07-28T13:49:51", "url": "https://files.pythonhosted.org/packages/a7/73/183c29d43a3c0afc0aa1c4233676be30a09dacf0eb2a0aa08be34eec90f3/qrange-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "967f73904bf6ed14305edf9ed9df35d4", "sha256": "5bd0378ef855d4f102a33c3757ccec6e692119fdd97b0fd44f2e128a4bd2cf21" }, "downloads": -1, "filename": "qrange-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "967f73904bf6ed14305edf9ed9df35d4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2572, "upload_time": "2019-07-28T14:54:02", "url": "https://files.pythonhosted.org/packages/5b/1a/00eee1f2830f38fe843f84a1a00b34e42230e3a26335183a2ff11f8d7c84/qrange-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b971aa0c217491ef96c9e0d89ef280fb", "sha256": "740d76ffa3e78d5ddf2e9b5dbbb9e94a8d6394481026d468d0e04ca9c2eb5ab2" }, "downloads": -1, "filename": "qrange-1.0.2.tar.gz", "has_sig": false, "md5_digest": "b971aa0c217491ef96c9e0d89ef280fb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2532, "upload_time": "2019-07-28T14:54:03", "url": "https://files.pythonhosted.org/packages/8b/46/5cee1221fa04eec360e8254bae9bdae59ac21e3450a31d60e6b60345a928/qrange-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "caa3b04a2b3cc6bef7753140361913f4", "sha256": "35fb74754c09f02a96cbc2efc26a5eb02ccf60977460a0008b2e11528bd2026f" }, "downloads": -1, "filename": "qrange-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "caa3b04a2b3cc6bef7753140361913f4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3455, "upload_time": "2019-07-28T16:23:34", "url": "https://files.pythonhosted.org/packages/22/6a/51eaa64e192326f92f6217ad478e5f6b435b3db15765be8f0a29a62baaf4/qrange-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "928a3b1126bb0862fc371d26b716a632", "sha256": "da76c99c8b9463706d0cd749c521b2bd43d62236eba8aa58b170e6b4d5aa5c37" }, "downloads": -1, "filename": "qrange-1.0.3.tar.gz", "has_sig": false, "md5_digest": "928a3b1126bb0862fc371d26b716a632", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2904, "upload_time": "2019-07-28T16:23:36", "url": "https://files.pythonhosted.org/packages/1d/02/44d0f9e3fe7a2f8bd825a909e85475786caae4ebdda4f381f5d1ca4c5f37/qrange-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "8154cb519781af987a5db5dbdece054a", "sha256": "637a3a497585afc2f36aa71333ee5986e1e99f0d7f2d8b78712e033c2e941f9e" }, "downloads": -1, "filename": "qrange-1.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "8154cb519781af987a5db5dbdece054a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3455, "upload_time": "2019-07-28T16:25:14", "url": "https://files.pythonhosted.org/packages/ab/5e/3604d3e9edf64e90fceff677f2afb1029f189a51c1a4a6bcde5a01f511af/qrange-1.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "db43d518febd1dc95836f00848d98a04", "sha256": "583b599fbccf460d1301c91677f9240335fb592a949d2ecce75ccff982e3a012" }, "downloads": -1, "filename": "qrange-1.0.4.tar.gz", "has_sig": false, "md5_digest": "db43d518febd1dc95836f00848d98a04", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2902, "upload_time": "2019-07-28T16:25:16", "url": "https://files.pythonhosted.org/packages/37/8c/b3a6b0c748f139cc030a0ce6f96f28d82a9d02be61356773fcc3158c637a/qrange-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "f0b700a752502a07a9020ba8d4ab6146", "sha256": "5f67bfe3c2149ebca3372b5d439e6461b0418c50d95a59c5292ea8c90738f11e" }, "downloads": -1, "filename": "qrange-1.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "f0b700a752502a07a9020ba8d4ab6146", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3780, "upload_time": "2019-07-28T16:27:29", "url": "https://files.pythonhosted.org/packages/10/fb/b535e277cacfbf4a812925afabd2c7c3a83398c86186b2f62f4d8f6cb1f3/qrange-1.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f110878e1eb8cb70679d1a9602062c53", "sha256": "ee3b9127c567901d6820306dc5d6bf745d4ed1c1dce03709dfcf2b6b5f0900a3" }, "downloads": -1, "filename": "qrange-1.0.5.tar.gz", "has_sig": false, "md5_digest": "f110878e1eb8cb70679d1a9602062c53", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2918, "upload_time": "2019-07-28T16:27:31", "url": "https://files.pythonhosted.org/packages/cf/b3/e90eda37f1590cd662b322691d94e763f32d9aa55ca80c20b837e4b8759b/qrange-1.0.5.tar.gz" } ], "1.0.6": [ { "comment_text": "", "digests": { "md5": "baba981905b667c66858e26743e51cd7", "sha256": "0a661042cf5c883b1f1092324797beb80c2746d11f692b35dd7ec72d14c9c17b" }, "downloads": -1, "filename": "qrange-1.0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "baba981905b667c66858e26743e51cd7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3512, "upload_time": "2019-07-28T16:48:20", "url": "https://files.pythonhosted.org/packages/62/83/17332e1c89519701afd3245a2ab7f741be66c62118e7b218fc72f783b176/qrange-1.0.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fe3a2989a6e504a597429ed161b55adc", "sha256": "6fb4aa5998c910ddfa8cea03dd549cea666cd75109240563159605c111179dfe" }, "downloads": -1, "filename": "qrange-1.0.6.tar.gz", "has_sig": false, "md5_digest": "fe3a2989a6e504a597429ed161b55adc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2841, "upload_time": "2019-07-28T16:48:22", "url": "https://files.pythonhosted.org/packages/ff/88/22e028358264b9e65c164c8ccdc477808c2ab4098922bb7bae3a01fcdcc6/qrange-1.0.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "baba981905b667c66858e26743e51cd7", "sha256": "0a661042cf5c883b1f1092324797beb80c2746d11f692b35dd7ec72d14c9c17b" }, "downloads": -1, "filename": "qrange-1.0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "baba981905b667c66858e26743e51cd7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3512, "upload_time": "2019-07-28T16:48:20", "url": "https://files.pythonhosted.org/packages/62/83/17332e1c89519701afd3245a2ab7f741be66c62118e7b218fc72f783b176/qrange-1.0.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fe3a2989a6e504a597429ed161b55adc", "sha256": "6fb4aa5998c910ddfa8cea03dd549cea666cd75109240563159605c111179dfe" }, "downloads": -1, "filename": "qrange-1.0.6.tar.gz", "has_sig": false, "md5_digest": "fe3a2989a6e504a597429ed161b55adc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2841, "upload_time": "2019-07-28T16:48:22", "url": "https://files.pythonhosted.org/packages/ff/88/22e028358264b9e65c164c8ccdc477808c2ab4098922bb7bae3a01fcdcc6/qrange-1.0.6.tar.gz" } ] }