Giter VIP home page Giter VIP logo

comp533_databasescraper's Introduction

SMITHSONIAN to Postgress

Author: Dreycey Albin

Breif Description

This repository contains an automated pipeline for scraping smithsonian OpenAccess metadata and inserting it into postgress. The current pipeline is limited to postgress, but the script has been configured in such a way to allow other databases to maintain the metadata. It was built to dynamically build the database, so if the metadata changes, so does the way the database is built. Below are the instructions for how to run everything in the repo. Everything can essentially be ran with one command once the postgress database has been created.

future features

  • image scraper is in the code, not currently used.
  • ability to make import for other database types

Database Schema

Below is a rough outline of the database schema as it currently stands. There are several metadata warehouses that the smithsonian uses for OpenAccess. Here, these are split into 2 tables each: (1) main; and (2) content. The main table conosist of the primary metadata, and the contect table has more descriptivee metadata, such as location, geolocation, deescriptions, ect.

Database Schema

How to build the database

Build the postgresDB

The first thing you need to do before using the master bash script is build a database. This is the most convienent way to build the database:

Login to psql using:

psql

within the psql command line interface:

CREATE DATABASE smithsoniandb2;

Then quit using:

\q

Executing the master bash script

There is a master script that downloads, builds, and inserts the data into the database you created above. Below is a schematic of the overall master script works. It is currently being extended to work with other databases, but for now it is limited to postgress- though the build is completely automated.

To execute the master script:

bash MakePostgresDB.sh 

This command will take some time to run, especially for downloading and the subsequent parsing that needs to take place. This will create input csv files for each of the metadata directories, and thereafter will create and susbequently execute a bash file running psql commands for building the database.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.