Skip to main content

Utilities for extracting XML, HTML, CSV, XLSX, and RDF data with a common interface

Project description

I-analyzer Readers

Python package Documentation Status

ianalyzer-readers is a python module to extract data from XML, HTML, CSV, JSON, XLSX or RDF (Linked Data) files.

This module was originally created for I-analyzer, a web application that extracts data from a variety of datasets, indexes them and presents a search interface. To do this, we wanted a way to extract data from source files without having to write a new script "from scratch" for each dataset, and an API that would work the same regardless of the source file type.

The basic usage is that you will use the utilities in this package to create a "reader" class. You specify what your data looks like, and then call the documents() method of the reader to get an iterator of documents - where each document is a flat dictionary of key/value pairs.

Prerequisites

Requires Python 3.9 or later.

Contents

ianalyzer_readers contains the source code for the package. tests contains unit tests.

When to use this package

This package is not a replacement for more general-purpose libraries like csv or Beautiful Soup - it is a high-level interface on top of those libraries.

Our primary use for this package is to pre-process data for I-analyzer, but you may find other uses for it.

Using this package makes sense if you want to extract data in the shape that it is designed for (i.e., a list of flat dictionaries).

What we find especially useful is that all subclasses of Reader have the same interface - regardless of whether they are processing CSV, JSON, XML, HTML, RDF or XLSX data. That common interface is crucial in an application that needs to process corpora from different source types, like I-analyzer.

Usage

Typical usage of this package would be to make a custom Python class for a dataset from which you want to extract a list of documents. We call this a Reader. This package provides the base classes to structure readers, and provides extraction utilities for several file types.

For detailed usage documention and examples, visit ianalyzer-readers.readthedocs.io

If this site is unavailable, you can also generate the documentation site locally; see the contributing guide for insttructions.

Licence

This code is shared under an MIT licence. See LICENSE for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ianalyzer_readers-0.3.0.tar.gz (23.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ianalyzer_readers-0.3.0-py3-none-any.whl (25.6 kB view details)

Uploaded Python 3

File details

Details for the file ianalyzer_readers-0.3.0.tar.gz.

File metadata

  • Download URL: ianalyzer_readers-0.3.0.tar.gz
  • Upload date:
  • Size: 23.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for ianalyzer_readers-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d7040c4c70cc5e544290dc7a0a9eb259777bd2601900b4af78cf6f5e9063b70b
MD5 d01f944b8479792d2efdd983f1b70bcc
BLAKE2b-256 7b3fe7edcdab0ab985602363e49dd3a36479895f71a2bbf0de923ac2b2a2e71f

See more details on using hashes here.

File details

Details for the file ianalyzer_readers-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ianalyzer_readers-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2bfe9a89b13c826b7d0e6a47697aa2d4e419ba5f070886d3169934ada6c3a6a5
MD5 ba3f5569c1b0ab7a0f70ea0ed9b57e32
BLAKE2b-256 8e273f46c219a79d84ef928aa51ba5f351adfce6d19eb6c52c01fc4c19dfa57e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page