Base
BaseDerivativeGenerator
¶
A factory class for generating derivative files in a given format.
Source code in ckanext/versioned_datastore/lib/downloads/derivatives/base.py
5 6 7 8 9 10 11 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 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 | |
cleanup()
¶
Runs when the generator has finished, i.e. after a single resource in separate- resources requests and after all resources in combined requests.
Source code in ckanext/versioned_datastore/lib/downloads/derivatives/base.py
111 112 113 114 115 116 | |
finalise()
¶
Runs when files close.
Source code in ckanext/versioned_datastore/lib/downloads/derivatives/base.py
105 106 107 108 109 | |
initialise()
¶
Runs after files have opened, before any records are processed.
Only runs the first time the files are opened; in a multi-resource generator, files may be opened multiple times, but this will only be run once. Use setup() for things that need to be run every time.
Source code in ckanext/versioned_datastore/lib/downloads/derivatives/base.py
76 77 78 79 80 81 82 83 84 | |
setup()
¶
Runs every time files are opened, before any records are processed.
Runs before initialise().
Source code in ckanext/versioned_datastore/lib/downloads/derivatives/base.py
86 87 88 89 90 91 92 | |
validate(record)
¶
Runs when the first record is processed.
Source code in ckanext/versioned_datastore/lib/downloads/derivatives/base.py
94 95 96 97 98 | |