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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file batch_ingestion_client_py-1.0.4.tar.gz.
File metadata
- Download URL: batch_ingestion_client_py-1.0.4.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8bae326d40a97ac56254dfa926a23d292509a9169549865458f80bf3ee62c825
|
|
| MD5 |
a067aba10aae724dfd8e07d0ab0b4907
|
|
| BLAKE2b-256 |
de84dbafdf4c6ad6c85040a89d799c58e457ae0ec5cfb8397aff90e3713a1729
|
File details
Details for the file batch_ingestion_client_py-1.0.4-py3-none-any.whl.
File metadata
- Download URL: batch_ingestion_client_py-1.0.4-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6117419c5c87d7d3af7b3b3722ae4a243bdae61dbb89d8fa7b14261556cfe98e
|
|
| MD5 |
95efff5c744bd0c0c9a947fa51861912
|
|
| BLAKE2b-256 |
0cf38239c04ccd39a09396636127b43adee1f65100cb24a2794c97d2ab1ca21d
|