earthkit.data.targets.fdb¶
Attributes¶
Classes¶
Represent a target. |
Module Contents¶
- class earthkit.data.targets.fdb.FDBTarget(fdb=None, config=None, userconfig=None, **kwargs)¶
Bases:
earthkit.data.targets.SimpleTargetRepresent a target.
- Parameters:
encoder (
str,Encoder,None) – The encoder to use to encode the data. Can be overridden in the thewritemethod. When a string is passed, the encoder is looked up in the available encoders. When None, the encoder will be determined from the data to write (if possible) or from theTargetproperties.template (
obj,None) – The template to use to encode the data. Can be overridden in thewritemethod.metadata (
dict,None) – Metadata to pass to the encoder.
:param The
Targetis used to write data to a specific location. The target can be: :param a file: :param a database: :param a remote server: :param etc.:- close()¶
Close the target and flush the fdb.
The target will not be able to write anymore.
- Raises:
ValueError –
- property closed¶
True if the target is closed, False otherwise.
- property fdb¶
- flush()¶
Flush the fdb.
- Raises:
ValueError –
- write(data=None, **kwargs)¶
Write data to the target using the given encoder.
- Parameters:
data (
obj,None) – The data object to write. If None, the encoder will use all the other arguments to generate the data to write.encoder (
str,Encoder,None) – The encoder to use to encode the data. When a string is passed, the encoder is looked up in the available encoders. When None, the encoder theTargetwas created with will be used if available. Otherwise, the encoder will be determined from the data to write (if possible) or from theTargetproperties.template (
obj,None) – The template to use to encode the data. When None, the template theTargetwas created with will be used if available.metadata (
dict,None) – Metadata to pass to the encoder.**kwargs (
dict) – Other keyword arguments passed to the encoder.
- Raises:
ValueError –
- earthkit.data.targets.fdb.target¶