# BatchIngestion Python Client
This is a Python client library for the [BatchIngestion](https://gitlab.the-qa-company.com/FrozenMink/batchingestionextension) 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](https://pypi.org/project/batch-ingestion-client-py/):
```bash
pip install batch-ingestion-client-py==1.0.4
```
## Usage
```python
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.
Raw data
{
"_id": null,
"home_page": "",
"name": "batch-ingestion-client-py",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "python,mediawiki,batchingestion,wikidata,wikibase,api,client",
"author": "QuentinJanuel",
"author_email": "<quentinjanuelkij@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/de/84/dbafdf4c6ad6c85040a89d799c58e457ae0ec5cfb8397aff90e3713a1729/batch_ingestion_client_py-1.0.4.tar.gz",
"platform": null,
"description": "\n# BatchIngestion Python Client\n\nThis is a Python client library for the [BatchIngestion](https://gitlab.the-qa-company.com/FrozenMink/batchingestionextension) 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.\n\n## Installation\n\nYou can install this library using [pip](https://pypi.org/project/batch-ingestion-client-py/):\n\n```bash\npip install batch-ingestion-client-py==1.0.4\n```\n\n## Usage\n\n```python\nfrom batch_ingestion_client_py import (\n BatchIngestor,\n Entity,\n ValueInLanguage,\n)\n\ningestor = BatchIngestor(\n base_url=\"https://your-wiki.com\",\n username=\"your-username\",\n password=\"your-password\",\n)\n\nexample1 = ingestor.ingest([\n Entity.parse({\n \"type\": \"item\",\n \"labels\": {\n \"en\": {\n \"language\": \"en\",\n \"value\": \"Hello, world!\",\n },\n },\n })\n])\n\nprint(example1)\n\nexample2 = ingestor.ingest([\n Entity(\n type=\"item\",\n labels={\n \"en\": ValueInLanguage(\n language=\"en\",\n value=\"Hello, world!\",\n ),\n },\n ),\n])\n\nprint(example2)\n```\n\n## Contributing\n\nIf you'd like to contribute to this library, please feel free to submit a pull request.\n",
"bugtrack_url": null,
"license": "",
"summary": "A client for the BatchIngestion mediawiki API",
"version": "1.0.4",
"project_urls": null,
"split_keywords": [
"python",
"mediawiki",
"batchingestion",
"wikidata",
"wikibase",
"api",
"client"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0cf38239c04ccd39a09396636127b43adee1f65100cb24a2794c97d2ab1ca21d",
"md5": "95efff5c744bd0c0c9a947fa51861912",
"sha256": "6117419c5c87d7d3af7b3b3722ae4a243bdae61dbb89d8fa7b14261556cfe98e"
},
"downloads": -1,
"filename": "batch_ingestion_client_py-1.0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "95efff5c744bd0c0c9a947fa51861912",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 6583,
"upload_time": "2023-06-08T10:21:02",
"upload_time_iso_8601": "2023-06-08T10:21:02.699115Z",
"url": "https://files.pythonhosted.org/packages/0c/f3/8239c04ccd39a09396636127b43adee1f65100cb24a2794c97d2ab1ca21d/batch_ingestion_client_py-1.0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "de84dbafdf4c6ad6c85040a89d799c58e457ae0ec5cfb8397aff90e3713a1729",
"md5": "a067aba10aae724dfd8e07d0ab0b4907",
"sha256": "8bae326d40a97ac56254dfa926a23d292509a9169549865458f80bf3ee62c825"
},
"downloads": -1,
"filename": "batch_ingestion_client_py-1.0.4.tar.gz",
"has_sig": false,
"md5_digest": "a067aba10aae724dfd8e07d0ab0b4907",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5209,
"upload_time": "2023-06-08T10:21:04",
"upload_time_iso_8601": "2023-06-08T10:21:04.171272Z",
"url": "https://files.pythonhosted.org/packages/de/84/dbafdf4c6ad6c85040a89d799c58e457ae0ec5cfb8397aff90e3713a1729/batch_ingestion_client_py-1.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-08 10:21:04",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "batch-ingestion-client-py"
}