You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/contributing_readers.rst
+1-1
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,7 @@ Example ``add_rows``: ::
50
50
51
51
self.add_to_output(my_data)
52
52
53
-
*Alternate* Add Rows: ``add_rows(self) -> None``
53
+
*Newer* Add Rows: ``add_rows(self) -> None``
54
54
-------------------------------------
55
55
If you are confident that the the data you read in ``add_rows`` is in the form of an OrderedDict (the data structure used to store all ingested data), you can bypass the use of ``pack_header`` and ``add_to_output`` with an alternate ``set_schema`` function.
The DSI Core middleware defines the Terminal concept. An instantiated Terminal is the human/machine DSI interface.
5
-
The person setting up a Core Terminal only needs to know how they want to ask questions, and what metadata they want to ask questions about.
6
-
If they don’t see an option to ask questions the way they like, or they don’t see the metadata they want to ask questions about, then they should ask a Backend Contributor or a Plugin Contributor, respectively.
4
+
The DSI Core middleware defines the Terminal and Sync concept.
5
+
An instantiated Terminal is the human/machine DSI interface to connect Reader/Writer plugins and DSI backends.
6
+
An instantiated Sync supports data movement capabilities between local and remote locations and captures metadata documentation
7
7
8
8
Core: Terminal
9
9
--------------
@@ -24,43 +24,68 @@ Notes for users:
24
24
- Terminal handles errors from any loaded DSI/user-written modules (plugins/backends). If writing an external plugin/backend, return a caught error as a tuple (error, error_message_string). Do not print in a new class
25
25
.. autoclass:: dsi.core.Terminal
26
26
:members:
27
+
:special-members: __init__
27
28
28
29
Core: Sync
29
30
----------
30
31
31
-
The DSI Core middleware also defines data management functionality in ``Sync``. The purpose of ``Sync`` is to provide file metadata documentation and data movement capabilities when moving data to/from local and remote locations. The purpose of data documentation is to capture and archive metadata (i.e. location of local file structure, their access permissions, file sizes, and creation/access/modification dates) and track their movement to the remote location for future access. The primary functions, ``Copy``, ``Move``, and ``Get`` serve as mechanisms to copy data, move data, or retrieve data from remote locations by creating a DSI database in the process, or retrieving an existing DSI database that contains the location(s) of the target data.
32
+
The DSI Core middleware also defines data management functionality in ``Sync``.
33
+
The purpose of ``Sync`` is to provide file metadata documentation and data movement capabilities when moving data to/from local and remote locations.
34
+
The purpose of data documentation is to capture and archive metadata (i.e. location of local file structure, their access permissions, file sizes, and creation/access/modification dates) and track their movement to the remote location for future access.
35
+
The primary functions, ``Copy``, ``Move``, and ``Get`` serve as mechanisms to copy data, move data, or retrieve data from remote locations by creating a DSI database in the process, or retrieving an existing DSI database that contains the location(s) of the target data.
32
36
33
37
.. autoclass:: dsi.core.Sync
34
38
:members:
39
+
:special-members: __init__
35
40
36
41
Examples
37
42
--------
38
-
Before interacting with the plugins and backends, they must each be loaded. Examples below display various ways that users can incorporate DSI into their data science workflows.
43
+
Before interacting with the plugins and backends, they must each be loaded.
44
+
Examples below display various ways users can incorporate DSI into their data science workflows.
45
+
They can be found and run in ``examples/core/``
39
46
40
-
Example 1: Baseline use of DSI to list Modules
47
+
Example 1: Intro use case
48
+
~~~~~~~~~~
49
+
Baseline use of DSI to list Modules
41
50
42
51
.. literalinclude:: ../examples/core/baseline.py
43
52
44
-
Example 2: Ingesting data from a Reader to a backend
53
+
Example 2: Ingest data
54
+
~~~~~~~~~~
55
+
Ingesting data from a Reader to a backend
45
56
46
57
.. literalinclude:: ../examples/core/ingest.py
47
58
48
-
Example 3: Querying data from a backend
59
+
Example 3: Query data
60
+
~~~~~~~~~~
61
+
Querying data from a backend
49
62
50
63
.. literalinclude:: ../examples/core/query.py
51
64
52
-
Example 4: Processing data from a backend to generate an Entity Relationship diagram using a Writer
65
+
Example 4: Process data
66
+
~~~~~~~~~~
67
+
Processing data from a backend to generate an Entity Relationship diagram using a Writer
53
68
54
69
.. literalinclude:: ../examples/core/process.py
55
70
56
-
Example 5: Generating a python notebook file (mostly Jupyter notebook) from a backend to view data interactively
71
+
Example 5: Generate notebook
72
+
~~~~~~~~~~
73
+
Generating a python notebook file (mostly Jupyter notebook) from a backend to view data interactively
57
74
58
75
.. literalinclude:: ../examples/core/notebook.py
59
76
60
-
Example 6: Finding data from a backend - tables, columns, cells, or all matches
77
+
Example 6: Find data
78
+
~~~~~~~~~~
79
+
Finding data from a backend - tables, columns, cells, or all matches
61
80
62
81
.. literalinclude:: ../examples/core/find.py
63
82
64
-
Example 7: Loading an external plugin from another python file
83
+
Example 7: External plugin
84
+
~~~~~~~~~~
85
+
Loading an external python plugin reader from a separate file:
Copy file name to clipboardExpand all lines: docs/plugins.rst
+10-2
Original file line number
Diff line number
Diff line change
@@ -9,17 +9,22 @@ Note that any contributed plugins or extension should include unit tests in ``p
9
9
.. figure:: PluginClassHierarchy.png
10
10
:alt:Figure depicting the current plugin class hierarchy.
11
11
:class:with-shadow
12
-
:scale:100%
12
+
:scale:70%
13
13
14
14
Figure depicts prominent portion of the current DSI plugin class hierarchy.
15
15
16
16
.. automodule:: dsi.plugins.plugin
17
17
:members:
18
+
:special-members: __init__
19
+
20
+
Metadata Processing
21
+
-------------------
18
22
19
23
**Note for users:** StructuredMetadata class is used to assign data from a file_reader to the DSI abstraction in core. If data in a user-written reader is restructured as an OrderedDict, only need to call set_schema_2() at bottom of add_rows().
20
24
21
25
.. automodule:: dsi.plugins.metadata
22
26
:members:
27
+
:special-members: __init__
23
28
24
29
File Readers
25
30
------------
@@ -32,6 +37,7 @@ Note for users:
32
37
- if ingesting multiple tables at a time, users must pad tables with null data (YAML1 uses this and has example code at bottom of add_row() to implement this)
33
38
.. automodule:: dsi.plugins.file_reader
34
39
:members:
40
+
:special-members: __init__
35
41
36
42
File Writers
37
43
------------
@@ -40,14 +46,16 @@ Note for users:
40
46
- If runTable flag is True in Terminal instantiation, the run table is only included in ER Diagram writer if data is processed from a backend. View Example 4 in Core Examples
41
47
.. automodule:: dsi.plugins.file_writer
42
48
:members:
49
+
:special-members: __init__
43
50
44
51
Environment Plugins
45
52
-------------------
46
53
.. automodule:: dsi.plugins.env
47
54
:members:
55
+
:special-members: __init__
48
56
49
57
Optional Plugin Type Enforcement
50
-
==================================
58
+
--------------------------------
51
59
52
60
Plugins take data in an arbitrary format, and transform it into metadata which is queriable in DSI. Plugins may enforce types, but they are not required to enforce types. Plugin type enforcement can be static, like the Hostname default plugin. Plugin type enforcement can also be dynamic, like the Bueno default plugin.
0 commit comments