https://github.com/qba73/gopypi
Go client for PyPI REST API
https://github.com/qba73/gopypi
go golang golang-library library pypi
Last synced: 12 months ago
JSON representation
Go client for PyPI REST API
- Host: GitHub
- URL: https://github.com/qba73/gopypi
- Owner: qba73
- License: mit
- Created: 2019-10-08T17:00:54.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-03-30T07:01:36.000Z (over 2 years ago)
- Last Synced: 2025-02-03T12:16:28.815Z (over 1 year ago)
- Topics: go, golang, golang-library, library, pypi
- Language: Go
- Homepage:
- Size: 1.91 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://pkg.go.dev/github.com/qba73/gopypi)
[](https://circleci.com/gh/qba73/gopypi)
[](https://codecov.io/gh/qba73/gopypi)
[](https://goreportcard.com/report/github.com/qba73/gopypi)


`gopypi` is a Go client library for [PyPI](https://pypi.org) REST API.
## How to use it
### As a package in your project
Import package
```go
import "github.com/qba73/gopypi"
func main() {
package, err := gopypi.Get("requests")
if err != nil {
// handle error
}
fmt.Println(package)
}
```
### As a cli tool
Install Go binary
```shell
go install github.com/qba73/gopypi/cmd/pypi@latest
```
or clone the project and build binary:
```shell
go build -o pypi ./cmd/pypi/main.go
```
Run cli:
```shell
pypi requests
```
```shell
{"info":{"name":"requests","classifiers":["Development Status :: 5 - Production/Stable","Environment :: Web Environment","Intended Audience :: Developers","License :: OSI Approved :: Apache Software License","Natural Language :: English","Operating System :: OS Independent","Programming Language :: Python","Programming Language :: Python :: 3","Programming Language :: Python :: 3 :: Only","Programming Language :: Python :: 3.10","Programming Language :: Python :: 3.11","Programming Language :: Python :: 3.7","Programming Language :: Python :: 3.8","Programming Language :: Python :: 3.9","Programming Language :: Python :: Implementation :: CPython","Programming Language :: Python :: Implementation :: PyPy","Topic :: Internet :: WWW/HTTP","Topic :: Software Development :: Libraries"],"license":"Apache 2.0","version":"2.31.0","requires_python":"\u003e=3.7"},"urls":[{"filename":"requests-2.31.0-py3-none-any.whl","package_type":"","python_version":"py3","requires_python":"\u003e=3.7","upload_time":"2023-05-22T15:12:42","url":"https://files.pythonhosted.org/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl"},{"filename":"requests-2.31.0.tar.gz","package_type":"","python_version":"source","requires_python":"\u003e=3.7","upload_time":"2023-05-22T15:12:44","url":"https://files.pythonhosted.org/packages/9d/be/10918a2eac4ae9f02f6cfe6414b7a155ccd8f7f9d4380d62fd5b955065c3/requests-2.31.0.tar.gz"}]}
```
Pipe output to `jq`:
```shell
pypi requests | jq .
```
```shell
{
"info": {
"name": "requests",
"classifiers": [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Software Development :: Libraries"
],
"license": "Apache 2.0",
"version": "2.31.0",
"requires_python": ">=3.7"
},
"urls": [
{
"filename": "requests-2.31.0-py3-none-any.whl",
"package_type": "",
"python_version": "py3",
"requires_python": ">=3.7",
"upload_time": "2023-05-22T15:12:42",
"url": "https://files.pythonhosted.org/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl"
},
{
"filename": "requests-2.31.0.tar.gz",
"package_type": "",
"python_version": "source",
"requires_python": ">=3.7",
"upload_time": "2023-05-22T15:12:44",
"url": "https://files.pythonhosted.org/packages/9d/be/10918a2eac4ae9f02f6cfe6414b7a155ccd8f7f9d4380d62fd5b955065c3/requests-2.31.0.tar.gz"
}
]
}
```