Code Monkey home page Code Monkey logo

vademecum-export's Introduction

vademecum-export

Web scraper to export drug data into CSV files.

This program scans the Vademecum.es website to obtain a list of all the drugs.

If you don't want to run the program by yourself, you can check the drug list file here.

The resulting CSV file stores the drug name, the national code (Código Nacional) and the URL to access the drug data from vademecum.es.

Sample of the CSV file data:

National Code Name URL
614537 A.A.S. Comp. 100 mg http://vademecum.es/medicamento-a.a.s._ficha_1
686580 A.A.S. Comp. 100 mg http://vademecum.es/medicamento-a.a.s._ficha_1
614560 A.A.S. Comp. 500 mg http://vademecum.es/medicamento-a.a.s._ficha_2
672905 A.A.S. Comp. 500 mg http://vademecum.es/medicamento-a.a.s._ficha_2
712249 ABACAVIR/LAMIVUDINA MYLAN Comp. recub. con película 600 mg/300 mg http://vademecum.es/medicamento-abacavir%2Flamivudina+mylan_45299

Requirements

To run this program the following software is required:

  • git
  • python 2.7
  • pip
  • virtualenv (recommended)

Install

To install this program in your computer run the following commands in your terminal:

git clone https://github.com/jvilaplana/vademecum-export.git
cd vademecum-export
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
deactivate

Now the program should be ready to be executed.

Run

To execute the program run the following commands in your terminal:

source venv/bin/activate
python vademecum_export.py

If the executing is successful, you should see something like:

$ python vademecum_export.py

Going for letter a
	Getting drug 614537 (a-1)
	Getting drug 686580 (a-1)
	Getting drug 614560 (a-2)
	Getting drug 672905 (a-2)
	Getting drug 712249 (a-3)
  ...

Analyze results

To check how many drugs were successfully retrieved run:

cd results/
find . -name 'vademecum-*' | xargs wc -l

To combine all the CSV files into a single one run:

cd results/
cat vademecum-* > vademecum.csv

vademecum-export's People

Contributors

jvilaplana avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.