scingestor package¶
Submodules¶
scingestor.beamtimeWatcher module¶
- class scingestor.beamtimeWatcher.BeamtimeWatcher(options)[source]¶
Bases:
object
Beamtime Watcher
constructor
- Parameters:
options (
argparse.Namespace
) – parser options
scingestor.configuration module¶
scingestor.datasetIngest module¶
- class scingestor.datasetIngest.DatasetIngest(options)[source]¶
Bases:
object
Dataset Ingest command
constructor
- Parameters:
options (
argparse.Namespace
) – parser options
scingestor.datasetIngestor module¶
- class scingestor.datasetIngestor.DatasetIngestor(configuration, path, dsfile, idsfile, meta, beamtimefile)[source]¶
Bases:
object
Dataset Ingestor
constructor
- Parameters:
configuration (
dict
<str
, any>) – dictionary with the ingestor configurationpath (
str
) – scan dir pathdsfile (
str
) – file with a dataset listdsfile – file with a ingester dataset list
beamtimefile (
str
) – beamtime filenamepidprefix (
str
) – pidprefixingestorcred (
str
) – ingestor credentialscicat_url (
str
) – scicat_url
- reingest(scan, token, notmp=False)[source]¶
re-ingest scan
- Parameters:
scan (
str
) – scan nametoken (
book
) – access tokentoken – no tmp file flag
- class scingestor.datasetIngestor.UpdateStrategy(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
Enum
Update strategy
- CREATE = 2¶
(
scingestor.datasetIngestor.UpdateStrategy
) recreate datasets
- MIXED = 3¶
(
scingestor.datasetIngestor.UpdateStrategy
) patch datasets only if scientificMetadata changed otherwise recreate datasets
- NO = 0¶
(
scingestor.datasetIngestor.UpdateStrategy
) leave datasets unchanged
- PATCH = 1¶
(
scingestor.datasetIngestor.UpdateStrategy
) patch datasets
scingestor.datasetWatcher module¶
scingestor.logger module¶
- class scingestor.logger.AccSecFormatter(fmt=None, datefmt=None, style='%', validate=True, *, defaults=None)[source]¶
Bases:
Formatter
micro-second formatter
Initialize the formatter with specified format strings.
Initialize the formatter either with the specified format string, or a default as described above. Allow for specialized date formatting with the optional datefmt argument. If datefmt is omitted, you get an ISO8601-like (or RFC 3339-like) format.
Use a style parameter of ‘%’, ‘{’ or ‘$’ to specify that you want to use one of %-formatting,
str.format()
({}
) formatting orstring.Template
formatting in your format string.Changed in version 3.2: Added the
style
parameter.- converter()¶
timestamp[, tz] -> tz’s local time from POSIX timestamp.
- formatTime(record, datefmt=None)[source]¶
Return the creation time of the specified LogRecord as formatted text.
This method should be called from format() by a formatter which wants to make use of a formatted time. This method can be overridden in formatters to provide for any specific requirement, but the basic behaviour is as follows: if datefmt (a string) is specified, it is used with time.strftime() to format the creation time of the record. Otherwise, an ISO8601-like (or RFC 3339-like) format is used. The resulting string is returned. This function uses a user-configurable function to convert the creation time to a tuple. By default, time.localtime() is used; to change this for a particular formatter instance, set the ‘converter’ attribute to a function with the same signature as time.localtime() or time.gmtime(). To change it for all formatters, for example if you want all logging times to be shown in GMT, set the ‘converter’ attribute in the Formatter class.
scingestor.modelIngest module¶
- class scingestor.modelIngest.ModelIngest(options)[source]¶
Bases:
object
Dataset Ingest command
constructor
- Parameters:
options (
argparse.Namespace
) – parser options
scingestor.pathConverter module¶
scingestor.safeINotifier module¶
- class scingestor.safeINotifier.EventData(name, masks)[source]¶
Bases:
object
event data
constructor
- Parameters:
name (
str
) – namemasks – mask description
- class scingestor.safeINotifier.SafeINotifier(*args, **kwargs)[source]¶
Bases:
Thread
singleton wrapper for inotifyx
This constructor should always be called with keyword arguments. Arguments are:
group should be None; reserved for future extension when a ThreadGroup class is implemented.
target is the callable object to be invoked by the run() method. Defaults to None, meaning nothing is called.
name is the thread name. By default, a unique name is constructed of the form “Thread-N” where N is a small decimal number.
args is a list or tuple of arguments for the target invocation. Defaults to ().
kwargs is a dictionary of keyword arguments for the target invocation. Defaults to {}.
If a subclass overrides the constructor, it must make sure to invoke the base class constructor (Thread.__init__()) before doing anything else to the thread.
- add_watch(path, masks)[source]¶
add watch to notifier
- Parameters:
- Returns:
queue providing events and its id
- Return type:
[
queue.Queue
,int
]