Skip to content

Commit fc38119

Browse files
committed
Minor improvements for the docs
1 parent 229e0f0 commit fc38119

File tree

4 files changed

+51
-19
lines changed

4 files changed

+51
-19
lines changed

docs/client/overview.rst

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ And select a particular project to work with::
4444
>>> project.key
4545
'123'
4646

47-
The above is a shortcut for ``client.projects.get(123)``.
47+
.. tip:: The above is a shortcut for ``client.projects.get(123)``.
4848

4949
Project
5050
-------
@@ -60,13 +60,15 @@ For example, to schedule a spider run (it returns a job object)::
6060

6161
Project instance also has the following fields:
6262

63-
- activity - access to project activity records
64-
- collections - work with project collections (see ``Collections`` section)
65-
- frontiers - using project frontier (see ``Frontiers`` section)
66-
- settings - interface to project settings
67-
- spiders - access to spiders collection (see ``Spiders`` section)
63+
- **activity** - access to :ref:`project activity <project-activity>` records
64+
- **collections** - work with :ref:`project collections <project-collections>`
65+
- **frontiers** - using :ref:`project frontiers <project-frontiers>`
66+
- **settings** - interface to :ref:`project settings <project-settings>`
67+
- **spiders** - access to :ref:`spiders collection <project-spiders>`
6868

6969

70+
.. _project-settings:
71+
7072
Settings
7173
--------
7274

@@ -89,6 +91,7 @@ Or update a few project settings at once::
8991
>>> project.settings.update({'default_job_units': 1,
9092
... 'job_runtime_limit': 20})
9193

94+
.. _project-spiders:
9295

9396
Spiders
9497
-------
@@ -111,6 +114,8 @@ To select a particular spider to work with::
111114
>>> spider.name
112115
spider2
113116

117+
.. _spider:
118+
114119
Spider
115120
------
116121

@@ -123,6 +128,8 @@ To schedule a spider run::
123128

124129
Note that you don't need to specify spider name explicitly.
125130

131+
.. _jobs:
132+
126133
Jobs
127134
----
128135

@@ -299,6 +306,8 @@ To delete a job::
299306

300307
>>> job.delete()
301308

309+
.. _job-metadata:
310+
302311
Metadata
303312
^^^^^^^^
304313

@@ -324,6 +333,8 @@ Anything can be stored in metadata, here is example how to add tags::
324333

325334
>>> job.metadata.set('tags', ['obsolete'])
326335

336+
.. _job-items:
337+
327338
Items
328339
^^^^^
329340

@@ -332,6 +343,8 @@ To retrieve all scraped items from a job::
332343
>>> for item in job.items.iter():
333344
... # do something with item (it's just a dict)
334345

346+
.. _job-logs:
347+
335348
Logs
336349
^^^^
337350

@@ -346,6 +359,8 @@ To retrieve all log entries from a job::
346359
'time': 1482233733976},
347360
}
348361

362+
.. _job-requests:
363+
349364
Requests
350365
^^^^^^^^
351366

@@ -364,6 +379,8 @@ To retrieve all requests from a job::
364379
'url': 'https://example.com'
365380
}]
366381

382+
.. _job-samples:
383+
367384
Samples
368385
^^^^^^^
369386

@@ -374,6 +391,7 @@ To retrieve all samples for a job::
374391
>>> sample
375392
[1482233732452, 0, 0, 0, 0, 0]
376393

394+
.. _project-activity:
377395

378396
Activity
379397
--------
@@ -401,6 +419,8 @@ Or post multiple events at once::
401419
>>> project.activity.add(events)
402420

403421

422+
.. _project-collections:
423+
404424
Collections
405425
-----------
406426

@@ -427,6 +447,8 @@ Usual workflow with `Collections`_ would be::
427447

428448
Collections are available on project level only.
429449

450+
.. _project-frontiers:
451+
430452
Frontiers
431453
---------
432454

@@ -526,6 +548,8 @@ Close batch writers of all frontiers of a project::
526548

527549
Frontiers are available on project level only.
528550

551+
.. _job-tags:
552+
529553
Tags
530554
----
531555

@@ -552,7 +576,7 @@ Exceptions
552576
scrapinghub.exceptions.ScrapinghubAPIError
553577
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
554578

555-
Base exception class.
579+
Base exception class for all other exceptions listed below.
556580

557581

558582
scrapinghub.exceptions.BadRequest

docs/legacy/connection.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
scrapinghub.legacy.Connection
2-
=============================
1+
scrapinghub.Connection
2+
======================
33

4-
TODO add short description & deprecation message here!
4+
The module is the very first Python library for communicating with the Scrapinghub API.
5+
6+
[WARNING] It is deprecated, please use `scrapinghub.ScrapinghubClient`_ instead.
57

68
Overview
79
--------
@@ -106,3 +108,6 @@ Module contents
106108
:members:
107109
:undoc-members:
108110
:show-inheritance:
111+
112+
113+
.. _scrapinghub.ScrapinghubClient: ../client/overview.html

docs/legacy/hubstorage.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
scrapinghub.hubstorage.HubstorageClient
2-
=======================================
1+
scrapinghub.HubstorageClient
2+
============================
33

4-
TODO add short description & deprecation message here!
4+
The library can be used for interaction with spiders, jobs and scraped data through ``storage.scrapinghub.com`` endpoints.
55

6-
7-
The library can also be used for interaction with spiders, jobs and scraped data through ``storage.scrapinghub.com`` endpoints.
6+
[WARNING] It is deprecated, please use `scrapinghub.ScrapinghubClient`_ instead.
87

98

109
Overview
@@ -246,3 +245,5 @@ Module contents
246245
:members:
247246
:undoc-members:
248247
:show-inheritance:
248+
249+
.. _scrapinghub.ScrapinghubClient: ../client/overview.html

docs/quickstart.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The quick way::
1414

1515
pip install scrapinghub
1616

17-
You can also install the library with MessagePack support, it provides better
17+
You can also install the library with `MessagePack`_ support, it provides better
1818
response time and improved bandwidth usage::
1919

2020
pip install scrapinghub[msgpack]
@@ -50,13 +50,13 @@ Access your jobs data::
5050
'size': 35000,
5151
}
5252

53-
Many more feature are awaiting for you.
53+
Many more features `are awaiting`_ for you.
5454

5555

5656
Tests
5757
-----
5858

59-
The package is covered with integration tests based on `VCR.py library`_: there
59+
The package is covered with integration tests based on `VCR.py`_ library: there
6060
are recorded cassettes files in ``tests/*/cassettes`` used instead of HTTP
6161
requests to real services, it helps to simplify and speed up development.
6262

@@ -80,4 +80,6 @@ If you want to update/recreate all the cassettes from scratch, please use::
8080
Note that internally the above command erases the whole folder with cassettes.
8181

8282

83-
.. _VCR.py library: https://pypi.python.org/pypi/vcrpy
83+
.. _MessagePack: https://en.wikipedia.org/wiki/MessagePack
84+
.. _are awaiting: client/overview.html
85+
.. _VCR.py: https://pypi.python.org/pypi/vcrpy

0 commit comments

Comments
 (0)