{"id":24961027,"url":"https://github.com/ratulmaharaj/pre-pip","last_synced_at":"2025-09-14T22:18:08.521Z","repository":{"id":63956456,"uuid":"571844813","full_name":"RatulMaharaj/pre-pip","owner":"RatulMaharaj","description":"Run some python before your pip commands.","archived":false,"fork":false,"pushed_at":"2022-12-05T00:44:19.000Z","size":57,"stargazers_count":3,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T12:50:50.239Z","etag":null,"topics":["click","hooks","pip","python","rich"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/pre-pip/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RatulMaharaj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-11-29T02:10:08.000Z","updated_at":"2023-01-02T10:12:10.000Z","dependencies_parsed_at":"2023-01-14T16:30:55.066Z","dependency_job_id":null,"html_url":"https://github.com/RatulMaharaj/pre-pip","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RatulMaharaj%2Fpre-pip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RatulMaharaj%2Fpre-pip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RatulMaharaj%2Fpre-pip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RatulMaharaj%2Fpre-pip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RatulMaharaj","download_url":"https://codeload.github.com/RatulMaharaj/pre-pip/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248299061,"owners_count":21080455,"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":["click","hooks","pip","python","rich"],"created_at":"2025-02-03T08:45:18.448Z","updated_at":"2025-04-10T21:22:46.816Z","avatar_url":"https://github.com/RatulMaharaj.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\" style=\"height: 3em;\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/RatulMaharaj/pre-pip/main/pre-pip.svg\" alt=\"pre-pip\" align=\"center\"\u003e\u003c/img\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003cem\u003eRun some python code just before your pip commands.\u003c/em\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/RatulMaharaj/pre-pip/actions/workflows/python-test-zsh.yml\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://github.com/RatulMaharaj/pre-pip/actions/workflows/python-test-zsh.yml/badge.svg\" alt=\"pytest zsh\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/RatulMaharaj/pre-pip/actions/workflows/python-test-bash.yml\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://github.com/RatulMaharaj/pre-pip/actions/workflows/python-test-bash.yml/badge.svg\" alt=\"pytest bash\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://pypi.org/project/pre-pip\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/v/pre-pip?color=%2334D058\u0026label=pypi%20package\" alt=\"Package version\"\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\n\u003chr/\u003e\n\n### Use cases\n\n- Before installing a package, check it against a list of known malicious packages.\n- Upgrade pip automatically before installing a package.\n- Inject pip proxy settings into the environment before installing a package.\n\nYou can use it to run any custom python code before a pip command is executed.\n\n### Supported shells\n\nThe following shells are currently supported:\n\n- `zsh`\n- `bash`\n\nI'm currently working on adding support for `powershell` and will thereafter look at `fish`.\n\nContributions for any other shells are welcome.\n\n### Installation\n\nThe recommended way to install `pre-pip` would be using `pipx`. This will enable you to use `pre-pip` with multiple python versions or across virtual environments.\n\n```sh\npipx install pre-pip\n```\n\nAlternatively, you can install it with `pip`:\n\n```sh\npip install pre-pip\n```\n\n### Usage\n\nInstall `pre-pip` into your `.*rc` file using:\n\n```sh\npre-pip install\n```\n\n### Register a custom demo hook\n\nCreate a new file called `hook.py` in your current directory with the following content:\n\n```python\n# hook.py\nfrom rich import print as rprint\n\n\ndef main(args):\n    rprint(\n        f\"This [italic green]pre-pip[/italic green] hook received: [italic cyan]{args}[/italic cyan]\",\n    )\n\n```\n\nRegister the hook using:\n\n```sh\npre-pip add hook.py\n```\n\nYou can view the list of registered hooks using:\n\n```sh\npre-pip list\n```\n\n### Uninstall\n\nUninstall `pre-pip` using:\n\n```sh\npre-pip uninstall\n```\n\nThis will remove the `pre-pip` hook from your `.*rc` file as well as all registered hooks.\n\nTo remove the pre-pip package, use:\n\n```sh\npip uninstall pre-pip\n```\n\n### License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fratulmaharaj%2Fpre-pip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fratulmaharaj%2Fpre-pip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fratulmaharaj%2Fpre-pip/lists"}