Skip to main content

A client for the BatchIngestion mediawiki API

Project description

BatchIngestion Python Client

This is a Python client library for the BatchIngestion MediaWiki extension, which provides an API to ingest many entities at once. This library allows you to easily ingest entities in bulk, either by parsing them from JSON or by creating them using Python objects.

Installation

You can install this library using pip:

pip install batch-ingestion-client-py==1.0.4

Usage

from batch_ingestion_client_py import (
    BatchIngestor,
    Entity,
    ValueInLanguage,
)

ingestor = BatchIngestor(
    base_url="https://your-wiki.com",
    username="your-username",
    password="your-password",
)

example1 = ingestor.ingest([
    Entity.parse({
        "type": "item",
        "labels": {
            "en": {
                "language": "en",
                "value": "Hello, world!",
            },
        },
    })
])

print(example1)

example2 = ingestor.ingest([
    Entity(
        type="item",
        labels={
            "en": ValueInLanguage(
                language="en",
                value="Hello, world!",
            ),
        },
    ),
])

print(example2)

Contributing

If you'd like to contribute to this library, please feel free to submit a pull request.

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

batch_ingestion_client_py-1.0.4.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

batch_ingestion_client_py-1.0.4-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file batch_ingestion_client_py-1.0.4.tar.gz.

File metadata

File hashes

Hashes for batch_ingestion_client_py-1.0.4.tar.gz
Algorithm Hash digest
SHA256 8bae326d40a97ac56254dfa926a23d292509a9169549865458f80bf3ee62c825
MD5 a067aba10aae724dfd8e07d0ab0b4907
BLAKE2b-256 de84dbafdf4c6ad6c85040a89d799c58e457ae0ec5cfb8397aff90e3713a1729

See more details on using hashes here.

File details

Details for the file batch_ingestion_client_py-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for batch_ingestion_client_py-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6117419c5c87d7d3af7b3b3722ae4a243bdae61dbb89d8fa7b14261556cfe98e
MD5 95efff5c744bd0c0c9a947fa51861912
BLAKE2b-256 0cf38239c04ccd39a09396636127b43adee1f65100cb24a2794c97d2ab1ca21d

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