uspto

package
v0.0.0-...-e6bcdf8 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ENDPOINT_HOST is the host of https endpoint of the uspto
	ENDPOINT_HOST = "https://developer.uspto.gov"
)

Variables

View Source
var ErrCanNotFindParser = errors.New("can not find parser for this document")
View Source
var ErrEmptyDocumentNumber = errors.New("empty document number")
View Source
var ErrEmptyKind = errors.New("empty kind")
View Source
var ErrEmptyPublicationDate = errors.New("empty publication date")
View Source
var ErrFileIsNoZip = errors.New("file is not zip")
View Source
var ErrNoFilenameInUrl = errors.New("no filename in url")

Functions

func DownloadBulkFile

func DownloadBulkFile(url string, exportDirectory string) (filePath string, err error)

func GenerateAliases

func GenerateAliases(documentNumber, kind string, publicationDate time.Time) (aliases []string, err error)

GenerateAliases generates alternative ids base on the information in the patent usually it is the document number as well as the kind and the year sometimes leading zeros are removed ############################################################################# Applications 0061044 -> US 2009 0061044 A1: with the year and the kind US 3904033 A: without year ############################################################################# Grants 9265015 -> US 9265015 B2: without year US 9265015: without kind ############################################################################# Examples for real document number values 06335824 | B1 US 20010000059 | A1 US 20140001198 | A1 US 20140001198 | A1 US 20130334279 | A1 US ############################################################################# Examples for identifiers that must match US2013034018A1

func GetPatentApplicationXmlBulkFileList

func GetPatentApplicationXmlBulkFileList(start time.Time, end time.Time) (downloadLinks []string, err error)

GetPatentApplicationXmlBulkFileList returns the download links to the zipped archives between two dates of patent applications

func GetPatentGrantXmlBulkFileList

func GetPatentGrantXmlBulkFileList(start time.Time, end time.Time) (downloadLinks []string, err error)

GetPatentGrantXmlBulkFileList returns the download links to the zipped archives between two dates of patent grants

func NewHttpClient

func NewHttpClient() http.Client

NewHttpClient builds a http client if the env variables PROXY or HTTP_PROXY are set the http client uses these

func ProcessBulkFile

func ProcessBulkFile(sourceFile, destinationFolder string) (err error)

ProcessBulkFile processes a uspto zip file

Types

type Abstract

type Abstract struct {
	Text     string
	Language string
}

type BulkFileResponse

type BulkFileResponse struct {
	ProductLinkPath   string      `json:"productLinkPath"`
	ProductIdentifier int         `json:"productIdentifier"`
	ProductShortName  string      `json:"productShortName"`
	ProductDesc       string      `json:"productDesc"`
	ProductTitle      string      `json:"productTitle"`
	ProductFrequency  string      `json:"productFrequency"`
	ProductLevel      string      `json:"productLevel"`
	ProductFromDate   string      `json:"productFromDate"`
	ProductToDate     string      `json:"productToDate"`
	NumberOfFiles     int         `json:"numberOfFiles"`
	ParentProduct     interface{} `json:"parentProduct"`
	ProductFiles      []struct {
		FileLinkPath    string `json:"fileLinkPath"`
		FileIdentifier  int    `json:"fileIdentifier"`
		FileName        string `json:"fileName"`
		FileSize        int    `json:"fileSize"`
		FileDownloadURL string `json:"fileDownloadUrl"`
		FileFromTime    string `json:"fileFromTime"`
		FileToTime      string `json:"fileToTime"`
		FileType        string `json:"fileType"`
		FileReleaseDate string `json:"fileReleaseDate"`
	} `json:"productFiles"`
}

func GetBulkFileList

func GetBulkFileList(product Product, start time.Time, end time.Time) (res BulkFileResponse, err error)

GetBulkFileList returns a list of available files of a specific USPTO product

type Citation

type Citation struct {
	Country   Country
	DocNumber string
	Kind      string
}

type Claim

type Claim struct {
	Text     string
	Language string
	Id       string
}

type ClassificationItem

type ClassificationItem struct {
	System                 ClassificationSystem // cpc, ipc
	Text                   string
	Sequence               int
	Section                string
	Class                  string
	SubClass               string
	MainGroup              string
	SubGroup               string
	Version                string
	ClassificationLevel    string
	FirstLater             string // F=first or L=later
	ClassificationValue    string // (inventive or non-inventive)
	ActionDate             string // (inventive or non-inventive)
	OriginalOrReclassified string
	Source                 string
	GeneratingOffice       string
}

func NewClassificationItemFromString

func NewClassificationItemFromString(text string, sequence int) (c ClassificationItem)

type ClassificationSystem

type ClassificationSystem string
const CPC ClassificationSystem = "CPC"
const IPC ClassificationSystem = "IPC"
const US ClassificationSystem = "US" // US Classification

type Country

type Country string

type Description

type Description struct {
	Text     string
	Language string
}

type Inventor

type Inventor struct {
	Country Country
	City    string
	Street  string
	Name    string
	// USPTO
	// FirsName string # here was a typo, should be FirstName
	FirstName string
	LastName  string
	State     string
}

type Owner

type Owner struct {
	Country Country
	IID     string
	IRF     string
	City    string
	Street  string
	Name    string
}

type Product

type Product string
const (
	XmlPatentGrantsOnlyXML       Product = "PTGRXML"
	XmlPatentApplicationsOnlyXML Product = "APPXML"
)

type Representative

type Representative struct {
	Country Country
	IID     string
	City    string
	Street  string
	Name    string
}

type Title

type Title struct {
	Text     string
	Language string
}

type UsptoPatentDocumentSimple

type UsptoPatentDocumentSimple struct {
	ID                string
	Aliases           []string
	File              string
	Lang              string
	Country           Country
	DocNumber         string
	Kind              string
	DatePubl          time.Time
	Status            string
	DtdVersion        string
	Title             []Title
	Abstract          []Abstract
	Claims            []Claim
	Description       []Description
	Citations         []Citation
	Inventors         []Inventor
	Owners            []Owner
	Representatives   []Representative
	ContractingStates []Country
	Classifications   []ClassificationItem
	// USPTO
	FieldOfSearch []ClassificationItem
}

func ProcessApplicationXML15Simple

func ProcessApplicationXML15Simple(doc *goquery.Document) (patentDoc UsptoPatentDocumentSimple, err error)

func ProcessApplicationXML40Simple

func ProcessApplicationXML40Simple(doc *goquery.Document) (patentDoc UsptoPatentDocumentSimple, err error)

func ProcessApplicationXML4Simple

func ProcessApplicationXML4Simple(doc *goquery.Document) (patentDoc UsptoPatentDocumentSimple, err error)

func ProcessGrantXML4Simple

func ProcessGrantXML4Simple(doc *goquery.Document) (patentDoc UsptoPatentDocumentSimple, err error)

func ProcessXML2Simple

func ProcessXML2Simple(doc *goquery.Document) (patentDoc UsptoPatentDocumentSimple, err error)

func ProcessXMLFileSimple

func ProcessXMLFileSimple(filePath string) (patentDoc UsptoPatentDocumentSimple, err error)

func ProcessXMLSimple

func ProcessXMLSimple(raw []byte) (patentDoc UsptoPatentDocumentSimple, err error)

ProcessXMLSimple transforms the raw response of the xml data into a simple patent

func (*UsptoPatentDocumentSimple) GenerateAliases

func (p *UsptoPatentDocumentSimple) GenerateAliases()

Jump to

Keyboard shortcuts

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