GithubHelp home page GithubHelp logo

bediniupi / almaset2analytics Goto Github PK

View Code? Open in Web Editor NEW
9.0 1.0 0.0 26 KB

A script to use Alma set or csv file as basis for analysis

License: MIT License

Python 100.00%
python3 alma library-automation obiee analytics university-of-pisa

almaset2analytics's Introduction

Alma-AlmaSet2Analytics

Use an Alma set or list of data in csv file as a basis for Analytics analysis, modifing an exported file with the analysis in XML format adding a IN filter with the data collected. Remember to set a filter "is Prompted" in Analytics to the column you want to convert.

Usage

command:

python almaset2analytics.py [-h] [-s Alma Set ID] [-d] [-f filename.csv]
                            [-c ColumnName] [-o filename.xml]
                            file_analysis.xml

How to use the script (Examples and variations)

  1. to obtain the file_analysis.xml create/modify an analysis adding a filter "is prompted" to the column you want to use (if you want you can add others filters, but only one can be "is prompted" filter type), then go to the "Advanced" tab and copy all xml data in the "Analysis XML" box. Past it into a text file and save it as "file_analysis.xml" or the name you prefer in the same directory of the script
  2. create a set in Alma and copy the set id (example id: 221133)
  3. invoke the command:
python almaset2analytics.py -s 221133 file_analysis.xml -o analysis_modified.xml
  1. In Analytics, go to the analysis created (or create a new empty one if you prefer), go to the "Advanced" tab and delete all the content in the "Analysis XML" box
  2. Open the file analysis_modified.xml and select all and copy, the past it into the "Analysis XML" box
  3. Click on "Apply XML": now the Analysis contain a IN filter with all data collected from set: it is tested for over 40000 items.

Note: the set is retrieved by "retrieve set members" Configuration and Administration API, so you have to obtain and add your institutional api key into the INI section of the script

Variation a

The set data are collected from ID tag, if you want to collect data from Description tag you have to use the -d argument:

3a. invoke the command:

python almaset2analytics.py -s 221133 file_analysis.xml -o analysis_modified.xml -d

Variation b

2b. Export data into a csv file with headers; save it into the same directory of the script (ex., data.csv) and copy the header of the column you want collect data from (ex., "MMS ID")

3b. invoke the command:

python almaset2analytics.py -f data.csv -c "MMS ID" file_analysis.xml -o analysis_modified.xml

Note: if you have a lot of data in the set it's better and faster to use a csv file instead of retrieve set members API method.

Variation c

3c. if you invoke the command without the -o argument the origin xml file will be overwritten:

python almaset2analytics.py -f data.csv -c "MMS ID" file_analysis.xml

5c. Open the file file_analysis.xml, select all and copy, then past it into the "Analysis XML" box

Installation

No installation needed, simply download allmaset2analytics.py in a rw directory.

Prerequisites

  • Python v3 with modules: requests, lxml, argparse, re, csv
  • Alma Ex Libris
  • Analytics (OBIEE)
  • Configuration and Administration API access and key (not needed if you use csv file as data origin)

Authors

  • Nazzareno Bedini - University of Pisa

Why not use Analytics API methods to export Analysis?

In order to avoid the copy/past actions on the Analytics XML tab I've tried to use the Analytics API methods: unfortunally it's not simple to transfer a lot of data via get method, and also splitting the API query calls is not a viable way, I obtained only timeout errors.

References

almaset2analytics's People

Contributors

bediniupi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.