Skip to main content

Atwiki Client Library

Project description

GitHubActions CodeCov PyPi

atwiki-python

atwiki-python is a client library to access @wiki from Python.

This package also includes atwiki-dump command to dump source from @wiki wiki site.

Install

pip install atwiki-python

Requirements

  • Python 2.7 / 3.7 / 3.8 / 3.9 / 3.10

Usage

atwiki-dump Command

Dump source and page name for each page in the wiki site.

atwiki-dump -o /tmp/dump_dir https://w.atwiki.jp/python-client/

Python API

Python API provides access to @wiki features.

from atwiki import *

api = AtWikiAPI(AtWikiURI('https://w.atwiki.jp/python-client/'))

# Show list of tags.
for tag in api.get_tags():
  print(tag)

# Show list of pages.
for page in api.get_list():
  print(page)

# Show list of pages tagged with 'tag01'.
for page in api.get_list('tag01'):
  print(page)

# Show source of page ID 14.
print(api.get_source(14))

# Show results of wiki search.
for result in api.search('test'):
  print(result)

Hints

  • Always use an appropraite interval between requests, or your IP address may get banned. Empirically, 10 seconds of sleep between API call is sufficient.

  • Your application must expect that entries returned from APIs may be duplicate/missing when pages/tags are added/removed during API call. This is because listing requests are internally pagerized and it is costly to guarantee consistency.

  • AtWiki’s specification may change anytime. If you are going to build an automated system, it is encouraged to run test suites included with the installation of this library (python -m unittest discover atwiki) everytime before running your application.

License

MIT License

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

atwiki-python-0.0.7.tar.gz (11.2 kB view details)

Uploaded Source

File details

Details for the file atwiki-python-0.0.7.tar.gz.

File metadata

  • Download URL: atwiki-python-0.0.7.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0

File hashes

Hashes for atwiki-python-0.0.7.tar.gz
Algorithm Hash digest
SHA256 d9eaa88d358e3811396cc72cfbe8028bb1f0ff6cf27d1f22ceef795db19d4b50
MD5 34ab7501642097009dcc20fb0acb06b1
BLAKE2b-256 3bce6999410e548b38e9331f4b533c3dfe2cdcd2af5ad57c372af5d1f8f1488b

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