{ "info": { "author": "Dmitriy Selischev", "author_email": "zibertscrem@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries :: Application Frameworks" ], "description": "django-hexdi\n============\n\nThis is the project that integrates **hexdi** framework into Django.\n\nVisit `github page `__ of\n**hexdi** project for use-cases and instructions.\n\nCreated for using with django-based applications.\n\nInstallation\n============\n\n.. code:: bash\n\n pip install django-hexdi\n\nKeep in mind that we really recommend to use the same version of hexdi\nthat django-hexdi has\n\nUsage\n=====\n\nFirst step is to add ``djhexdi`` to your ``INSTALLED_APPS`` setting.\n\nImagine next project tree:\n\n::\n\n app_folder\n |-->__init__.py\n |-->services.py\n |-->concrete_services.py\n .....\n |-->urls.py\n |-->forms.py\n |-->views.py\n\nFile services.py contains service class declarations and \"interfaces\".\n\nFile concrete\\_services.py contains implementations of services stored\nin services.py and binded using **hexdi** calls.\n\nforms.py, views.py, and so on use services.py interfaces and inject\nthese interfaces implementations using **hexdi** injections.\n\nSo, there are several ways to set up **hexdi** on Django for static or\nautomatic implementations loading:\n\nDummy strategy\n--------------\n\nThis is the **default strategy** that does nothing on application\nstartup. You really should use something other!\n\n.. code:: python\n\n HEXDI_STRATEGY = 'djhexdi.strategy.Dummy'\n\nStatic strategy\n---------------\n\nThis is the simplest and static strategy of implementations discovery\nusing modules list that contain bindings.\n\nUse next setting to set up this strategy:\n\n.. code:: python\n\n HEXDI_STRATEGY = 'djhexdi.strategy.Static'\n\nUse the special setting to provide dotted path of modules where bindings\nare presented:\n\n.. code:: python\n\n HEXDI_MODULES_LIST = [\n 'path.to.first.module',\n 'path.to.second.module',\n ]\n\nYou can specify a module that contains this list:\n\n.. code:: python\n\n HEXDI_MODULE = '__hexdi__'\n\nUse this discovery when you are sure that there is no other place with\nbindings and your dependency modules don't use hexdi, so on.\n\nFully automatic strategy\n------------------------\n\nThis is the dynamic strategy of modules finding which works on\napplication startup.\n\nUse next setting to set up this strategy:\n\n.. code:: python\n\n HEXDI_STRATEGY = 'djhexdi.strategy.Auto'\n\nBy default, **hexdi** will search in packages that presented in\n``INSTALLED_APPS``. But, you can also specify your special packages for\nsearching using following setting:\n\n.. code:: python\n\n HEXDI_FINDER_PACKAGES = [\n 'path.to.first.package',\n 'path.to.second.package',\n ]\n\nYou can also specify a static modules to load it additionally if it is\nneeded:\n\n.. code:: python\n\n HEXDI_MODULES_LIST = [\n 'path.to.first.module',\n 'path.to.second.module',\n ]\n\nAnd you can specify a number of modules that should be excluded from\nloading:\n\n.. code:: python\n\n HEXDI_EXCLUDE_MODULES = [\n 'path.to.first.excluded.module',\n 'path.to.second.excluded.module',\n ]\n\nUse this strategy if you can **rely on module-finder** or your\ndependencies are using **hexdi**, or something.\n\nBut keep in mind that **this strategy may slowdown your application\nstartup** if you have a huge number of modules/dependencies.\n\nPre-build automatic discovery with static loading\n-------------------------------------------------\n\nThis is the best configuration for application that has a build process\nor same thing.\n\nWorkflow explanation\n~~~~~~~~~~~~~~~~~~~~\n\nBuild process:\n\n1. requirements installation\n2. other build activities (migrations, caching, template building, etc.)\n3. modules automatic discovery and storing results in py-file artifact\n\nRun application:\n\n1. application start\n2. pre-searched artifact loading with modules list on application\n startup process\n\nSetup Django project\n~~~~~~~~~~~~~~~~~~~~\n\nDefine setting for using static strategy:\n\n.. code:: python\n\n HEXDI_STRATEGY = 'djhexdi.strategy.Static'\n\nDefine a file where discovered modules will be stored:\n\n.. code:: python\n\n HEXDI_MODULE = '__hexdi__'\n\nThe best way is to use ``__hexdi__`` as HEXDI\\_MODULE value.\n\nBy default, **hexdi** will search in packages that presented in\n``INSTALLED_APPS``. But, you can also specify your special packages for\nsearching using following setting:\n\n.. code:: python\n\n HEXDI_FINDER_PACKAGES = [\n 'path.to.first.package',\n 'path.to.second.package',\n ]\n\nYou can also define modules that should be loaded additionally\n\n.. code:: python\n\n HEXDI_MODULES_LIST = [\n 'path.to.first.module',\n 'path.to.second.module',\n ]\n\nSet up build step\n~~~~~~~~~~~~~~~~~\n\nUse the special manage.py command for modules automatic discovery\n\nIf you have configured your Django project with ``HEXDI_MODULE`` setting\nthen you can just apply following command:\n\n.. code:: bash\n\n python manage.py di_find --auto\n\nIf you want to specify some other module, just use -m option:\n\n.. code:: bash\n\n python manage.py di_find -m other.module.path --auto\n\n**--auto** option is used for automatic creation of packages tree if not\nexists.\n\nUse this strategy when you have too much dependencies to store all\nmodules manually and if you have build process with controllable build\nsteps. That configuration allows you to have **fully automatic\ndiscovery** once while build process and then **quick application\nstartup** with cached module paths.\n\nAll supported settings\n======================\n\nList of built-in settings and it's description\n\n- ``HEXDI_STRATEGY`` - Strategy for DI container bindings discovery\n used on application startup. Should be inherited from\n ``djhexdi.strategy.AbstractStrategy`` class. Default value\n ``djhexdi.strategy.Dummy``;\n- ``HEXDI_FINDER_PACKAGES`` - A list of packages(dotted paths). By\n default uses ``INSTALLED_APPS`` modules list. Used by\n ``Automatic strategy`` and ``di_find`` management command;\n- ``HEXDI_MODULES_LIST`` - A list of modules(dotted paths) that should\n be loaded on application startup. Used by ``Static strategy`` and\n ``Automatic strategy``;\n- ``HEXDI_EXCLUDE_MODULES`` - A list of modules that should be excluded\n from module-loading. Used by ``Static loading`` and\n ``Automatic loading``;\n- ``HEXDI_MODULE_LIST_NAME`` - A name of variable with modules list\n that should be presented in module(HEXDI\\_MODULE setting). Used by\n ``Static strategy`` and ``di_find`` management command;\n- ``HEXDI_MODULE`` - A module path(dotted path) that contains a\n variable(name stores in HEXDI\\_MODULES\\_LIST\\_NAME) with list of\n module paths(dotted paths). Used by ``Static strategy``,\n ``Automatic strategy``, and ``di_find`` management command.\n- ``HEXDI_LOADER`` - A string contained dotted path to a class that\n will be used as **module loader**. Default value\n ``hexdi.loader.BasicLoader``\n- ``HEXDI_FINDER`` - A string contained dotted path to a class that\n will be used as **module finder**. Default value\n ``hexdi.finder.RecursiveRegexFinder``\n\nCustom strategy\n===============\n\nIf you have some other vision of startup loading strategy, then you are\nable to implement it.\n\nCheck module ``djhexdi.strategy`` for useful abstract classes and\nfunctions:\n\n- function ``load_modules`` loads found or specified modules. Accepts\n modules list(dotted paths) as a first argument and modules to\n exclude(dotted paths) as a second argument. Uses loader specified in\n ``HEXDI_LOADER`` setting;\n- function ``find_modules`` discover modules. Accepts packages\n list(dotted paths) to find as a single argument. Uses finder\n specified in ``HEXDI_FINDER`` setting;\n- class ``AbstractStrategy`` is a very base abstract class that\n provides method ``go`` without arguments for doing some module-load\n staff on application startup. All other strategies should be\n inherited from that class.\n- class ``AbstractLoadModulesStrategy`` is an abstract strategy\n inherited from ``AbstractStrategy`` and provides implemented method\n ``go`` and 2 other methods: discover\\_modules - abstract method that\n should return a modules list, get\\_excluded\\_modules - already\n implemented method that returns a list presented in\n ``HEXDI_EXCLUDE_MODULES`` setting.\n- class ``Static`` is a ready-to-go strategy inherited from\n ``AbstractLoadModulesStrategy`` with implemented behaviour of static\n modules list(HEXDI\\_MODULES\\_LIST) loading and module\n loading(HEXDI\\_MODULE). You can inherit from that class and extend\n static loading with some other staff.\n- class ``Auto`` is a ready-to-go strategy inherited from ``Static``\n strategy and extended it with automatic discovery of modules to load.\n\nCheck module\n`hexdi.utils `__\nfor useful functions\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/zibertscrem/django-hexdi", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-hexdi", "package_url": "https://pypi.org/project/django-hexdi/", "platform": "", "project_url": "https://pypi.org/project/django-hexdi/", "project_urls": { "Homepage": "https://github.com/zibertscrem/django-hexdi" }, "release_url": "https://pypi.org/project/django-hexdi/0.2.1/", "requires_dist": [ "typing", "hexdi (==0.2.1)" ], "requires_python": ">=3.5,<4", "summary": "Highly extensible Dependency injection framework for humans. Django integration", "version": "0.2.1" }, "last_serial": 3508065, "releases": { "0.2.0a1": [ { "comment_text": "", "digests": { "md5": "a28d2e53e1958c43ed6d591030739f43", "sha256": "149576311efc79d64b6ab828fa33e34f8dbcf43322b7ce55b681d0ce54c75646" }, "downloads": -1, "filename": "django_hexdi-0.2.0a1-py3-none-any.whl", "has_sig": false, "md5_digest": "a28d2e53e1958c43ed6d591030739f43", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4", "size": 15632, "upload_time": "2018-01-21T01:58:55", "url": "https://files.pythonhosted.org/packages/a9/e8/28bb9389248831495f052b1d89e897dc04cf6463ae031c996aa5e21d8d47/django_hexdi-0.2.0a1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ce48fb3e476a01aabe068bd67c6a00f3", "sha256": "eafc6c3b1656aef1c8ec1313f15d8b652726e83c818401d3d77ab410d2ac0dea" }, "downloads": -1, "filename": "django-hexdi-0.2.0a1.tar.gz", "has_sig": false, "md5_digest": "ce48fb3e476a01aabe068bd67c6a00f3", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4", "size": 6783, "upload_time": "2018-01-21T01:58:57", "url": "https://files.pythonhosted.org/packages/ac/ce/c2a8d57a3c355a2181a610d5ce74cc96df9178ec5bd26f8b7808db3c8756/django-hexdi-0.2.0a1.tar.gz" } ], "0.2.0a2": [ { "comment_text": "", "digests": { "md5": "d481787d86e23e9f2ee1bbfdcf6a8a1b", "sha256": "a8a64d55ce95ed06dc989588a7e86d38483f4234c338d31a82fb8624186c155c" }, "downloads": -1, "filename": "django_hexdi-0.2.0a2-py3-none-any.whl", "has_sig": false, "md5_digest": "d481787d86e23e9f2ee1bbfdcf6a8a1b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4", "size": 19171, "upload_time": "2018-01-21T02:09:54", "url": "https://files.pythonhosted.org/packages/7d/81/2526a345aaf00e62943246a80775ed1d648e4c6b3ee84243fd70ace2b459/django_hexdi-0.2.0a2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6541f193cd656b9f3dd5fe08f7751acc", "sha256": "1325304f54f5a34bde313e1cb11ce9c48756253866cacdb8c239bcd774f6ba36" }, "downloads": -1, "filename": "django-hexdi-0.2.0a2.tar.gz", "has_sig": false, "md5_digest": "6541f193cd656b9f3dd5fe08f7751acc", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4", "size": 7667, "upload_time": "2018-01-21T02:09:56", "url": "https://files.pythonhosted.org/packages/ad/4a/ab811b25d076761b01bc9547b64be633969b6d12989efc4f4ddc94b12349/django-hexdi-0.2.0a2.tar.gz" } ], "0.2.0a3": [ { "comment_text": "", "digests": { "md5": "e73f1742f0a86817ad214bbd35b52bc0", "sha256": "512e9d5c5e3dbcc358a38c31e8bcec06983ab0f4d5add1c80b5804ec122c0484" }, "downloads": -1, "filename": "django_hexdi-0.2.0a3-py3-none-any.whl", "has_sig": false, "md5_digest": "e73f1742f0a86817ad214bbd35b52bc0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4", "size": 19169, "upload_time": "2018-01-21T02:20:27", "url": "https://files.pythonhosted.org/packages/83/36/bb9ffc5bbd368fceae53bb4e34d76082c514b7ff970506db3d8fd31c2f03/django_hexdi-0.2.0a3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d5ef42d217fa8b77e0419351c634d03d", "sha256": "ac5b5f68a67325c823ebbca0436ead9176e96b6ac0b7de5295d346365a97cc73" }, "downloads": -1, "filename": "django-hexdi-0.2.0a3.tar.gz", "has_sig": false, "md5_digest": "d5ef42d217fa8b77e0419351c634d03d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4", "size": 7691, "upload_time": "2018-01-21T02:20:29", "url": "https://files.pythonhosted.org/packages/7a/b3/5366d2cdede7a3e5311fb5a5e3a7e3e86bdcfb226bd94159a63fd2879dde/django-hexdi-0.2.0a3.tar.gz" } ], "0.2.0a4": [ { "comment_text": "", "digests": { "md5": "b9390f62f9b5b0908cce3401bd7ee561", "sha256": "f96bcbb360bcc9e18166b535176b69e93a5f3da4bb65427dc1555662bb10e909" }, "downloads": -1, "filename": "django_hexdi-0.2.0a4-py3-none-any.whl", "has_sig": false, "md5_digest": "b9390f62f9b5b0908cce3401bd7ee561", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4", "size": 19185, "upload_time": "2018-01-21T02:25:09", "url": "https://files.pythonhosted.org/packages/e2/57/13cd08ba974e5d940491d36beb3e0783df1d3f33aedab465ba95cec7bc3d/django_hexdi-0.2.0a4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "80b5446b34701d4d9b9fa883190abda6", "sha256": "434f00f03e79140d8932c4ee55868310bc9504f598a2afb562062b2454731dda" }, "downloads": -1, "filename": "django-hexdi-0.2.0a4.tar.gz", "has_sig": false, "md5_digest": "80b5446b34701d4d9b9fa883190abda6", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4", "size": 7691, "upload_time": "2018-01-21T02:25:10", "url": "https://files.pythonhosted.org/packages/89/0e/c2df2943bb80c9a4f8a59b504e1ffe61d2d09f4791b77e00e599ca576f5b/django-hexdi-0.2.0a4.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "ab2ca1b140468941320de409228c7ea5", "sha256": "05d819f259756961be809e806f5b81c31ca6c3358f26beedf404a2ada313249d" }, "downloads": -1, "filename": "django_hexdi-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "ab2ca1b140468941320de409228c7ea5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4", "size": 19185, "upload_time": "2018-01-21T03:44:44", "url": "https://files.pythonhosted.org/packages/75/c4/51e08fca0ff73345cc4d2df86ec84f55af8f783b470e2b024012ebc445f1/django_hexdi-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "45a3c6c7b8c743d596cd9d74b99d81d6", "sha256": "94199f4eb03891a211778ebf17c579bf067c9bd6910cd182195fcb08568a3e54" }, "downloads": -1, "filename": "django-hexdi-0.2.1.tar.gz", "has_sig": false, "md5_digest": "45a3c6c7b8c743d596cd9d74b99d81d6", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4", "size": 7698, "upload_time": "2018-01-21T03:44:45", "url": "https://files.pythonhosted.org/packages/17/52/bb8c831d8ca651bbcd4594bb3e9a0fd361694fe6053853953ff5b4ee12dc/django-hexdi-0.2.1.tar.gz" } ], "0.2.1a1": [ { "comment_text": "", "digests": { "md5": "e2555850bc213dfbadc0dae60e04fb9b", "sha256": "b2d31878282d842d4b628d2458e16950b687e3e8a93566c818b7da2547f26942" }, "downloads": -1, "filename": "django_hexdi-0.2.1a1-py3-none-any.whl", "has_sig": false, "md5_digest": "e2555850bc213dfbadc0dae60e04fb9b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4", "size": 19190, "upload_time": "2018-01-21T03:23:42", "url": "https://files.pythonhosted.org/packages/78/12/a71549a4a59f059598cb11582b26557c0bd6484fe9600becdd1c952cc7db/django_hexdi-0.2.1a1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b59c9c4804fa7463ef989896613cfda8", "sha256": "e46e4c132cd88556187bb8ccfe3fa4fb4a77853ddeec93678bf5b911646a3345" }, "downloads": -1, "filename": "django-hexdi-0.2.1a1.tar.gz", "has_sig": false, "md5_digest": "b59c9c4804fa7463ef989896613cfda8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4", "size": 7694, "upload_time": "2018-01-21T03:23:43", "url": "https://files.pythonhosted.org/packages/bb/fa/65f1aeb0cf176cd1e3b8475fe98fb168f1b17baf49d7c11802c370b7bc5c/django-hexdi-0.2.1a1.tar.gz" } ], "0.2.1b1": [ { "comment_text": "", "digests": { "md5": "30a155c5950a3f8cc104b77022e77a2e", "sha256": "2fe7e7b1cf965bbabcf4f5c52e4ff3e509440eb55952942e2d44ec9612f1251d" }, "downloads": -1, "filename": "django_hexdi-0.2.1b1-py3-none-any.whl", "has_sig": false, "md5_digest": "30a155c5950a3f8cc104b77022e77a2e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4", "size": 19203, "upload_time": "2018-01-21T03:35:14", "url": "https://files.pythonhosted.org/packages/5a/dd/51a6f1a478cfb4e78586827322c5a4043bacf80b594a9e20ae0c92a269f5/django_hexdi-0.2.1b1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cb19013fad6dfe8967a1d17b7f00247c", "sha256": "24a2768a8a6156f204aa109c231a32442aaa8c92315d896b43b6e5337298375b" }, "downloads": -1, "filename": "django-hexdi-0.2.1b1.tar.gz", "has_sig": false, "md5_digest": "cb19013fad6dfe8967a1d17b7f00247c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4", "size": 7703, "upload_time": "2018-01-21T03:35:15", "url": "https://files.pythonhosted.org/packages/5d/6c/8c58907ef3d9b8b99183cb82d3f1c13563ae7e4ca683244af7d4e3fe1182/django-hexdi-0.2.1b1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ab2ca1b140468941320de409228c7ea5", "sha256": "05d819f259756961be809e806f5b81c31ca6c3358f26beedf404a2ada313249d" }, "downloads": -1, "filename": "django_hexdi-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "ab2ca1b140468941320de409228c7ea5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4", "size": 19185, "upload_time": "2018-01-21T03:44:44", "url": "https://files.pythonhosted.org/packages/75/c4/51e08fca0ff73345cc4d2df86ec84f55af8f783b470e2b024012ebc445f1/django_hexdi-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "45a3c6c7b8c743d596cd9d74b99d81d6", "sha256": "94199f4eb03891a211778ebf17c579bf067c9bd6910cd182195fcb08568a3e54" }, "downloads": -1, "filename": "django-hexdi-0.2.1.tar.gz", "has_sig": false, "md5_digest": "45a3c6c7b8c743d596cd9d74b99d81d6", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4", "size": 7698, "upload_time": "2018-01-21T03:44:45", "url": "https://files.pythonhosted.org/packages/17/52/bb8c831d8ca651bbcd4594bb3e9a0fd361694fe6053853953ff5b4ee12dc/django-hexdi-0.2.1.tar.gz" } ] }