@@ -30,25 +30,26 @@ Installation
30
30
31
31
Stable version - using pip:
32
32
33
- .. code :: bash
33
+ .. code-block :: bash
34
34
35
35
pip install pycaching
36
36
37
37
Dev version - manually from GIT:
38
38
39
- .. code :: bash
39
+ .. code-block :: bash
40
40
41
41
git clone https://github.com/tomasbedrich/pycaching.git
42
- pip install ./pycaching
42
+ cd pycaching
43
+ pip install .
43
44
44
45
Pycaching has following requirements:
45
46
46
47
.. code ::
47
48
48
- Python>=3.4
49
- requests >= 2.8
50
- beautifulsoup4 >= 4.4
51
- geopy>=1.11
49
+ Python>=3.4
50
+ requests>= 2.8
51
+ beautifulsoup4>= 4.4
52
+ geopy>=1.11
52
53
53
54
54
55
Examples
@@ -57,9 +58,9 @@ Examples
57
58
Login
58
59
---------------------------------------------------------------------------------------------------
59
60
60
- Simly call `` pycaching .login` ` method and it will do all things for you.
61
+ Simly call :meth: ` .login ` method and it will do all things for you.
61
62
62
- .. code :: python
63
+ .. code-block :: python
63
64
64
65
import pycaching
65
66
geocaching = pycaching.login(" user" , " pass" )
@@ -69,27 +70,27 @@ If you won't provide an username or password, pycaching will try to load
69
70
parse it as JSON and use the keys ``username `` and ``password `` from that file
70
71
as login credentials.
71
72
72
- .. code :: python
73
+ .. code-block :: python
73
74
74
75
import pycaching
75
76
geocaching = pycaching.login() # assume the .gc_credentials file is presented
76
77
77
78
Load a cache details
78
79
---------------------------------------------------------------------------------------------------
79
80
80
- .. code :: python
81
+ .. code-block :: python
81
82
82
83
cache = geocaching.get_cache(" GC1PAR2" )
83
84
print (cache.name) # cache.load() is automatically called
84
85
print (cache.location) # stored in cache, printed immediately
85
86
86
- This uses lazy loading, so the `` Cache ` ` object is created immediately and the
87
+ This uses lazy loading, so the :class: ` . Cache ` object is created immediately and the
87
88
page is loaded when needed (accessing the name).
88
89
89
90
You can use different method of loading cache details. It will be much faster,
90
91
but it will load less details:
91
92
92
- .. code :: python
93
+ .. code-block :: python
93
94
94
95
cache = geocaching.get_cache(" GC1PAR2" )
95
96
cache.load_quick() # takes a small while
@@ -98,32 +99,32 @@ but it will load less details:
98
99
99
100
You can also load a logbook for cache:
100
101
101
- .. code :: python
102
+ .. code-block :: python
102
103
103
104
for log in cache.load_logbook(limit = 200 ):
104
105
print (log.visited, log.type, log.author, log.text)
105
106
106
107
Or its trackables:
107
108
108
- .. code :: python
109
+ .. code-block :: python
109
110
110
111
for trackable in cache.load_trackables(limit = 5 ):
111
112
print (trackable.name)
112
113
113
114
Post a log to cache
114
115
---------------------------------------------------------------------------------------------------
115
116
116
- .. code :: python
117
+ .. code-block :: python
117
118
118
119
geocaching.post_log(" GC1PAR2" , " Found cache in the rain. Nice place, TFTC!" )
119
120
120
- It is also possible to call post_log on `` Cache ` ` object, but you would have
121
- to create `` Log ` ` object manually and pass it to this method.
121
+ It is also possible to call post_log on :class: ` . Cache ` object, but you would have
122
+ to create :class: ` . Log ` object manually and pass it to this method.
122
123
123
124
Search for all traditional caches around
124
125
---------------------------------------------------------------------------------------------------
125
126
126
- .. code :: python
127
+ .. code-block :: python
127
128
128
129
from pycaching import Point
129
130
from pycaching.cache import Type
@@ -134,14 +135,14 @@ Search for all traditional caches around
134
135
if cache.type == Type.traditional:
135
136
print (cache.name)
136
137
137
- Notice the ``limit `` in search function. It is because `` search() ` `
138
+ Notice the ``limit `` in search function. It is because :meth: ` .Geocaching. search `
138
139
returns a generator object, which would fetch the caches forever in case
139
140
of simple loop.
140
141
141
142
Geocode adress and search around
142
143
---------------------------------------------------------------------------------------------------
143
144
144
- .. code :: python
145
+ .. code-block :: python
145
146
146
147
point = geocaching.geocode(" Prague" )
147
148
@@ -151,7 +152,7 @@ Geocode adress and search around
151
152
Find caches with their approximate locations in some area
152
153
---------------------------------------------------------------------------------------------------
153
154
154
- .. code :: python
155
+ .. code-block :: python
155
156
156
157
from pycaching import Point, Rectangle
157
158
@@ -164,7 +165,7 @@ Find caches with their approximate locations in some area
164
165
Load a trackable details
165
166
---------------------------------------------------------------------------------------------------
166
167
167
- .. code :: python
168
+ .. code-block :: python
168
169
169
170
trackable = geocaching.get_trackable(" TB3ZGT2" )
170
171
print (trackable.name, trackable.goal, trackable.description, trackable.location)
0 commit comments