🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

govpkg

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

govpkg

Simple Python client for the pkg.go.dev v1beta API.

pipPyPI
Version
0.2.0
Weekly downloads
0
Maintainers
1
Weekly downloads
 

govpkg

A simple Python client for the official pkg.go.dev v1beta API.

Installation

pip install govpkg

Usage

Search for a package

from govpkg import get

url = get("cobra")
print(url)
# https://pkg.go.dev/github.com/spf13/cobra

Get package metadata

from govpkg import package

pkg = package("github.com/spf13/cobra")
print(pkg)

You can also pass a pkg.go.dev URL:

pkg = package("https://pkg.go.dev/github.com/spf13/cobra")

Get module metadata

from govpkg import module

mod = module("github.com/spf13/cobra")
print(mod)

Or using a pkg.go.dev URL:

mod = module("https://pkg.go.dev/github.com/spf13/cobra")

API

get(query: str) -> str

Searches for a Go package and returns the pkg.go.dev URL of the best match.

package(path: str) -> dict

Returns metadata for a Go package.

module(path: str) -> dict

Returns metadata for the Go module containing the package.

Requirements

  • Python 3.9+
  • requests

License

MIT

Keywords

go

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts