Model
GeoFieldHint
dataclass
¶
Class holding the fields representing the fields in a record which describe its latitude/longitude location and an optional uncertainty radius.
Source code in splitgill/model.py
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 | |
IngestResult
dataclass
¶
A dataclass containing information about the new data ingested into MongoDB.
Source code in splitgill/model.py
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 | |
was_committed
property
¶
Returns True if the data was committed, False if not. This is determined by whether a version is available.
Returns:
| Type | Description |
|---|---|
bool
|
True if the data was committed, False if not |
update(bulk_result)
¶
Update the counts with the counts in the bulk result object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bulk_result
|
BulkWriteResult
|
a BulkWriteResult object |
required |
Source code in splitgill/model.py
220 221 222 223 224 225 226 227 228 | |
MongoRecord
dataclass
¶
A record retrieved from MongoDB.
Source code in splitgill/model.py
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 | |
has_history
property
¶
A record has history if it has any diffs.
Returns:
| Type | Description |
|---|---|
bool
|
True if this record has previous versions, False if not |
is_deleted
property
¶
A record is deleted if its current data is an empty dict.
Returns:
| Type | Description |
|---|---|
bool
|
True if this record has been deleted, False if not |
is_uncommitted
property
¶
A record is uncommitted if its current version is None.
Returns:
| Type | Description |
|---|---|
bool
|
True if this record has been deleted, False if not |
get_versions(desc=False)
¶
Returns a list of the record's versions in ascending order. If desc is True, the versions are returned in descending order. If the current version is None, it is not included.
Returns:
| Type | Description |
|---|---|
List[int]
|
the record's versions |
Source code in splitgill/model.py
83 84 85 86 87 88 89 90 91 92 93 94 | |
iter()
¶
Yields the versions and data of this record. These are yielded as (int, dict) VersionedData named tuples. The tuples are yielded in reverse order, starting with the latest data and working back to the first version.
Returns:
| Type | Description |
|---|---|
Iterable[VersionedData]
|
VersionedData (version: int, data: dict) named tuples in descending version order |
Source code in splitgill/model.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | |
ParsingOptions
dataclass
¶
Holds options for parsing.
The objects created using this class are immutable. You can instantiate them directly, but it's better to use The ParsingOptionBuilder defined below.
Source code in splitgill/model.py
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 189 190 191 | |
Record
dataclass
¶
A record before it becomes managed by Splitgill.
Source code in splitgill/model.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | |
is_delete
property
¶
Returns True if this record is a delete request, otherwise False. A delete request is a record with empty data ({}).
Returns:
| Type | Description |
|---|---|
bool
|
True if this is a delete, False if not |