limesurvey_parser

A small parser for LimeSurvey generated CSV files.

https://github.com/chillenzer/limesurvey_parser

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.1%) to scientific vocabulary
Last synced: 9 months ago · JSON representation ·

Repository

A small parser for LimeSurvey generated CSV files.

Basic Info
  • Host: GitHub
  • Owner: chillenzer
  • License: mit
  • Language: Python
  • Default Branch: main
  • Size: 94.7 KB
Statistics
  • Stars: 0
  • Watchers: 2
  • Forks: 1
  • Open Issues: 7
  • Releases: 0
Created almost 4 years ago · Last pushed over 1 year ago
Metadata Files
Readme License Citation

README.md

tests Code style: black Imports: isort

limesurvey_parser

A simple parser for LimeSurvey's generated CSV files.

This is a very simple parser that reads a CSV file containing LimeSurvey results and returns a pandas.DataFrame with convenient properties.

Setup

```sh

Install dependencies

pipenv install --dev

Setup pre-commit and pre-push hooks

pipenv run pre-commit install -t pre-commit pipenv run pre-commit install -t pre-push ```

Usage

You want to import the LimeSurveyParser and provide one of its parsing methods with a python string of data, e.g. python3 from limesurvey_parser import LimeSurveyParser parser = LimeSurveyParser() with open('/path/to/file','r') as file: content = file.read() questions = parser.parse_questions(content) questions.T.query("question_id==50") to get the answers to the 50th question. Similarly, you can parse the metadata, i.e. start date, seed, ... python3 metadata = parser.parse_metadata(content) metadata.T.query('title==Date submitted') Please note that pandas seems to be quite reluctant with regards to querying a pandas.MultiIndex in the columns, so I found it to be necessary to transpose before querying.

Credits

This package was created with Cookiecutter and the sourcery-ai/python-best-practices-cookiecutter project template.

Owner

  • Login: chillenzer
  • Kind: user

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: LimeSurvey Parser
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Julian Johannes
    family-names: Lenz
    email: j.j.lenz@swansea.ac.uk
    affiliation: Swansea University
    orcid: 'https://orcid.org/0000-0001-5250-0005'
repository-code: 'https://github.com/chillenzer/limesurvey_parser'
abstract: >-
  A small code for parsing LimeSurvey-generated csv
  files into pandas DataFrames.
keywords:
  - LimeSurvey
  - pandas
  - parsing
license: MIT

GitHub Events

Total
  • Create event: 1
Last Year
  • Create event: 1

Dependencies

.github/workflows/publish-docker.yml actions
  • actions/checkout v2 composite
  • whoan/docker-build-with-cache-action v2 composite
.github/workflows/test.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v1 composite
Dockerfile docker
  • base latest build
  • python 3.10-slim build
Pipfile pypi
  • black ==22.3.0 develop
  • flake8 * develop
  • isort * develop
  • mypy * develop
  • pre-commit * develop
  • pytest * develop
  • pytest-cov * develop
  • pandas *
  • parse *
Pipfile.lock pypi
  • attrs ==21.4.0 develop
  • black ==22.3.0 develop
  • cfgv ==3.3.1 develop
  • click ==8.1.3 develop
  • coverage ==6.4.2 develop
  • distlib ==0.3.5 develop
  • filelock ==3.7.1 develop
  • flake8 ==4.0.1 develop
  • identify ==2.5.2 develop
  • iniconfig ==1.1.1 develop
  • isort ==5.10.1 develop
  • mccabe ==0.6.1 develop
  • mypy ==0.971 develop
  • mypy-extensions ==0.4.3 develop
  • nodeenv ==1.7.0 develop
  • packaging ==21.3 develop
  • pathspec ==0.9.0 develop
  • platformdirs ==2.5.2 develop
  • pluggy ==1.0.0 develop
  • pre-commit ==2.20.0 develop
  • py ==1.11.0 develop
  • pycodestyle ==2.8.0 develop
  • pyflakes ==2.4.0 develop
  • pyparsing ==3.0.9 develop
  • pytest ==7.1.2 develop
  • pytest-cov ==3.0.0 develop
  • pyyaml ==6.0 develop
  • setuptools ==63.2.0 develop
  • six ==1.16.0 develop
  • toml ==0.10.2 develop
  • tomli ==2.0.1 develop
  • typing-extensions ==4.3.0 develop
  • virtualenv ==20.15.1 develop
  • numpy ==1.23.1
  • pandas ==1.4.3
  • parse ==1.19.0
  • python-dateutil ==2.8.2
  • pytz ==2022.1
  • six ==1.16.0