Debian Codegraph @

docs/source/api.rst

raw
1 API Reference
2 =============
3
4 Dask APIs generally follow from upstream APIs:
5
6 - :doc:`Arrays<array-api>` follows NumPy
7 - :doc:`DataFrames <dataframe-api>` follows Pandas
8 - :doc:`Bag <bag-api>` follows map/filter/groupby/reduce common in Spark and Python iterators
9 - :doc:`Delayed <delayed-api>` wraps general Python code
10 - :doc:`Futures <futures>` follows `concurrent.futures <https://docs.python.org/3/library/concurrent.futures.html>`_ from the standard library for real-time computation.
11
12 .. toctree::
13 :maxdepth: 1
14 :hidden:
15
16 Array <array-api.rst>
17 DataFrame <dataframe-api.rst>
18 Bag <bag-api.rst>
19 Delayed <delayed-api.rst>
20 Futures <futures>
21
22
23 Additionally, Dask has its own functions to start computations, persist data in
24 memory, check progress, and so forth that complement the APIs above.
25 These more general Dask functions are described below:
26
27 .. currentmodule:: dask
28
29 .. autosummary::
30 compute
31 is_dask_collection
32 optimize
33 persist
34 visualize
35
36 These functions work with any scheduler. More advanced operations are
37 available when using the newer scheduler and starting a
38 :obj:`dask.distributed.Client` (which, despite its name, runs nicely on a
39 single machine). This API provides the ability to submit, cancel, and track
40 work asynchronously, and includes many functions for complex inter-task
41 workflows. These are not necessary for normal operation, but can be useful for
42 real-time or advanced operation.
43
44 This more advanced API is available in the `Dask distributed documentation
45 <https://distributed.dask.org/en/latest/api.html>`_
46
47 .. autofunction:: annotate
48 .. autofunction:: get_annotations
49 .. autofunction:: compute
50 .. autofunction:: is_dask_collection
51 .. autofunction:: optimize
52 .. autofunction:: persist
53 .. autofunction:: visualize
54
55 Datasets
56 --------
57
58 Dask has a few helpers for generating demo datasets
59
60 .. currentmodule:: dask.datasets
61
62 .. autofunction:: make_people
63 .. autofunction:: timeseries
64
65 Datasets with defined specs
66 ---------------------------
67
68 The following helpers are still experimental:
69
70 .. currentmodule:: dask.dataframe.io.demo
71
72 .. autofunction:: with_spec
73
74 The ``ColumnSpec`` class
75 ************************
76 .. autoclass:: dask.dataframe.io.demo.ColumnSpec
77 :members:
78 :undoc-members:
79 :show-inheritance:
80
81 The ``RangeIndexSpec`` class
82 ****************************
83 .. autoclass:: dask.dataframe.io.demo.RangeIndexSpec
84 :members:
85 :undoc-members:
86 :show-inheritance:
87
88 The ``DatetimeIndexSpec`` class
89 *******************************
90 .. autoclass:: dask.dataframe.io.demo.DatetimeIndexSpec
91 :members:
92 :undoc-members:
93 :show-inheritance:
94
95 The ``DatasetSpec`` class
96 *************************
97 .. autoclass:: dask.dataframe.io.demo.DatasetSpec
98 :members:
99 :undoc-members:
100 :show-inheritance:
101
102 .. _api.utilities:
103
104 Utilities
105 ---------
106
107 Dask has some public utility methods. These are primarily used for parsing
108 configuration values.
109
110 .. currentmodule:: dask.utils
111
112 .. autofunction:: apply
113 .. autofunction:: format_bytes
114 .. autofunction:: format_time
115 .. autofunction:: parse_bytes
116 .. autofunction:: parse_timedelta