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 / 3.11

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. Each AtWikiAPI instance automatically injects a delay between requests.

  • 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.11.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

atwiki_python-0.0.11-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: atwiki-python-0.0.11.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for atwiki-python-0.0.11.tar.gz
Algorithm Hash digest
SHA256 ee0103b98eb702d4b85c8aa63d33e58cd83eb9d595c2447bc918ac961363384d
MD5 288753698b459156d13dbf29f5060530
BLAKE2b-256 97fadcfa08853f3c15b4ca32b2db1db4b1528134296516e05cc7f8c83bfe28fb

See more details on using hashes here.

File details

Details for the file atwiki_python-0.0.11-py3-none-any.whl.

File metadata

File hashes

Hashes for atwiki_python-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 d35d7982ad19e1fa07be762f4a156100390f8f309811151ad62c7e81adb1f76c
MD5 85d1eda8aedf3cc7c75ce62ad3a50399
BLAKE2b-256 70a667bc73ea20466f171dfa66d3dd7edcff8ed7fb30d9928245ba3cfbb339af

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