Skip to main content

Python package for downloading images and videos from Wikimedia Commons using the Wikimedia API.

Project description

pyWikiCommons

Python package for downloading images and videos from Wikimedia Commons using the Wikimedia API (https://commons.wikimedia.org/w/api.php).

In Development

PyPI

Platforms PythonV License: MIT Build

Issues Size Commits

pyWikiCommonsLogo

Table of Contents

Introduction

pyWikiCommons provides a Python interface for the MediaWiki API [1]. The main purpose of the package is to allow you to download any file/image/video in the Wikipedia/Wikmedia ecosystem using one simple line of code.

The software is currently in its beta stage and only serves its purpose of downloading any file from the Wikimedia database, but there exist an abundance of potential parameters and functionalities of the API that can be exploited moving forward with the software [2].

Requirements

Installation

Install the latest version of pyWikiCommons using pip:

pip3 install pyWikiCommons

Installation from source:

git clone -b master https://github.com/amckenna41/pyWikiCommons.git
python3 setup.py install
cd pyWikiCommons

Usage

Downloading flag of Germany to default output folder:

from pyWikiCommons import pyWikiCommons

pyWikiCommons.download_common_image("File:Flag_of_Germany.svg")

Getting download url of image:

from pyWikiCommons import pyWikiCommons

pyWikiCommons.get_commons_url("File:Flag_of_Germany.svg")

Directories

  • /docs - documentation for pyWikiCommons (pending).
  • /images - all images used throughout the repo.
  • /pyWikiCommons - source code for pyWikiCommons software.
  • /tests - unit and integration tests for pyWikiCommons.

Issues

Any issues, errors or bugs can be raised via the Issues tab in the repository.

Tests

To run all tests, from the main pyWikiCommons repo folder run:

python3 -m unittest discover

To run tests for specific module, from the main pyWikiCommons repo folder run:

python -m unittest tests.MODULE_NAME -v

License

Distributed under the MIT License. See LICENSE for more details.

Contact

If you have any questions or comments, please contact amckenna41@qub.ac.uk or raise an issue on the Issues tab.

LinkedIn

References

[1]: https://www.mediawiki.org/wiki/API:Main_page
[2]: https://commons.wikimedia.org/w/api.php

Back to top

Download files

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

Source Distribution

pyWikiCommons-0.0.5.tar.gz (7.4 kB view details)

Uploaded Source

Built Distributions

pyWikiCommons-0.0.5-py3.8.egg (9.9 kB view details)

Uploaded Source

pyWikiCommons-0.0.5-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file pyWikiCommons-0.0.5.tar.gz.

File metadata

  • Download URL: pyWikiCommons-0.0.5.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.13

File hashes

Hashes for pyWikiCommons-0.0.5.tar.gz
Algorithm Hash digest
SHA256 c5be27a8dfb86431846003f31feceb0d98ea603f8878ab77b3d509c792488f72
MD5 9d3b5b33f13cdbb8ed1f77d412c6b9c0
BLAKE2b-256 3dd7f48f25ae9e684968e78ff5d3fbdc2dab17d387a3a5cfe71422574e76786a

See more details on using hashes here.

File details

Details for the file pyWikiCommons-0.0.5-py3.8.egg.

File metadata

  • Download URL: pyWikiCommons-0.0.5-py3.8.egg
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.13

File hashes

Hashes for pyWikiCommons-0.0.5-py3.8.egg
Algorithm Hash digest
SHA256 538bf4959357dd7a8943622f857950d4e914411ed810165c1a983829c98e2d23
MD5 e1723129e20376e3266f48cd47fc3194
BLAKE2b-256 08db1c6e0b0e2c619777cab76d82d9f58768990215b21e4a06a12433bd7f3b3a

See more details on using hashes here.

File details

Details for the file pyWikiCommons-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for pyWikiCommons-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 2a5767574bd64d8e80601de6a0ebd49e1b6f1e4d559134549e61f84ce3f8862b
MD5 1f25cf10582ad9bd76315b5fd4fbf450
BLAKE2b-256 9d8df25946cb0fb8c6bfd4ec824c3f0987e17619aebe288163982ff56e96a7fe

See more details on using hashes here.

Supported by

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