Created
September 12, 2024 22:36
-
-
Save henriquesebastiao/87c3028d52eddbc59bfdbb8ca5614548 to your computer and use it in GitHub Desktop.
Script para verificar se nome de pacote está disponível no PyPi.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| def check_pypi_package(name): | |
| url = f"https://pypi.org/pypi/{name}/json" | |
| response = requests.get(url) | |
| return response.status_code == 200 | |
| package_name = "example-package" # Substitua pelo nome desejado | |
| if check_pypi_package(package_name): | |
| print(f"O pacote '{package_name}' já está em uso.") | |
| else: | |
| print(f"O pacote '{package_name}' está disponível.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment