{ "info": { "author": "Jaden Geller", "author_email": "", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "Intended Audience :: Education", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Topic :: Software Development :: Libraries" ], "description": "# Implicits\nGlobal state can be hard to reason about, but piping dependencies from function to function is a pain. With implicits, you _explicitly_ which function parameters are _implicit_ dependencies. When you call the function, no need to explicilty provide these parameters; instead, the parameters will be implicitly passed! All that's required is that there exists local variables in scope that match the names of the parameters you're calling.\n```python3\n@implicits(\"current_user\")\ndef create_task(title, *, current_user):\n print(f\"{current_user} created a task titled '{title}'\")\n\ncurrent_user = \"Jaden\"\ncreate_task(\"Hooray, a task!\") # Jaden created a task titled 'Hooray, a task!'\ncreate_task(\"Buy some trackpants\") # Jaden created a task titled 'Buy some trackpants'\n```\n\n## Usage\n1) Install via `pip install implicits`.\n2) Import with `from implicits import implicits`.\n3) Decorate using `@implicits(\"names\", \"of\", \"implicit\", \"parameters\")`.\n\n## Example\n```python3\nimport logging\nimport boto3\n\nfrom implicits import implicits\n\nclass Giraffe:\n @implicits(\"logger\")\n def __init__(self, name, *, logger):\n self.name = name\n logger.info(f\"Creating a Giraffe named {name}\")\n\n @property\n @implicits(\"logger\")\n def full_name(self, *, logger):\n logger.info(f\"Getting {self.name}'s full name\")\n return f\"{self.name} the Giraffe\"\n\n @property\n @implicits(\"food\")\n def is_hungry(self, *, food):\n return \"leaves\" in food\n\n@implicits(\"logger\")\ndef main(*, logger):\n jeff = Giraffe(\"Jeff\") # Creating a Giraffe named Jeff\n name = jeff.full_name # Getting Jeff's full name\n food = [\"rocks\", \"dirt\"]\n logger.info(jeff.is_hungry) # False\n food.append(\"leaves\")\n logger.info(jeff.is_hungry) # True\n\nlogger = logging.getLogger()\nlogger.setLevel(logging.INFO)\nlogger.addHandler(logging.StreamHandler())\n\nmain()\n```\n\n## References\n\nI didn't invent this idea! Quite a few other languages support implicit parameters. The most mainstream of these languages is Scala. [Check out how implicits work in Scala!](https://docs.scala-lang.org/tour/implicit-parameters.html)\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/JadenGeller/Implicits", "keywords": "implicit implicits arguments parameters scala context locals", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "implicits", "package_url": "https://pypi.org/project/implicits/", "platform": "", "project_url": "https://pypi.org/project/implicits/", "project_urls": { "Homepage": "https://github.com/JadenGeller/Implicits" }, "release_url": "https://pypi.org/project/implicits/1.0.2/", "requires_dist": null, "requires_python": "", "summary": "Implicit parameters in Python", "version": "1.0.2" }, "last_serial": 4613059, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "5ced1eff868f36f01ef34de20f25ccf6", "sha256": "919835c15caa71842a9196cd07cae38e09c312950bf2f3552f3dc3a2d4b158ba" }, "downloads": -1, "filename": "implicits-1.0.0-py2-none-any.whl", "has_sig": false, "md5_digest": "5ced1eff868f36f01ef34de20f25ccf6", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 1948, "upload_time": "2018-12-18T15:59:09", "url": "https://files.pythonhosted.org/packages/70/a4/d255fc665cd5732251556b7f49d816c602992b979deec0e1c031d2f43907/implicits-1.0.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "16e75a6b1b00c1d9c20492c3fff57126", "sha256": "785426ef764fa34eb238414e85e989acd83fe488184324ac7d86a09132bddf39" }, "downloads": -1, "filename": "implicits-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "16e75a6b1b00c1d9c20492c3fff57126", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2760, "upload_time": "2018-12-18T15:59:12", "url": "https://files.pythonhosted.org/packages/2e/37/32608fc415baed7ed7cf29fc2eaf8ec4f878852a4f5ba2683cf0b7e7e0cc/implicits-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3115928677754c038c9b3393a5a112b7", "sha256": "29b3d890edec282b44fac6e67995ebe323783e80c3f3c75b97fb0da6248adbb1" }, "downloads": -1, "filename": "implicits-1.0.0.tar.gz", "has_sig": false, "md5_digest": "3115928677754c038c9b3393a5a112b7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1395, "upload_time": "2018-12-18T15:59:13", "url": "https://files.pythonhosted.org/packages/17/24/abddf9158b6301d3d84bf1ac1a352ec804bf94cf3c85fde9ec78e668212d/implicits-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "720c5373d13766f79e900bcc94114b9c", "sha256": "5e4f74e80a2695930ed61f9251e3274c436a8e91f7f793c4657926b77605e278" }, "downloads": -1, "filename": "implicits-1.0.1-py2-none-any.whl", "has_sig": false, "md5_digest": "720c5373d13766f79e900bcc94114b9c", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 1951, "upload_time": "2018-12-18T16:04:33", "url": "https://files.pythonhosted.org/packages/a8/2d/2b5e7b0cc8232ac5544ae8745a96b23285b3bf499c73f09f7f0c0d03d109/implicits-1.0.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0668e1f991ea1cddc616cf2d88519824", "sha256": "772bcd663085a23f96b05ed19b0656f1dbca69ec5fec1a30d38306a2af73fc24" }, "downloads": -1, "filename": "implicits-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "0668e1f991ea1cddc616cf2d88519824", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2763, "upload_time": "2018-12-18T16:04:34", "url": "https://files.pythonhosted.org/packages/bb/a8/2109a2b0f6583cd70d9a2701dda3f72d7d4108f09a7ac67aa1ae539eb36e/implicits-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "02b781b7af58897f6524313a48265fe6", "sha256": "651731f82df1a9cabb295571fcf32a25afdf867e88c910ec07563f6283578e3e" }, "downloads": -1, "filename": "implicits-1.0.1.tar.gz", "has_sig": false, "md5_digest": "02b781b7af58897f6524313a48265fe6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1396, "upload_time": "2018-12-18T16:04:36", "url": "https://files.pythonhosted.org/packages/07/35/c8d681d5976f5ef0b512c877f3306a2eace1c868113451f846d7131d10d8/implicits-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "1f167ca11d1fb3b0d221498ee7a3b7f0", "sha256": "e6aed18a19802b4459bb4098169c66cdedc65d072eef1cff37c753bcf992c6ca" }, "downloads": -1, "filename": "implicits-1.0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "1f167ca11d1fb3b0d221498ee7a3b7f0", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 2847, "upload_time": "2018-12-18T17:18:40", "url": "https://files.pythonhosted.org/packages/27/78/822122504af0e99234ce9cce6d095b0eebc926f36e8e83de96fa782eb09e/implicits-1.0.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9d834c333f7e87a914abe66ca9c35ec4", "sha256": "b941cc5c5e8f6f39fe415a3991951fab90267a112299a906cd111aa412c5615d" }, "downloads": -1, "filename": "implicits-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "9d834c333f7e87a914abe66ca9c35ec4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3660, "upload_time": "2018-12-18T17:18:41", "url": "https://files.pythonhosted.org/packages/8a/67/aa8d7983b7583fda526171de38c5f3ac6bb5ae5506066c40b06a5fd32d69/implicits-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "444b3bcd3283713b1c9805624a678ec2", "sha256": "6676e25456c654bf551a95ff208c00279cac559001d24e22c345cc94f838b6ba" }, "downloads": -1, "filename": "implicits-1.0.2.tar.gz", "has_sig": false, "md5_digest": "444b3bcd3283713b1c9805624a678ec2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2545, "upload_time": "2018-12-18T17:18:44", "url": "https://files.pythonhosted.org/packages/7b/76/0ea282a955c2893a49fc77e44f737f868855386089c3f1e3bed54752d448/implicits-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1f167ca11d1fb3b0d221498ee7a3b7f0", "sha256": "e6aed18a19802b4459bb4098169c66cdedc65d072eef1cff37c753bcf992c6ca" }, "downloads": -1, "filename": "implicits-1.0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "1f167ca11d1fb3b0d221498ee7a3b7f0", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 2847, "upload_time": "2018-12-18T17:18:40", "url": "https://files.pythonhosted.org/packages/27/78/822122504af0e99234ce9cce6d095b0eebc926f36e8e83de96fa782eb09e/implicits-1.0.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9d834c333f7e87a914abe66ca9c35ec4", "sha256": "b941cc5c5e8f6f39fe415a3991951fab90267a112299a906cd111aa412c5615d" }, "downloads": -1, "filename": "implicits-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "9d834c333f7e87a914abe66ca9c35ec4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3660, "upload_time": "2018-12-18T17:18:41", "url": "https://files.pythonhosted.org/packages/8a/67/aa8d7983b7583fda526171de38c5f3ac6bb5ae5506066c40b06a5fd32d69/implicits-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "444b3bcd3283713b1c9805624a678ec2", "sha256": "6676e25456c654bf551a95ff208c00279cac559001d24e22c345cc94f838b6ba" }, "downloads": -1, "filename": "implicits-1.0.2.tar.gz", "has_sig": false, "md5_digest": "444b3bcd3283713b1c9805624a678ec2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2545, "upload_time": "2018-12-18T17:18:44", "url": "https://files.pythonhosted.org/packages/7b/76/0ea282a955c2893a49fc77e44f737f868855386089c3f1e3bed54752d448/implicits-1.0.2.tar.gz" } ] }