{"id":23291921,"url":"https://github.com/jeeftor/alfredmissingdependencies","last_synced_at":"2025-04-06T18:24:15.922Z","repository":{"id":73759810,"uuid":"112231511","full_name":"jeeftor/AlfredMissingDependencies","owner":"jeeftor","description":"Example project showing how an Alfred Workflow could install required dependencies it needs for operation","archived":false,"fork":false,"pushed_at":"2017-11-27T18:21:19.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-13T00:22:53.738Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jeeftor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-27T18:18:10.000Z","updated_at":"2017-11-27T18:18:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"96d61945-9dbc-4c74-b5f1-65b0abbb74e7","html_url":"https://github.com/jeeftor/AlfredMissingDependencies","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeeftor%2FAlfredMissingDependencies","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeeftor%2FAlfredMissingDependencies/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeeftor%2FAlfredMissingDependencies/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeeftor%2FAlfredMissingDependencies/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeeftor","download_url":"https://codeload.github.com/jeeftor/AlfredMissingDependencies/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247527874,"owners_count":20953321,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-20T05:28:11.413Z","updated_at":"2025-04-06T18:24:15.894Z","avatar_url":"https://github.com/jeeftor.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python Dependency Installation (example)\n\nThis workflow is a proof of concept showing how you could setup a workflow to install its own dependencies.\n\nThe structure of this plugin is as follows:\n\nAll python files are stored in the `src` directory while all libraries exist (_or will exist_) in `src/lib`\n\n\nThe way to implement a similar workflow in your own code is as follows:\n\n\nAt the top of any script you want to run add the following lines\n\n```python\n# Add the lib path into the library search path\nlib_path = os.path.dirname(__file__) + '/lib'\nsys.path.append(lib_path)\n```\nThis will tell Pythyon to also look in `src/lib` for any packages you try to import.\n\nNext you want to import the `missing` class from `RequirementsInstaller` which is in `RequirementsInstaller.py` which resides in the `src` directory.  \n\nOnce this is done you can try to import all the required libs - if one throws an exception it will jump into a block which will prompt the user for installing the packages\n\n```python\n\nfrom missing import RequirementsInstaller\n\ntry:\n    # Add the required dependencies into a try block\n    from workflow import Workflow3\n    import pycountry\n    import dotmap\nexcept:\n    # If we cant get any dependencies - lets exit and add the install prompt\n    print RequirementsInstaller().build_alfred_output()\n    exit(2)\n```\n\n# Requirements.txt\n\nThe actual list of what packages to install is determined based on the `src/requirements.txt` file - so you need to make sure that anything you are trying to import is also specified in this file","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeeftor%2Falfredmissingdependencies","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeeftor%2Falfredmissingdependencies","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeeftor%2Falfredmissingdependencies/lists"}