pypi

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SourceAPI is the format string for the PyPi API
	SourceAPI = "https://pypi.python.org/pypi/%s/json"
	// DateFormat is the Time format used by PyPi
	DateFormat = "2006-01-02T15:04:05"
)

Variables

View Source
var TarballRegex = regexp.MustCompile("https?://[^/]*py[^/]*/packages/(?:[^/]+/)+(.+)$")

TarballRegex matches PyPi source tarballs

Functions

func ConvertURLS

func ConvertURLS(cr []URL, name, version string) *results.Result

ConvertURLS translates PyPi URLs to Cuppa results

Types

type Info

type Info struct {
	Version string `json:"version"`
}

Info contains a PyPi Version number

type LatestSource

type LatestSource struct {
	Info Info  `json:"info"`
	URLs []URL `json:"urls"`
}

LatestSource contains a JSON representation of a PyPi Source

func (*LatestSource) Convert

func (cr *LatestSource) Convert(name string) *results.Result

Convert turns a PyPi latest into a Cuppa Result

type Provider

type Provider struct{}

Provider is the upstream provider interface for pypi

func (Provider) Latest

func (c Provider) Latest(name string) (r *results.Result, s results.Status)

Latest finds the newest release for a pypi package

func (Provider) Match

func (c Provider) Match(query string) string

Match checks to see if this provider can handle this kind of query

func (Provider) Name

func (c Provider) Name() string

Name gives the name of this provider

func (Provider) Releases

func (c Provider) Releases(name string) (rs *results.ResultSet, s results.Status)

Releases finds all matching releases for a pypi package

type Releases

type Releases struct {
	Releases map[string][]URL `json:"releases"`
}

Releases holds one or more Source URLs

func (*Releases) Convert

func (crs *Releases) Convert(name string) *results.ResultSet

Convert turns PyPi releases into a Cuppa results set

type URL

type URL struct {
	UploadTime string `json:"upload_time"`
	URL        string `json:"url"`
}

URL contains a JSON representation of a PyPi tarball URL

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL