FileDocStore
docarray.store.file.FileDocStore
Bases: AbstractDocStore
Class to push and pull DocList
on-disk.
Source code in docarray/store/file.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
|
delete(name, missing_ok=False)
classmethod
Delete a DocList
from the local filesystem.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the |
required |
missing_ok |
bool
|
If True, do not raise an exception if the file does not exist. Defaults to False. |
False
|
Returns:
Type | Description |
---|---|
bool
|
True if the file was deleted, False if it did not exist. |
Source code in docarray/store/file.py
list(namespace, show_table)
classmethod
List all DocList
s in a directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
namespace |
str
|
The directory to list. |
required |
show_table |
bool
|
If True, print a table of the files in the directory. |
required |
Returns:
Type | Description |
---|---|
List[str]
|
A list of the names of the |
Source code in docarray/store/file.py
pull(docs_cls, name, show_progress, local_cache)
classmethod
Pull a DocList
from the specified url.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The file path to pull from. |
required |
show_progress |
bool
|
if true, display a progress bar. |
required |
local_cache |
bool
|
store the downloaded |
required |
Returns:
Type | Description |
---|---|
DocList
|
a |
Source code in docarray/store/file.py
pull_stream(docs_cls, name, show_progress, local_cache)
classmethod
Pull a stream of Documents from the specified file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The file path to pull from. |
required |
show_progress |
bool
|
if true, display a progress bar. |
required |
local_cache |
bool
|
Not used by the |
required |
Returns:
Type | Description |
---|---|
Iterator[BaseDoc]
|
Iterator of Documents |
Source code in docarray/store/file.py
push(docs, name, show_progress)
classmethod
Push this DocList
object to the specified file path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
docs |
DocList
|
The |
required |
name |
str
|
The file path to push to. |
required |
show_progress |
bool
|
If true, a progress bar will be displayed. |
required |
Source code in docarray/store/file.py
push_stream(docs, name, show_progress=False)
classmethod
Push a stream of documents to the specified file path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
docs |
Iterator[BaseDoc]
|
a stream of documents |
required |
name |
str
|
The file path to push to. |
required |
show_progress |
bool
|
If true, a progress bar will be displayed. |
False
|