Skip to content

Commit 7ea58a6

Browse files
committed
Sphinx markup fixes
1 parent 8c980ef commit 7ea58a6

File tree

13 files changed

+100
-95
lines changed

13 files changed

+100
-95
lines changed

docs/client/apidocs.rst

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ Client object
99
:undoc-members:
1010
:inherited-members:
1111

12-
1312
Activity
1413
--------
1514

@@ -32,7 +31,6 @@ Exceptions
3231
.. automodule:: scrapinghub.client.exceptions
3332
:members:
3433
:undoc-members:
35-
:inherited-members:
3634

3735
Frontiers
3836
---------
@@ -97,11 +95,3 @@ Spiders
9795
:members:
9896
:undoc-members:
9997
:inherited-members:
100-
101-
Utils
102-
-----
103-
104-
.. automodule:: scrapinghub.client.utils
105-
:members:
106-
:undoc-members:
107-
:inherited-members:

scrapinghub/client/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ class ScrapinghubClient(object):
3131
:param auth: Scrapinghub APIKEY or other SH auth credentials.
3232
:param dash_endpoint: (optional) Scrapinghub Dash panel url.
3333
:param \*\*kwargs: (optional) Additional arguments for
34-
:class:`scrapinghub.hubstorage.HubstorageClient` constructor.
34+
:class:`~scrapinghub.hubstorage.HubstorageClient` constructor.
3535
3636
:ivar projects: projects collection,
37-
:class:`scrapinghub.client.projects.Projects` instance.
37+
:class:`~scrapinghub.client.projects.Projects` instance.
3838
3939
Usage::
4040
@@ -60,7 +60,7 @@ def get_project(self, project_id):
6060
6161
:param project_id: integer or string numeric project id.
6262
:return: a project instance.
63-
:rtype: :class:`scrapinghub.client.projects.Project`
63+
:rtype: :class:`~scrapinghub.client.projects.Project`
6464
6565
Usage::
6666
@@ -76,7 +76,7 @@ def get_job(self, job_key):
7676
:param job_key: job key string in format 'project_id/spider_id/job_id',
7777
where all the components are integers.
7878
:return: a job instance.
79-
:rtype: :class:`scrapinghub.client.jobs.Job`
79+
:rtype: :class:`~scrapinghub.client.jobs.Job`
8080
8181
Usage::
8282

scrapinghub/client/activity.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77
class Activity(_Proxy):
88
"""Representation of collection of job activity events.
99
10-
Not a public constructor: use :class:`Project` instance to get a
11-
:class:`Activity` instance. See :attr:`Project.activity` attribute.
10+
Not a public constructor: use :class:`~scrapinghub.client.projects.Project`
11+
instance to get a :class:`~scrapinghub.client.activity.Activity` instance.
12+
See :attr:`~scrapinghub.client.projects.Project.activity` attribute.
1213
13-
Please note that list() method can use a lot of memory and for a large
14-
amount of activities it's recommended to iterate through it via iter()
14+
Please note that ``list()`` method can use a lot of memory and for a large
15+
amount of activities it's recommended to iterate through it via ``iter()``
1516
method (all params and available filters are same for both methods).
1617
1718
Usage:

scrapinghub/client/collections.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
class Collections(_Proxy):
1414
"""Access to project collections.
1515
16-
Not a public constructor: use :class:`Project` instance to get a
17-
:class:`Collections` instance. See :attr:`Project.collections` attribute.
16+
Not a public constructor: use :class:`~scrapinghub.client.projects.Project`
17+
instance to get a :class:`Collections` instance.
18+
See :attr:`~scrapinghub.client.projects.Project.collections` attribute.
1819
1920
Usage::
2021
@@ -29,7 +30,7 @@ def get(self, type_, name):
2930
3031
:param type_: a collection type string.
3132
:param name: a collection name string.
32-
:return: :class:`Collection` object.
33+
:return: a collection object.
3334
:rtype: :class:`Collection`
3435
"""
3536
self._origin._validate_collection(type_, name)
@@ -39,7 +40,7 @@ def get_store(self, name):
3940
"""Method to get a store collection by name.
4041
4142
:param name: a collection name string.
42-
:return: :class:`Collection` object.
43+
:return: a collection object.
4344
:rtype: :class:`Collection`
4445
"""
4546
return self.get('s', name)
@@ -50,7 +51,7 @@ def get_cached_store(self, name):
5051
The collection type means that items expire after a month.
5152
5253
:param name: a collection name string.
53-
:return: :class:`Collection` object.
54+
:return: a collection object.
5455
:rtype: :class:`Collection`
5556
"""
5657
return self.get('cs', name)
@@ -61,7 +62,7 @@ def get_versioned_store(self, name):
6162
The collection type retains up to 3 copies of each item.
6263
6364
:param name: a collection name string.
64-
:return: :class:`Collection` object.
65+
:return: a collection object.
6566
:rtype: :class:`Collection`
6667
"""
6768
return self.get('vs', name)
@@ -72,7 +73,7 @@ def get_versioned_cached_store(self, name):
7273
Multiple copies are retained, and each one expires after a month.
7374
7475
:param name: a collection name string.
75-
:return: :class:`Collection` object.
76+
:return: a collection object.
7677
:rtype: :class:`Collection`
7778
"""
7879
return self.get('vcs', name)
@@ -159,9 +160,10 @@ def list(self, key=None, prefix=None, prefixcount=None, startts=None,
159160
endts=None, requests_params=None, **params):
160161
"""Convenient shortcut to list iter results.
161162
162-
Please note that list() method can use a lot of memory and for a large
163-
amount of elements it's recommended to iterate through it via iter()
164-
method (all params and available filters are same for both methods).
163+
Please note that ``list()`` method can use a lot of memory and for a
164+
large amount of elements it's recommended to iterate through it via
165+
``iter()`` method (all params and available filters are same for both
166+
methods).
165167
166168
:param key: a string key or a list of keys to filter with.
167169
:param prefix: a string prefix to filter items.
@@ -197,7 +199,7 @@ def set(self, value):
197199
198200
:param value: a dict representing a collection item.
199201
200-
The method returns None (original method returns an empty generator).
202+
The method returns ``None`` (original method returns an empty generator).
201203
"""
202204
self._origin.set(value)
203205

@@ -206,7 +208,7 @@ def delete(self, keys):
206208
207209
:param keys: a single key or a list of keys.
208210
209-
The method returns None (original method returns an empty generator).
211+
The method returns ``None`` (original method returns an empty generator).
210212
"""
211213
if (not isinstance(keys, string_types) and
212214
not isinstance(keys, collections.Iterable)):

scrapinghub/client/frontiers.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def _get_writer(self, frontier, slot):
2222
callback to write newcount data per slot.
2323
2424
:return: a batchuploader writer instance.
25-
:rtype: :class:`scrapinghub.hubstorage.batchuploader._BatchWriter`
25+
:rtype: :class:`~scrapinghub.hubstorage.batchuploader._BatchWriter`
2626
"""
2727
key = (frontier, slot)
2828
writer = self._writers.get(key)
@@ -48,8 +48,9 @@ def _writer_callback(self, key, response):
4848
class Frontiers(_Proxy):
4949
"""Frontiers collection for a project.
5050
51-
Not a public constructor: use :class:`Project` instance to get a
52-
:class:`Frontiers` instance. See :attr:`Project.frontiers` attribute.
51+
Not a public constructor: use :class:`~scrapinghub.client.projects.Project`
52+
instance to get a :class:`Frontiers` instance.
53+
See :attr:`~scrapinghub.client.Project.frontiers` attribute.
5354
5455
Usage:
5556
@@ -89,7 +90,7 @@ def get(self, name):
8990
"""Get a frontier by name.
9091
9192
:param name: a frontier name string.
92-
:return: :class:`Frontier` instance.
93+
:return: a frontier instance.
9394
:rtype: :class:`Frontier`
9495
"""
9596
return Frontier(self._client, self, name)
@@ -160,7 +161,7 @@ def __init__(self, client, frontiers, name):
160161
def get(self, slot):
161162
"""Get a slot by name.
162163
163-
:return: :class:`FrontierSlot` instance.
164+
:return: a frontier slot instance.
164165
:rtype: :class:`FrontierSlot`
165166
"""
166167
return FrontierSlot(self._client, self, slot)
@@ -260,7 +261,7 @@ def __init__(self, client, frontier, slot):
260261
def f(self):
261262
"""Shortcut to have quick access to slot fingerprints.
262263
263-
:return: :class:`FrontierSlotFingerprints` instance.
264+
:return: fingerprints collection for the slot.
264265
:rtype: :class:`FrontierSlotFingerprints`
265266
"""
266267
return self.fingerprints
@@ -269,7 +270,7 @@ def f(self):
269270
def q(self):
270271
"""Shortcut to have quick access to a slot queue.
271272
272-
:return: :class:`FrontierSlotQueue` instance.
273+
:return: queue instance for the slot.
273274
:rtype: :class:`FrontierSlotQueue`
274275
"""
275276
return self.queue

scrapinghub/client/items.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
class Items(_Proxy):
77
"""Representation of collection of job items.
88
9-
Not a public constructor: use :class:`Job` instance to get a :class:`Items`
10-
instance. See :attr:`Job.items` attribute.
9+
Not a public constructor: use :class:`~scrapinghub.client.jobs.Job` instanc
10+
e to get a :class:`Items` instance.
11+
See :attr:`~scrapinghub.client.jobs.Job.items` attribute.
1112
12-
Please note that list() method can use a lot of memory and for a large
13-
amount of items it's recommended to iterate through it via iter() method
13+
Please note that ``list()`` method can use a lot of memory and for a large
14+
amount of items it's recommended to iterate through it via ``iter()`` method
1415
(all params and available filters are same for both methods).
1516
1617
Usage:

scrapinghub/client/jobs.py

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919
class Jobs(object):
2020
"""Class representing a collection of jobs for a project/spider.
2121
22-
Not a public constructor: use :class:`Project` instance or :class:`Spider`
23-
instance to get a :class:`Jobs` instance. See :attr:`Project.jobs` and
24-
:attr:`Spider.jobs` attributes.
22+
Not a public constructor: use :class:`~scrapinghub.client.projects.Project`
23+
instance or :class:`~scrapinghub.client.spiders.Spider` instance to get
24+
a :class:`Jobs` instance. See :attr:`scrapinghub.client.projects.Project.jobs`
25+
and :attr:`scrapinghub.client.spiders.Spider.jobs` attributes.
2526
2627
:ivar project_id: a string project id.
2728
:ivar spider: :class:`Spider` object if defined.
@@ -235,7 +236,7 @@ def get(self, job_key):
235236
:class:`Jobs` instance, and job_key's spider component should match
236237
the spider (if :attr:`Spider.jobs` was used).
237238
238-
:return: :class:`Job` object.
239+
:return: a job object.
239240
:rtype: :class:`Job`
240241
241242
Usage::
@@ -255,8 +256,8 @@ def summary(self, state=None, spider=None, **params):
255256
"""Get jobs summary (optionally by state).
256257
257258
:param state: (optional) a string state to filter jobs.
258-
:param spider: (optional) a spider name
259-
(not needed if instantiated with :class:`Spider`).
259+
:param spider: (optional) a spider name (not needed if instantiated
260+
with :class:`~scrapinghub.client.spiders.Spider`).
260261
:param \*\*params: (optional) additional keyword args.
261262
:return: a list of dictionaries of jobs summary
262263
for a given filter params grouped by job state.
@@ -283,8 +284,8 @@ def iter_last(self, start=None, start_after=None, count=None,
283284
:param start: (optional)
284285
:param start_after: (optional)
285286
:param count: (optional)
286-
:param spider: (optional) a spider name
287-
(not needed if instantiated with :class:`Spider`).
287+
:param spider: (optional) a spider name (not needed if instantiated
288+
with :class:`~scrapinghub.client.spiders.Spider`).
288289
:param \*\*params: (optional) additional keyword args.
289290
:return: a generator object over a list of dictionaries of jobs summary
290291
for a given filter params.
@@ -371,17 +372,18 @@ def update_tags(self, add=None, remove=None, spider=None):
371372
class Job(object):
372373
"""Class representing a job object.
373374
374-
Not a public constructor: use :class:`ScrapinghubClient` instance or
375-
:class:`Jobs` instance to get a :class:`Job` instance. See
376-
:meth:`ScrapinghubClient.get_job` and :meth:`Jobs.get` methods.
375+
Not a public constructor: use :class:`~scrapinghub.client.ScrapinghubClient`
376+
instance or :class:`Jobs` instance to get a :class:`Job` instance. See
377+
:meth:`scrapinghub.client.ScrapinghubClient.get_job` and :meth:`Jobs.get`
378+
methods.
377379
378380
:ivar project_id: integer project id.
379381
:ivar key: a job key.
380-
:ivar items: :class:`Items` resource object.
381-
:ivar logs: :class:`Logs` resource object.
382-
:ivar requests: :class:`Requests` resource object.
383-
:ivar samples: :class:`Samples` resource object.
384-
:ivar metadata: :class:`Metadata` resource.
382+
:ivar items: :class:`~scrapinghub.client.items.Items` resource object.
383+
:ivar logs: :class:`~scrapinghub.client.logs.Logs` resource object.
384+
:ivar requests: :class:`~scrapinghub.client.requests.Requests` resource object.
385+
:ivar samples: :class:`~scrapinghub.client.samples.Samples` resource object.
386+
:ivar metadata: :class:`JobMeta` resource object.
385387
386388
Usage::
387389
@@ -508,7 +510,7 @@ class JobMeta(_MappingProxy):
508510
"""Class representing job metadata.
509511
510512
Not a public constructor: use :class:`Job` instance to get a
511-
:class:`Jobmeta` instance. See :attr:`Job.metadata` attribute.
513+
:class:`JobMeta` instance. See :attr:`Job.metadata` attribute.
512514
513515
Usage:
514516

scrapinghub/client/logs.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
class Logs(_Proxy):
99
"""Representation of collection of job logs.
1010
11-
Not a public constructor: use :class:`Job` instance to get a :class:`Logs`
12-
instance. See :attr:`Job.logs` attribute.
11+
Not a public constructor: use :class:`~scrapinghub.client.jobs.Job` instance
12+
to get a :class:`Logs` instance. See :attr:`~scrapinghub.client.jobs.Job.logs`
13+
attribute.
1314
14-
Please note that list() method can use a lot of memory and for a large
15-
amount of logs it's recommended to iterate through it via iter() method
15+
Please note that ``list()`` method can use a lot of memory and for a large
16+
amount of logs it's recommended to iterate through it via ``iter()`` method
1617
(all params and available filters are same for both methods).
1718
1819
Usage:

scrapinghub/client/projects.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
class Projects(object):
1616
"""Collection of projects available to current user.
1717
18-
Not a public constructor: use :class:`ScrapinghubClient` client instance to get
19-
a :class:`Projects` instance. See :attr:`Scrapinghub.projects` attribute.
18+
Not a public constructor: use :class:`~scrapinghub.client.ScrapinghubClient`
19+
client instance to get a :class:`Projects` instance.
20+
See :attr:`scrapinghub.client.Scrapinghub.projects` attribute.
2021
2122
Usage::
2223
@@ -31,8 +32,8 @@ def get(self, project_id):
3132
"""Get project for a given project id.
3233
3334
:param project_id: integer or string numeric project id.
34-
:return: :class:`Project` object.
35-
:rtype: :class:`scrapinghub.client.projects.Project`
35+
:return: a project object.
36+
:rtype: :class:`Project`
3637
3738
Usage::
3839
@@ -96,17 +97,18 @@ def summary(self, state=None, **params):
9697
class Project(object):
9798
"""Class representing a project object and its resources.
9899
99-
Not a public constructor: use :class:`ScrapinghubClient` instance or
100-
:class:`Projects` instance to get a :class:`Project` instance. See
101-
:meth:`ScrapinghubClient.get_project` or :meth:`Projects.get` methods.
100+
Not a public constructor: use :class:`~scrapinghub.client.ScrapinghubClient`
101+
instance or :class:`Projects` instance to get a :class:`Project` instance.
102+
See :meth:`scrapinghub.client.ScrapinghubClient.get_project` or
103+
:meth:`Projects.get` methods.
102104
103105
:ivar key: string project id.
104-
:ivar activity: :class:`Activity` resource object.
105-
:ivar collections: :class:`Collections` resource object.
106-
:ivar frontiers: :class:`Frontiers` resource object.
107-
:ivar jobs: :class:`Jobs` resource object.
108-
:ivar settings: :class:`Settings` resource object.
109-
:ivar spiders: :class:`Spiders` resource object.
106+
:ivar activity: :class:`~scrapinghub.client.activity.Activity` resource object.
107+
:ivar collections: :class:`~scrapinghub.client.collections.Collections` resource object.
108+
:ivar frontiers: :class:`~scrapinghub.client.frontiers.Frontiers` resource object.
109+
:ivar jobs: :class:`~scrapinghub.client.jobs.Jobs` resource object.
110+
:ivar settings: :class:`~scrapinghub.client.settings.Settings` resource object.
111+
:ivar spiders: :class:`~scrapinghub.client.spiders.Spiders` resource object.
110112
111113
Usage::
112114

0 commit comments

Comments
 (0)