Python Library for WaniKani
Project description
Crabigator
==========
[![Build Status](https://travis-ci.org/jonesinator/crabigator.svg)](https://travis-ci.org/jonesinator/crabigator) ![License](https://img.shields.io/github/license/jonesinator/crabigator.svg) [![Coverage Status](https://coveralls.io/repos/jonesinator/crabigator/badge.svg?branch=master&service=github)](https://coveralls.io/github/jonesinator/crabigator?branch=master) [![PyPI version](https://badge.fury.io/py/crabigator.svg)](http://badge.fury.io/py/crabigator)
A very thin Python wrapper over the [WaniKani
API](https://www.wanikani.com/api) (WaniKani is a tool for leaning Japanese
vocabulary). The aim is to model the API as closely as possible while ensuring
the correct Python type is used for each field in the API. The syntax for using
the library has been made as simple as possible.
Installation
------------
### Stable Versions
To install for all users `sudo pip install crabigator`
To install for a single user `pip install --user crabigator`
### Development Versions
First clone this repository and cd to it.
To install for all users `sudo python setup.py install`
To install for a single user `python setup.py --user install`
Usage
-----
1. Import the WaniKani class. `from crabigator.wanikani import WaniKani`
2. Instantiate a WaniKani instance with your API key.
`wanikani = WaniKani('my_api_key')`
3. Get any endpoint specified by the API docs (dashes replaced with
underscores).
* `wanikani.user_information`
* `wanikani.study_queue`
* `wanikani.level_progression`
* `wanikani.srs_distribution`
* `wanikani.recent_unlocks`
* `wanikani.critical_items`
* `wanikani.radicals`
* `wanikani.kanji`
* `wanikani.vocabulary`
4. From any of the above endpoints in #3 the output fields in the
required-information key can be retrieved. For example:
* `print(wanikani.user_information.username)`
* `print(wanikani.study_queue.next_review_date)`
* `print(wanikani.level_progression.kanji_total)`
* `print(wanikani.srs_distribution.master.total)`
* `print(wanikani.recent_unlocks[0])`
* `print(wanikani.critical_items[0])`
* `print(wanikani.radicals[0])`
* `print(wanikani.kanji[0])`
* `print(wanikani.vocabulary[0])`
5. If you need to pass arguments to the API then the following functions will
do that.
* `wanikani.get_recent_unlocks(limit=10)`
* `wanikani.get_critical_items(percent=75)`
* `wanikani.get_radicals(levels=[2,3,4])`
* `wanikani.get_kanji(levels=[5,6,7])`
* `wanikani.get_vocabulary(levels=[8,9,10])`
Notes
-----
* Everything is a property of a Python object.
* All API responses can be easily printed for debugging.
* All dates in API responses are converted to datetime objects.
* All comma-separated lists in API responses are converted to arrays of strings
for easier iteration over multiple readings and meanings.
==========
[![Build Status](https://travis-ci.org/jonesinator/crabigator.svg)](https://travis-ci.org/jonesinator/crabigator) ![License](https://img.shields.io/github/license/jonesinator/crabigator.svg) [![Coverage Status](https://coveralls.io/repos/jonesinator/crabigator/badge.svg?branch=master&service=github)](https://coveralls.io/github/jonesinator/crabigator?branch=master) [![PyPI version](https://badge.fury.io/py/crabigator.svg)](http://badge.fury.io/py/crabigator)
A very thin Python wrapper over the [WaniKani
API](https://www.wanikani.com/api) (WaniKani is a tool for leaning Japanese
vocabulary). The aim is to model the API as closely as possible while ensuring
the correct Python type is used for each field in the API. The syntax for using
the library has been made as simple as possible.
Installation
------------
### Stable Versions
To install for all users `sudo pip install crabigator`
To install for a single user `pip install --user crabigator`
### Development Versions
First clone this repository and cd to it.
To install for all users `sudo python setup.py install`
To install for a single user `python setup.py --user install`
Usage
-----
1. Import the WaniKani class. `from crabigator.wanikani import WaniKani`
2. Instantiate a WaniKani instance with your API key.
`wanikani = WaniKani('my_api_key')`
3. Get any endpoint specified by the API docs (dashes replaced with
underscores).
* `wanikani.user_information`
* `wanikani.study_queue`
* `wanikani.level_progression`
* `wanikani.srs_distribution`
* `wanikani.recent_unlocks`
* `wanikani.critical_items`
* `wanikani.radicals`
* `wanikani.kanji`
* `wanikani.vocabulary`
4. From any of the above endpoints in #3 the output fields in the
required-information key can be retrieved. For example:
* `print(wanikani.user_information.username)`
* `print(wanikani.study_queue.next_review_date)`
* `print(wanikani.level_progression.kanji_total)`
* `print(wanikani.srs_distribution.master.total)`
* `print(wanikani.recent_unlocks[0])`
* `print(wanikani.critical_items[0])`
* `print(wanikani.radicals[0])`
* `print(wanikani.kanji[0])`
* `print(wanikani.vocabulary[0])`
5. If you need to pass arguments to the API then the following functions will
do that.
* `wanikani.get_recent_unlocks(limit=10)`
* `wanikani.get_critical_items(percent=75)`
* `wanikani.get_radicals(levels=[2,3,4])`
* `wanikani.get_kanji(levels=[5,6,7])`
* `wanikani.get_vocabulary(levels=[8,9,10])`
Notes
-----
* Everything is a property of a Python object.
* All API responses can be easily printed for debugging.
* All dates in API responses are converted to datetime objects.
* All comma-separated lists in API responses are converted to arrays of strings
for easier iteration over multiple readings and meanings.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
crabigator-0.1.5.tar.gz
(6.7 kB
view hashes)
Built Distribution
Close
Hashes for crabigator-0.1.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 610cb81bc2f930dfbbdadbc5107ac5192a75b08ff8ca8e38172f2ebc41c1ef14 |
|
MD5 | a190dade4143350b03ca2f937064ee42 |
|
BLAKE2b-256 | 05bd21f92692a836a9cf76c6248f92ad8f102c31a21548f928ea3f0a9371483f |