{"id":20153379,"url":"https://github.com/viseshrp/whatsonpypi","last_synced_at":"2025-04-09T21:33:09.684Z","repository":{"id":46152424,"uuid":"163690087","full_name":"viseshrp/whatsonpypi","owner":"viseshrp","description":"CLI tool to get package info from PyPI and/or add to requirements.","archived":false,"fork":false,"pushed_at":"2024-05-27T19:37:08.000Z","size":123,"stargazers_count":8,"open_issues_count":9,"forks_count":0,"subscribers_count":0,"default_branch":"develop","last_synced_at":"2025-03-23T23:26:53.660Z","etag":null,"topics":["api-client","api-wrapper","cli","cli-app","cli-application","cli-tool","cli-utilities","cli-utility","command-line","command-line-tool","dependency-manager","developer-tools","package-info","pypi","pypi-package","pypi-packages","python","requirements"],"latest_commit_sha":null,"homepage":"","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/viseshrp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2018-12-31T18:31:12.000Z","updated_at":"2025-01-23T08:13:01.000Z","dependencies_parsed_at":"2024-11-13T23:29:06.704Z","dependency_job_id":null,"html_url":"https://github.com/viseshrp/whatsonpypi","commit_stats":{"total_commits":103,"total_committers":3,"mean_commits":"34.333333333333336","dds":"0.24271844660194175","last_synced_commit":"e616d22cdd7fd6b0f5d845a327c722e88ce34b94"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viseshrp%2Fwhatsonpypi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viseshrp%2Fwhatsonpypi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viseshrp%2Fwhatsonpypi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viseshrp%2Fwhatsonpypi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/viseshrp","download_url":"https://codeload.github.com/viseshrp/whatsonpypi/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248114959,"owners_count":21050145,"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":["api-client","api-wrapper","cli","cli-app","cli-application","cli-tool","cli-utilities","cli-utility","command-line","command-line-tool","dependency-manager","developer-tools","package-info","pypi","pypi-package","pypi-packages","python","requirements"],"created_at":"2024-11-13T23:18:46.060Z","updated_at":"2025-04-09T21:33:09.672Z","avatar_url":"https://github.com/viseshrp.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"whatsonpypi\n===========\n\n[![image](https://img.shields.io/pypi/v/whatsonpypi.svg)](https://pypi.python.org/pypi/whatsonpypi)\n[![Python versions](https://img.shields.io/pypi/pyversions/whatsonpypi.svg?logo=python\u0026logoColor=white)](https://pypi.org/project/whatsonpypi/)\n[![Tests status](https://github.com/viseshrp/whatsonpypi/workflows/Test/badge.svg)](https://github.com/viseshrp/whatsonpypi/actions?query=workflow%3ATest)\n[![Coverage](https://codecov.io/gh/viseshrp/whatsonpypi/branch/develop/graph/badge.svg)](https://codecov.io/gh/viseshrp/whatsonpypi)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/viseshrp/whatsonpypi/blob/develop/LICENSE)\n[![Downloads](https://pepy.tech/badge/whatsonpypi)](https://pepy.tech/project/whatsonpypi)\n\nGet package info from PyPI. Modify your requirements files.\n\nWhy build this\n--------------\n\nI find myself checking the PyPI page very frequently mostly when upgrading\ndependencies to get the latest versions. I'm inherently lazy and did not want\nto get my ass off my terminal window.\n\nHow it works\n------------\n\nNo real magic here. It uses the `requests` package to hit the public PyPI\nREST API, parses the JSON and displays it. There's also some basic file\nmanipulation to modify requirements files. Embarrassingly simple.\n\nInstallation\n------------\n\n``` {.bash}\npip install whatsonpypi\n```\n\nRequirements\n------------\n\n- Python 3.7+\n\nFeatures\n--------\n\n- Find information on a package on PyPI\n\n    \u003e Examples:\n    \u003e\n    \u003e ``` bash\n    \u003e $ whatsonpypi django\n    \u003e NAME\n    \u003e     Django\n    \u003e LATEST VERSION\n    \u003e     2.1.5\n    \u003e SUMMARY\n    \u003e     A high-level Python Web framework that encourages\n    \u003e rapid development and clean, pragmatic design.\n    \u003e PACKAGE URL\n    \u003e     https://pypi.org/project/Django/\n    \u003e AUTHOR\n    \u003e     Django Software Foundation\n    \u003e LATEST RELEASES\n    \u003e     2.2a1, 2.1rc1, 2.1b1, 2.1a1, 2.1.5\n    \u003e ```\n\n- For more information..\n\n    \u003e Examples:\n    \u003e\n    \u003e ``` bash\n    \u003e $ whatsonpypi django --more\n    \u003e ...\n    \u003e ```\n\n- Version specific information..\n\n    \u003e Examples:\n    \u003e\n    \u003e ``` bash\n    \u003e $ whatsonpypi django==2.1.4 --more\n    \u003e ...\n    \u003e ```\n\n- Launch PyPI URL of project in a browser tab\n\n    \u003e Examples:\n    \u003e\n    \u003e ``` bash\n    \u003e $ whatsonpypi django --open\n    \u003e ```\n\n- Launch documentation URL of project in a browser tab\n\n    \u003e Examples:\n    \u003e\n    \u003e ``` bash\n    \u003e $ whatsonpypi django --docs\n    \u003e ```\n\n- Add packages to your requirements files.\n\n    \u003e Examples:\n    \u003e\n    \u003e ``` bash\n    \u003e $ whatsonpypi django --add\n    \u003e ```\n    \u003e\n    \u003e By default, it searches for files with names matching\n    \u003e `requirements*.txt` in the current working directory and adds the\n    \u003e dependency to the end of the file.\n    \u003e\n    \u003e You can change the filename pattern to search for. The pattern may\n    \u003e contain simple shell-style wildcards.\n    \u003e\n    \u003e ``` bash\n    \u003e $ whatsonpypi django --add --req-pattern \"*.txt\"\n    \u003e ```\n    \u003e\n    \u003e **If there\\'s more than one file**, you will see a prompt allowing\n    \u003e you to select the files that should be modified.\n    \u003e\n    \u003e If you want the dependency to be added to a specific line, mention\n    \u003e a comment `#wopp` on its own line, which will be replaced with the\n    \u003e dependency:\n    \u003e\n    \u003e Example:\n    \u003e\n    \u003e Do this in your requirements.txt:\n    \u003e\n    \u003e ``` yaml\n    \u003e # Django\n    \u003e django==2.1.5\n    \u003e # testing\n    \u003e pytest==4.1.1\n    \u003e #wopp\n    \u003e ```\n    \u003e\n    \u003e Then running this:\n    \u003e\n    \u003e ``` bash\n    \u003e $ whatsonpypi pytest-runner --add\n    \u003e ```\n    \u003e\n    \u003e will produce this:\n    \u003e\n    \u003e ``` yaml\n    \u003e # Django\n    \u003e django==2.1.5\n    \u003e # testing\n    \u003e pytest==4.1.1\n    \u003e pytest-runner==4.2\n    \u003e ```\n    \u003e\n    \u003e Use requirements specifications as needed. `==`, `\u003e=`, `\u003c=` or\n    \u003e `~=` using `--ee`, `--ge`, `--le` or `--te`. Default is `--ee`:\n    \u003e\n    \u003e ``` bash\n    \u003e $ whatsonpypi pytest-runner --add --ge\n    \u003e ```\n    \u003e\n    \u003e will produce this:\n    \u003e\n    \u003e ``` yaml\n    \u003e # Django\n    \u003e django==2.1.5\n    \u003e # testing\n    \u003e pytest==4.1.1\n    \u003e pytest-runner\u003e=4.2\n    \u003e ```\n    \u003e\n    \u003e Existing dependencies will be replaced with newer versions.\n    \u003e Dependency version by default is the latest unless specified\n    \u003e explicitly like:\n    \u003e\n    \u003e ``` bash\n    \u003e $ whatsonpypi pytest-runner==4.1 --add\n    \u003e ```\n    \u003e\n    \u003e Note that you may have you to double quote it in order to prevent\n    \u003e Bash from parsing it.\n    \u003e\n    \u003e ``` bash\n    \u003e $ whatsonpypi \"pytest-runner\u003e=4.1\" --add\n    \u003e ```\n    \u003e\n    \u003e Optionally, directory to search for requirement files can be\n    \u003e specified with `--req-dir`. Both absolute and relative paths are\n    \u003e allowed. Must be a directory.\n    \u003e\n    \u003e ``` bash\n    \u003e $ whatsonpypi pytest-runner==4.1 --add --req-dir /Users/Me/Documents/GitHub/project/requirements\n    \u003e ```\n    \u003e\n    \u003e Default value (if not provided) is the directory where the command\n    \u003e is run (cwd).\n    \u003e\n    \u003e Also, optionally, you can specify comments to add before a\n    \u003e dependency. Note that the comment will not be added if the\n    \u003e dependency already exists in the file.\n    \u003e\n    \u003e For example, running this:\n    \u003e\n    \u003e ``` bash\n    \u003e $ whatsonpypi pytest-runner --add --comment 'testing'\n    \u003e ```\n    \u003e\n    \u003e will add this:\n    \u003e\n    \u003e ``` yaml\n    \u003e # testing\n    \u003e pytest-runner==4.2\n    \u003e ```\n\nUsage\n-----\n\n\u003c!-- [[[cog\nimport cog\nfrom whatsonpypi import cli\nfrom click.testing import CliRunner\nrunner = CliRunner()\nresult = runner.invoke(cli.main, [\"--help\"])\nout = result.output.replace(\"Usage: main\", \"Usage: whatsonpypi\")\ncog.out(\n    \"``` {{.bash}}\\n\"\n    \"$ whatsonpypi --help\\n\"\n    \"{}\\n\"\n    \"```\".format(out)\n)\n]]] --\u003e\n``` {.bash}\n$ whatsonpypi --help\nUsage: whatsonpypi [OPTIONS] PACKAGE\n\n  CLI tool to get package info from PyPI and/or manipulate requirements.\n\n  Example usages:\n\n  $ whatsonpypi django\n\nOptions:\n  -v, --version            Show the version and exit.\n  -m, --more               Flag to enable expanded output  [required]\n  -d, --docs               Flag to open docs or homepage of project\n  -o, --open               Flag to open PyPI page\n  -a, --add                Flag to enable adding of dependencies to requirement\n                           files. By default, it searches for files with names\n                           matching requirements*.txt in the current working\n                           directory and adds the dependency to the end of the\n                           file. If you want the dependency to be added to a\n                           specific line, mention the comment '#wopp' on its own\n                           line which will be replaced with the dependency.\n                           Existing dependencies will be replaced with newer\n                           versions. Dependency version by default is the latest\n                           unless specified explicitly with 'whatsonpypi\n                           package==version'. Directory to search for\n                           requirement files can be specified with --req-dir\n  -r, --req-dir DIRECTORY  Directory to search for requirement files. Only used\n                           when --add is used.  [default: .]\n  -p, --req-pattern TEXT   Filename pattern for searching requirements files.\n                           [default: requirements*.txt; required]\n  -c, --comment TEXT       Comment to be added for the dependency when using\n                           --add.\n  --ee                     use == when adding to requirements.\n  --le                     use \u003c= when adding to requirements.\n  --ge                     use \u003e= when adding to requirements.\n  --te                     use ~= when adding to requirements.\n  -h, --help               Show this message and exit.\n\n```\n\u003c!-- [[[end]]] --\u003e\n\nCredits\n-------\n\n- [Click](https://click.palletsprojects.com), for making writing CLI\n    tools a complete pleasure.\n- [Simon Willison](https://github.com/simonw/sqlite-utils/) for some\n    inspiration.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviseshrp%2Fwhatsonpypi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviseshrp%2Fwhatsonpypi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviseshrp%2Fwhatsonpypi/lists"}