Skip to content

Commit 6ff8843

Browse files
author
Paul Hallett
committed
Documentation updated.
1 parent 22c068a commit 6ff8843

6 files changed

Lines changed: 118 additions & 25 deletions

File tree

HISTORY.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
History
44
-------
55

6-
0.0.1 (2013-11-11)
6+
0.0.1 (2013-12-23)
77
++++++++++++++++++
88

9-
* First release on PyPI.
9+
* First release on PyPI.
10+
* All PokeAPI resources fully supported and represented in an object-oriented style.
11+
* Easy-to-use API: just one method!

README.rst

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ Pykemon
88
.. image:: https://travis-ci.org/phalt/pykemon.png?branch=master
99
:target: https://travis-ci.org/phalt/pykemon
1010

11-
.. image:: https://pypip.in/d/pykemon/badge.png
12-
:target: https://crate.io/packages/pykemon?version=latest
13-
1411
A python wrapper for `PokeAPI <http://pokeapi.co>`_
1512

1613
* Free software: BSD license
@@ -39,27 +36,13 @@ Even simpler:
3936
<Pokemon - Bulbasaur>
4037
>>> p = pykemon.get(pokemon_id=1)
4138
<Pokemon - Bulbasaur>
42-
43-
Interact with resources linked to Pokemon easily:
44-
45-
.. code-block:: python
46-
47-
>>> p.moves
48-
['cut', 'tackle', 'vine whip']
49-
>>> p.get_move('cut')
50-
<Move - cut>
51-
52-
Or grab a resource separately:
53-
54-
.. code-block:: python
55-
56-
>>> pykemon.get(move='cut')
39+
>>> pykemon.get(move_id=15)
5740
<Move - cut>
5841
5942
6043
Features
6144
--------
6245

63-
* Generate objects from PokeAPI resources.
46+
* Generate Python objects from PokeAPI resources.
6447

6548
* Human-friendly API

docs/conf.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@
243243
# dir menu entry, description, category)
244244
texinfo_documents = [
245245
('index', 'pykemon', u'Pykemon Documentation',
246-
u'Paul Hallett', 'pykemon', 'One line description of project.',
247-
'Miscellaneous'),
246+
u'Paul Hallett', 'pykemon', 'Python wrapper for PokeAPI.co.',
247+
'Wrapper'),
248248
]
249249

250250
# Documents to append as an appendix to all manuals.
@@ -257,4 +257,6 @@
257257
#texinfo_show_urls = 'footnote'
258258

259259
# If true, do not generate a @detailmenu in the "Top" node's menu.
260-
#texinfo_no_detailmenu = False
260+
#texinfo_no_detailmenu = False
261+
262+
RTD_NEW_THEME = True

docs/modules.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
pykemon
2+
=======
3+
4+
.. toctree::
5+
:maxdepth: 4
6+
7+
pykemon

docs/pykemon.rst

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
pykemon package
2+
===============
3+
4+
Submodules
5+
----------
6+
7+
pykemon.api module
8+
------------------
9+
10+
.. automodule:: pykemon.api
11+
:members:
12+
:undoc-members:
13+
:show-inheritance:
14+
15+
pykemon.exceptions module
16+
-------------------------
17+
18+
.. automodule:: pykemon.exceptions
19+
:members:
20+
:undoc-members:
21+
:show-inheritance:
22+
23+
pykemon.models module
24+
---------------------
25+
26+
.. automodule:: pykemon.models
27+
:members:
28+
:undoc-members:
29+
:show-inheritance:
30+
31+
pykemon.request module
32+
----------------------
33+
34+
.. automodule:: pykemon.request
35+
:members:
36+
:undoc-members:
37+
:show-inheritance:
38+
39+
40+
Module contents
41+
---------------
42+
43+
.. automodule:: pykemon
44+
:members:
45+
:undoc-members:
46+
:show-inheritance:

docs/usage.rst

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,57 @@ Usage
44

55
To use Pykemon in a project::
66

7-
import pykemon
7+
>>> import pykemon
8+
9+
Then you can start grabbing stuff from the API::
10+
11+
>>> pykemon.get(pokemon='mew')
12+
<Pokemon - Mew>
13+
>>> pykemon.get(pokemon_id=1)
14+
<Pokemon - Bulbasaur>
15+
16+
Fully supports all the resources on PokeAPI::
17+
18+
>>> pykemon.get(move_id=15)
19+
<Move - Cut>
20+
>>> pykemon.get(ability_id=1)
21+
<Ability - stench>
22+
23+
Resources that have other abilities linked are displayed as dicts::
24+
25+
>>> p = pykemon.get(pokemon_id=1)
26+
>>> p
27+
<Pokemon - Bulbasaur>
28+
>>> p.evolutions
29+
{'Ivysaur': '/api/v1/pokemon/2/'}
30+
31+
With the resource uri information you can request the linked resources easily.
32+
33+
34+
=====
35+
Options
36+
====
37+
38+
Each resource is accessible, with it's own object-oriented representation.
39+
Every resource can be accessed with the term::
40+
41+
resource_id
42+
43+
Where 'resource' is replaced depending on the resource you want::
44+
45+
pokemon_id
46+
move_id
47+
ability_id
48+
egg_id
49+
type_id
50+
description_id
51+
game_id
52+
sprite_id
53+
54+
The Pokemon resource can also be requested using the name:
55+
56+
>>> pykemon.get(pokemon='rotom')
57+
<Pokemon - Rotom>
58+
59+
Make sure you use lower case strings!
60+

0 commit comments

Comments
 (0)