Giter Site home page Giter Site logo

okraskaj / cernopendata-client Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cernopendata/cernopendata-client

0.0 1.0 0.0 89 KB

Program used to automatically download files from the CERN Open Data portal.

License: GNU General Public License v3.0

Python 100.00%

cernopendata-client's Introduction

CERN Open Data - Client

About

The CERN Open Data Client is a command line tool used to better facilitate the individual acquisition of files from the CERN Open Data Portal. The tool uses the portal's API to query a given Open Data record and automatically download the files listed on that record. In its current form, the tool can only be used for analysis records like the Higgs-to-four-lepton analysis example, but it should be generalized in the future to work for any type of Open Data portal record.

Usage

To use this command line tool simply run the program from the command line using python as shown below. The program requires the user to provide a CERN Open Data portal record number using the -r flag. The record number of a Open Data portal record is simply found at the end of the URL for that record (e.g. the record number for the Two-lepton/four-lepton analysis example found at http://opendata.cern.ch/record/101 is simply 101.

$ python opendata_analysis_query.py -r 101

The program will then begin querying the provided analysis record and automatically downloading all of the index files listed within the dataset links under the Use With section of the record. The program provides some output informing the user of the completion of all the downloads as well as the name of the directory where these downloads can be found. If the command above runs successfully, you should see something like this:

Getting index files for 'Two-lepton/four-lepton analysis example of CMS 2010 open data'...

Downloaded 1 index files from Electron/Run2010B-Apr21ReReco-v1
Downloaded 1 index files from Mu/Run2010B-Apr21ReReco-v1

Query Complete: Downloaded 2 index files to the folder ./rec101_datasets/

Development Notes

Please see comments within the python script (opendata_analysis_query.py) for detailed descriptions of what the script does.

The script uses the Requests python library to send HTTP requests and verify that each request is ok using the built in raise_for_status() method.

cernopendata-client's People

Contributors

alexmieth avatar

Watchers

 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.