Giter Site home page Giter Site logo

pbsqlite's Introduction

pbsqlite - Import Australian PBS data into an SQLite database

pbs: hey here is our database as some text files

developers: ok cool we can turn that into a database

pbs: uh all the files use different delimiters though

dev: well maybe you could tidy it up, a bunch of them change delimiters halfway through?

pbs: no but here it is as a giant XML document

dev: ok? we'll just keep using the text files though, but any chance the number of columns in the header could match the file?

pbs: now here it is as some more complicated XML ๐Ÿ™ƒ

dev: I mean sure, but we'll still just use the text files, unless you want to give us a database directly?

pbs: no but we will write an API to send the tables over JSON ๐Ÿ™ƒ๐Ÿ™ƒ๐Ÿ™ƒ

dev: well that just sounds like CSV with extra steps

You just want to be able to SELECT a drug? You can use these scripts to get an SQLite database from the PBS data. Text extracts are supported at present, with API integration planned.

The data model is largely to what comes out of the text extracts. Some examples are included, or you can transform it into something more complex.

SQLite creates automatic indexes for common queries, and the dataset is so small that most queries should complete in tens of milliseconds.

Usage

  1. Download the text extract Zip file for the month (eg 2021-05-01-v3extracts.zip).
  2. Run ./import-text.py 2021-05-01-v3extracts.zip.
  3. Use your new pbs-20210501.sqlite3 database with the world's most popular database software.

License

Licensed under the MIT license; see LICENSE.txt for more.

Author

David Adam (https://github.com/zanchey) wrote this, because anything is better than parsing XML.

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.