oarepo-runtime 1.2.2__tar.gz → 1.2.4__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. {oarepo-runtime-1.2.2/oarepo_runtime.egg-info → oarepo-runtime-1.2.4}/PKG-INFO +1 -1
  2. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/datastreams.py +5 -4
  3. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/transformers.py +5 -2
  4. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/writers/__init__.py +4 -1
  5. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/ext.py +1 -0
  6. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4/oarepo_runtime.egg-info}/PKG-INFO +1 -1
  7. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/setup.cfg +1 -1
  8. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/LICENSE +0 -0
  9. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/MANIFEST.in +0 -0
  10. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/README.md +0 -0
  11. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/__init__.py +0 -0
  12. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/cf/__init__.py +0 -0
  13. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/cf/cli.py +0 -0
  14. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/cf/mappings.py +0 -0
  15. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/cli.py +0 -0
  16. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/config/__init__.py +0 -0
  17. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/config/permissions_presets.py +0 -0
  18. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/config/service.py +0 -0
  19. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/__init__.py +0 -0
  20. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/catalogue.py +0 -0
  21. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/cli.py +0 -0
  22. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/config.py +0 -0
  23. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/errors.py +0 -0
  24. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/fixtures.py +0 -0
  25. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/readers/__init__.py +0 -0
  26. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/readers/excel.py +0 -0
  27. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/readers/json.py +0 -0
  28. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/readers/service.py +0 -0
  29. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/readers/yaml.py +0 -0
  30. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/writers/service.py +0 -0
  31. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/datastreams/writers/yaml.py +0 -0
  32. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/expansions/__init__.py +0 -0
  33. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/expansions/expandable_fields.py +0 -0
  34. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/expansions/service.py +0 -0
  35. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/ext_config.py +0 -0
  36. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/facets/__init__.py +0 -0
  37. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/facets/max_facet.py +0 -0
  38. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/facets/nested_facet.py +0 -0
  39. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/i18n/__init__.py +0 -0
  40. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/i18n/validation.py +0 -0
  41. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/relations/__init__.py +0 -0
  42. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/relations/base.py +0 -0
  43. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/relations/internal.py +0 -0
  44. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/relations/lookup.py +0 -0
  45. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/relations/mapping.py +0 -0
  46. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/relations/pid_relation.py +0 -0
  47. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/tasks/__init__.py +0 -0
  48. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/tasks/datastreams.py +0 -0
  49. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/ui/__init__.py +0 -0
  50. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/ui/marshmallow.py +0 -0
  51. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/validation/__init__.py +0 -0
  52. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime/validation/dates.py +0 -0
  53. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime.egg-info/SOURCES.txt +0 -0
  54. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime.egg-info/dependency_links.txt +0 -0
  55. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime.egg-info/entry_points.txt +0 -0
  56. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime.egg-info/requires.txt +0 -0
  57. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/oarepo_runtime.egg-info/top_level.txt +0 -0
  58. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/pyproject.toml +0 -0
  59. {oarepo-runtime-1.2.2 → oarepo-runtime-1.2.4}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: oarepo-runtime
3
- Version: 1.2.2
3
+ Version: 1.2.4
4
4
  Summary: A set of runtime extensions of Invenio repository
5
5
  Description-Content-Type: text/markdown
6
6
  Provides-Extra: devs
@@ -9,6 +9,9 @@ from oarepo_runtime.datastreams.config import DATASTREAM_READERS, get_instance
9
9
 
10
10
  from .errors import TransformerError, WriterError
11
11
  import abc
12
+ import logging
13
+
14
+ log = logging.getLogger("datastreams")
12
15
 
13
16
 
14
17
  class StreamEntry:
@@ -128,12 +131,10 @@ class DataStream(AbstractDataStream):
128
131
  try:
129
132
  writer.write(stream_entry)
130
133
  except WriterError as err:
131
- self._log.error("Error in writer: ", err, repr(stream_entry.entry))
134
+ log.error("Error in writer: ", err, repr(stream_entry.entry))
132
135
  stream_entry.errors.append(f"{writer.__class__.__name__}: {str(err)}")
133
136
  except Exception as err:
134
- self._log.error(
135
- "Unexpected error in writer: ", err, repr(stream_entry.entry)
136
- )
137
+ log.error("Unexpected error in writer: ", err, repr(stream_entry.entry))
137
138
  stream_entry.errors.append(f"{writer.__class__.__name__}: {str(err)}")
138
139
 
139
140
  return stream_entry
@@ -6,7 +6,7 @@ from .datastreams import StreamEntry
6
6
  class BaseTransformer(ABC):
7
7
  """Base transformer."""
8
8
 
9
- def __init__(self) -> None:
9
+ def __init__(self, **kwargs) -> None:
10
10
  pass
11
11
 
12
12
  @abstractmethod
@@ -20,9 +20,12 @@ class BaseTransformer(ABC):
20
20
  class BatchTransformer(BaseTransformer):
21
21
  @abstractmethod
22
22
  def apply_batch(
23
- self, stream_entry: List[StreamEntry], *args, **kwargs
23
+ self, stream_entries: List[StreamEntry], *args, **kwargs
24
24
  ) -> List[StreamEntry]:
25
25
  """Applies the transformation to the entry.
26
26
  :returns: A StreamEntry. The transformed entry.
27
27
  Raises TransformerError in case of errors.
28
28
  """
29
+
30
+ def apply(self, stream_entry: StreamEntry, *args, **kwargs) -> StreamEntry:
31
+ return self.apply_batch([stream_entry], *args, **kwargs)
@@ -24,8 +24,11 @@ class BaseWriter(ABC):
24
24
 
25
25
  class BatchWriter(BaseWriter):
26
26
  @abstractmethod
27
- def write_batch(self, entry: List[StreamEntry], *args, **kwargs):
27
+ def write_batch(self, entries: List[StreamEntry], *args, **kwargs):
28
28
  """Writes the input entry to the target output.
29
29
  :returns: nothing
30
30
  Raises WriterException in case of errors.
31
31
  """
32
+
33
+ def write(self, entry: StreamEntry, *args, **kwargs):
34
+ return self.write_batch([entry], *args, **kwargs)
@@ -1,4 +1,5 @@
1
1
  from .cli import oarepo as oarepo_cmd
2
+ import oarepo_runtime.cf.cli # noqa, just to register
2
3
  import oarepo_runtime.datastreams.cli # noqa, just to register
3
4
 
4
5
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: oarepo-runtime
3
- Version: 1.2.2
3
+ Version: 1.2.4
4
4
  Summary: A set of runtime extensions of Invenio repository
5
5
  Description-Content-Type: text/markdown
6
6
  Provides-Extra: devs
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = oarepo-runtime
3
- version = 1.2.2
3
+ version = 1.2.4
4
4
  description = A set of runtime extensions of Invenio repository
5
5
  authors = Alzbeta
6
6
  readme = README.md
File without changes
File without changes
File without changes