Skip to content

max-planck-innovation-competition/go-patstat

Repository files navigation

Patstat

Go Report Card Go Reference

Updated to Patstat Version Fall 2023

This repository generates the PATSTAT Database using Object Relational Mapping (ORM) and Docker.

This allows for creation of PATSTAT for various databases:

  • MySQL
  • PostgreSQL
  • SQLite

Status

Under development

⚠️ Experimental - Not ready for production.

Author

Sebastian Erhardt

Documentation

The documentation of patstat can be found here .

Environment Variables

SQL_HOST=localhost
SQL_USER=admin
SQL_PASSWORD=password
SQL_DATABASE=patstat
SQL_PORT=5432
SQL_TYPE=POSTGRES

These can be set in a .env file in the root directory.

Deployments

TODO:

Go Module

go get -u github.com/max-planck-innovation-competition/go-patstat

Binary

  1. Download Patstat via EPO Bulk Data Download
  2. Set-Up Database Docker e.g. Postgres docker-compose.yml
  3. Move Patstat Data to Database Folder
  4. Unzip Patstat Data
# unzip part files 
unzip *.zip
# unzip tls files
unzip tls*.zip
  1. Create .env file with following content
SQL_HOST=localhost
SQL_USER=postgres
SQL_PASSWORD=changeme
SQL_PORT=5432
SQL_DATABASE=patstat
SQL_TYPE=POSTGRES
  1. Build the binary
echo BUILD BINARY
export CGO_ENABLED=0
export GOOS=linux
export GOARCH=amd64
go build -o patstat ./cmd/main.go
  1. Run Patstat installation Script
./patstat --mode=install --db=patstat_2023_fall --directory=./ 

Releases

No releases published

Packages

No packages published