{ "info": { "author": "David Ing", "author_email": "ing.dave@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# summary\nThis is a very simple (small) software library. It is used only for one thing.\n\nSuppose you are working in a project with a directory structure like this:\n\n```\nproject_folder\n|-scripts_folder\n| |-python_libs\n| | |-my_python_lib\n| | | * __init__.py\n|-sub_folder_1\n| | * my_python_script.py\n```\n\nSuppose you want your python script `my_python_script.py` to consume the `my_python_lib` library.\n\nThen, at the top of your script, you would put the following code.\n\n```python\nimport os\nimport lib_attacher\n\n# Get the folder containing your script file.\nthis_folder=os.path.dirname(os.path.realpath(__file__))\n\n# Attach to the parent folder of your library\nattached = lib_attacher.attach_folder_in_hierarchy(\n start_folder=this_folder,\n target_sub_path=\"scripts_folder/python_libs\")\n\n# Check to make sure it worked\nif attached is None:\n raise Exception(\"Failed to find python_libs folder.\")\n\n# Now you can import your library.\nimport my_python_lib\n```\n\nIf you subsequently move your `my_python_script.py` file around, it will still work. For example,\nit will also work from any of these locations:\n\n```\nproject_folder\n|-sub_folder_1\n| |-sub_folder_2\n| | | * my_python_script.py\n```\n\n\n```\nproject_folder\n|-sub_folder_1\n| |-sub_folder_2\n| | |-sub_folder_3\n| | | | * my_python_script.py\n```\n\n```\nproject_folder\n| * my_python_script.py\n```\n\nIf, by some chance, there are multiple `scripts_folder/python_libs` folders, you can specify the\n`extra_sub_path` parameter to ensure that you match the target folder exactly (without ambiguity).\n\n```python\n# Attach to the parent folder of your library\nattached = lib_attacher.attach_folder_in_hierarchy(\n start_folder=this_folder,\n target_sub_path=\"scripts_folder/python_libs\",\n extra_sub_path=\"my_python_lib/__init__.py\")\n```\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/adaviding/lib_attacher", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "lib-attacher", "package_url": "https://pypi.org/project/lib-attacher/", "platform": "", "project_url": "https://pypi.org/project/lib-attacher/", "project_urls": { "Homepage": "https://github.com/adaviding/lib_attacher" }, "release_url": "https://pypi.org/project/lib-attacher/0.0.1/", "requires_dist": null, "requires_python": ">=3.6", "summary": "A simple library for finding a superordinate path and attaching it to the module search path.", "version": "0.0.1" }, "last_serial": 6005249, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "35001eea24e1100b1289d8f3c7b330e9", "sha256": "360b900969a7ba3fa2ff8b36009d51d0945a9788f9cdeaf3064b8b0f1fe9b103" }, "downloads": -1, "filename": "lib_attacher-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "35001eea24e1100b1289d8f3c7b330e9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 3766, "upload_time": "2019-10-21T02:38:47", "url": "https://files.pythonhosted.org/packages/37/4e/f782164c2f25b3c2afacdc9e6a632b9f91acc97ee0e030c89541e56da259/lib_attacher-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "94f5b7b2e92367553ee0fb34d56f0f6a", "sha256": "3d63028948500f36cb4263aba714b1efa35ef2109515210540593a8f23366b5f" }, "downloads": -1, "filename": "lib_attacher-0.0.1.tar.gz", "has_sig": false, "md5_digest": "94f5b7b2e92367553ee0fb34d56f0f6a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 2681, "upload_time": "2019-10-21T02:38:50", "url": "https://files.pythonhosted.org/packages/49/b7/c9312fd882f3d984df97e2425c4bb6112c12786db39fd2d1d49ff35f02a0/lib_attacher-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "35001eea24e1100b1289d8f3c7b330e9", "sha256": "360b900969a7ba3fa2ff8b36009d51d0945a9788f9cdeaf3064b8b0f1fe9b103" }, "downloads": -1, "filename": "lib_attacher-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "35001eea24e1100b1289d8f3c7b330e9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 3766, "upload_time": "2019-10-21T02:38:47", "url": "https://files.pythonhosted.org/packages/37/4e/f782164c2f25b3c2afacdc9e6a632b9f91acc97ee0e030c89541e56da259/lib_attacher-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "94f5b7b2e92367553ee0fb34d56f0f6a", "sha256": "3d63028948500f36cb4263aba714b1efa35ef2109515210540593a8f23366b5f" }, "downloads": -1, "filename": "lib_attacher-0.0.1.tar.gz", "has_sig": false, "md5_digest": "94f5b7b2e92367553ee0fb34d56f0f6a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 2681, "upload_time": "2019-10-21T02:38:50", "url": "https://files.pythonhosted.org/packages/49/b7/c9312fd882f3d984df97e2425c4bb6112c12786db39fd2d1d49ff35f02a0/lib_attacher-0.0.1.tar.gz" } ] }