Skip to main content

madata

PyPI version

madata syncs the metadata of datasets between MADATA (Mannheim Data Repository) and Wikidata. It provides access to the MADATA metadata records directly in Python.

Table of contents

Installation

pip install madata

or

git clone https://github.com/UB-Mannheim/madata
cd madata/
pip install .

Initialization

By initialization madata harvests the MADATA OAI-PMH interface, stores the Dublin Core metadata records in records.OAI_DC and queries the Wikidata SPARQL endpoint for the list of metadata records published at MADATA. Example:

from madata import Metadata
records = Metadata()
print(records)
[('OAI', 'https://madata.bib.uni-mannheim.de/cgi/oai2'),
 ('MADATA records from OAI-PMH', 163),
 ('MADATA records at Wikidata', 1),
 ('In sync?', False)]

Every record rec in the the list records.OAI_DChas the following attributes: rec.metadata (structured metadata record), rec.header (structured header for a metadata record) and rec.raw (raw DC metadata record). The raw header is available via rec.header.raw. Additionally, a pandas-dataframe with metadata records is stored in records.OAI_DC_df.

Syncing

In order to upload the MADATA metadata records to Wikidata, you need an account at Wikidata. If you have an account, use

from madata import Metadata
records = Metadata()
records._sync()
>>> Wikidata username: 
>>> Wikidata password: 

Type your username and password, then madata starts to sync the metadata records at MADATA and Wikidata.

SPARQL queries

The MADATA-subset at Wikidata: https://w.wiki/6s7R.

Metadata

Release files for madata 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for madata 0.2.0
File Size Uploaded
madata-0.2.0.tar.gz 5.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for madata 0.2.0
File Interpreter ABI Platform
madata-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.1 kB

Release files / madata-0.2.0.tar.gz

Download URL madata-0.2.0.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
fcb3a125df905c000400dfb561fab40b3e096f5bbea0d667fad82c76ea6186be
BLAKE2b-256 checksum
How to use checksums
d842330bf0610ba3c52266d132a9234b627aeea5ce79416876c66a86ed9dfe29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.7.6

Release files / madata-0.2.0-py3-none-any.whl

Download URL madata-0.2.0-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f39927d4b75a919aae38e8c7191e961cb00c4181f09afe8ac387a121d3bc0e9c
BLAKE2b-256 checksum
How to use checksums
e9ff687bf5a45d3c94b716badfefd70c1ddb648d642ef45358eed6a231d9a817
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.7.6

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page