{ "info": { "author": "Chris Loverchio", "author_email": "chrisloverchio@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "===============================\nluogo\n===============================\nluogo is a basic service locator for Python3. I've been working a lot with dependency injection and service location in Java and thought it would be interesting to build something from scratch in my current language of choice. \n\nWhy the name *luogo*? I'm not brimming with funny/clever ideas at the moment; however, I've been watching this Italian crime drama which has inspired me to work on my Italian...\n\nYou might have guessed by now that \"luogo\" is Italian for *location* or *place*. \n\nInstallation\n-------------\n\n::\n\n pip install luogo\n\nUsage\n-----\n\nYou can start by defining your services in a service file (must feature \"service\" in the name). \nServices are denoted with the *Service* decorator.\n\n.. code-block:: python\n\n # world_servce.py\n from luogo import Service\n\n\n @Service\n class HelloWorldService:\n \n def greeting(self):\n return \"Hello World!\"\n\n\nYour service client or implementation can then be in any file or module.\n\n\n.. code-block:: python\n\n # client.py\n from luogo import Locator, Implementation\n\n\n @Implementation\n class HelloWorldServiceClient:\n \n def greeting(self):\n service = Locator.get_service(\"HelloWorldService\")\n return service.greeting()\n\n\n.. code-block:: python\n\n print(HelloWorldServiceClient().greeting())\n # Hello World!\n\n\nYou can also mark functions as services:\n\n.. code-block:: python\n\n # world_service.py\n from luogo import Service\n\n\n @Service\n def hello_world_service:\n return \"Hello World!\"\n\n\n.. code-block:: python\n\n # client.py\n from luogo import Locator, Implementation\n\n\n @Implementation\n def hello_world_service_client:\n return Locator.get_service(\"hello_world_service\")\n \n.. code-block:: python\n\n print(hello_world_service_client())\n # Hello World!\n\nNotes\n-----\n - I finally made it a thing to start using python3 so this probably isn't python2 compatible (might have used a python3 lib somewhere). I might work on it though.\n - Services need to be a file that features the word **service** somewhere in the file name; however, implementations can be anywhere.\n - *Locator* depends on a case insensitive string representation of the service name; however, it's easy to get that if you don't always feel like typing it out.\n \nWorks for my purposes, hopefully it can be of use to someone else!", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/cloverchio/luogo", "keywords": "python3 python service locator dependency injection", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "luogo", "package_url": "https://pypi.org/project/luogo/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/luogo/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/cloverchio/luogo" }, "release_url": "https://pypi.org/project/luogo/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "A service locator for python.", "version": "0.1.0" }, "last_serial": 2854998, "releases": { "0.0.1": [], "0.1.0": [ { "comment_text": "", "digests": { "md5": "6e972005bc6d39e3a886adb48e6e0211", "sha256": "5039de1c4fd28a26355a155f0e5860e1b27613f0c0ba76d7530ecc42fdab6f95" }, "downloads": -1, "filename": "luogo-0.1.0.tar.gz", "has_sig": false, "md5_digest": "6e972005bc6d39e3a886adb48e6e0211", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4609, "upload_time": "2017-05-05T23:01:17", "url": "https://files.pythonhosted.org/packages/48/fa/749a8356ccc858d51d46886cdf9d21295adba1bee18eafafacc27ded6a0f/luogo-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6e972005bc6d39e3a886adb48e6e0211", "sha256": "5039de1c4fd28a26355a155f0e5860e1b27613f0c0ba76d7530ecc42fdab6f95" }, "downloads": -1, "filename": "luogo-0.1.0.tar.gz", "has_sig": false, "md5_digest": "6e972005bc6d39e3a886adb48e6e0211", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4609, "upload_time": "2017-05-05T23:01:17", "url": "https://files.pythonhosted.org/packages/48/fa/749a8356ccc858d51d46886cdf9d21295adba1bee18eafafacc27ded6a0f/luogo-0.1.0.tar.gz" } ] }