ingestify 0.3.0__py3-none-any.whl → 0.3.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
ingestify/__init__.py CHANGED
@@ -8,4 +8,4 @@ if not __INGESTIFY_SETUP__:
8
8
  from .infra import retrieve_http
9
9
  from .source_base import Source, DatasetResource
10
10
 
11
- __version__ = "0.3.0"
11
+ __version__ = "0.3.1"
@@ -0,0 +1,31 @@
1
+ import logging
2
+ from pathlib import Path
3
+ from typing import BinaryIO
4
+
5
+ from ingestify.domain.models import Dataset, FileRepository
6
+
7
+
8
+ logger = logging.getLogger(__name__)
9
+
10
+
11
+ class DummyFileRepository(FileRepository):
12
+ @classmethod
13
+ def supports(cls, url: str) -> bool:
14
+ return url.startswith("dummy://")
15
+
16
+ def save_content(
17
+ self,
18
+ bucket: str,
19
+ dataset: Dataset,
20
+ revision_id: int,
21
+ filename: str,
22
+ stream: BinaryIO,
23
+ ) -> Path:
24
+ path = self.get_write_path(bucket, dataset, revision_id, filename)
25
+
26
+ logger.info(f"Dummy save content to {path}")
27
+
28
+ return path
29
+
30
+ def load_content(self, storage_path: str) -> BinaryIO:
31
+ return BinaryIO()
ingestify/main.py CHANGED
@@ -26,6 +26,7 @@ from ingestify.infra.store.dataset.sqlalchemy import SqlAlchemyDatasetRepository
26
26
  from ingestify.infra.store.dataset.sqlalchemy.repository import (
27
27
  SqlAlchemySessionProvider,
28
28
  )
29
+ from ingestify.infra.store.file.dummy_file_repository import DummyFileRepository
29
30
 
30
31
  logger = logging.getLogger(__name__)
31
32
 
@@ -70,6 +71,10 @@ def build_file_repository(file_url: str, identifier_transformer) -> FileReposito
70
71
  repository = LocalFileRepository(
71
72
  url=file_url, identifier_transformer=identifier_transformer
72
73
  )
74
+ elif file_url.startswith("dummy://"):
75
+ repository = DummyFileRepository(
76
+ url=file_url, identifier_transformer=identifier_transformer
77
+ )
73
78
  else:
74
79
  raise Exception(f"Cannot find repository to handle file {file_url}")
75
80
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ingestify
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: Standardizing soccer tracking- and event data
5
5
  Author: Koen Vossen
6
6
  Author-email: info@koenvossen.nl
@@ -1,7 +1,7 @@
1
- ingestify/__init__.py,sha256=DnPPEtJT32gAPuUKXgIsqUE4fIvc6QA96vrcKr6nz6A,301
1
+ ingestify/__init__.py,sha256=8y7U8yZ0adoZcmOnba3KaElfLIy3c9Md6GFYPOrt8xc,301
2
2
  ingestify/cmdline.py,sha256=bIuyPgGEw4wIglNzpG9zp7TsJozsP8NSVsCe4eAyWUg,7189
3
3
  ingestify/exceptions.py,sha256=wMMuajl4AkQRfW60TLN7btJmQaH8-lUczXyW_2g9kOU,143
4
- ingestify/main.py,sha256=0sTNoLcS7euOavIAviQIMTolRnXsvOvNbmFdXgXgxhE,8516
4
+ ingestify/main.py,sha256=Xr0VbGgstPO7doDX18xqk4lBb4W2sbGWtQuXZaARsHA,8763
5
5
  ingestify/server.py,sha256=OVrf_XtpAQIn88MzqQzShXgsA9_jbnqYvD8YPBjn3cs,2413
6
6
  ingestify/source_base.py,sha256=GXAFCoT11Zov9M2v-fqQr9gFCXbtVfEIEH32V7r2oE8,382
7
7
  ingestify/utils.py,sha256=HETGhAoUlutLG0cQR63nac2JbFei9gnktDHeBQoYWfU,5692
@@ -67,6 +67,7 @@ ingestify/infra/store/dataset/sqlalchemy/__init__.py,sha256=Z5JHWGO_hwT6rO-ecMOO
67
67
  ingestify/infra/store/dataset/sqlalchemy/mapping.py,sha256=UlEIfNusSOEWOxPi_ORrdLSylbi6-TO1qwEmcrBLwog,9447
68
68
  ingestify/infra/store/dataset/sqlalchemy/repository.py,sha256=-eSR_F9tS9Hd3JNEpoJoDAb5RY38rFaKLMI3eBedjx8,7068
69
69
  ingestify/infra/store/file/__init__.py,sha256=DuEekZa2pmDuRCFiulbgoGotN0wGv3OrRXSvokY0PhY,104
70
+ ingestify/infra/store/file/dummy_file_repository.py,sha256=azUq9c43Mz9-GWk9j0E97BaqyUKu-ZMrcuaIednLq5E,723
70
71
  ingestify/infra/store/file/local_file_repository.py,sha256=1hhLqds5LlppJq2QBB0oN0Q98j6aXreCtYQYz3Q1P8g,819
71
72
  ingestify/infra/store/file/s3_file_repository.py,sha256=_sekV1rfEbwIaSGhKRnFQlj92E9qNgONiwXt6ZLCyGg,1188
72
73
  ingestify/static/templates/statsbomb_github/README.md,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -79,8 +80,8 @@ ingestify/static/templates/wyscout/README.md,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRk
79
80
  ingestify/static/templates/wyscout/config.yaml.jinja2,sha256=0zQXuvJVwd0oL2OJsPMZ8sOvRbdfRbieSGLQ44ezmYc,379
80
81
  ingestify/static/templates/wyscout/query.py,sha256=wjAOMoKvhX-BzCRqEm1SJp6YAcF8Fsq7ddrOaOpAeOk,364
81
82
  ingestify/static/templates/wyscout/database/README.md,sha256=7IuzjKo7Pqkx5wkmOETRZDljVOslqfA3ALuHMONq5dg,32
82
- ingestify-0.3.0.dist-info/METADATA,sha256=-QlChdV6OYWkqSyXUmkQTG4deBliRsSmmZMTWKeURnI,18853
83
- ingestify-0.3.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
84
- ingestify-0.3.0.dist-info/entry_points.txt,sha256=czYYXeX2ul4zdeB6bKlz3HaUF7zyVVcj9E_sRNDisI0,53
85
- ingestify-0.3.0.dist-info/top_level.txt,sha256=Lwnjgns4KequS7KiicXhh6mLUvcdfjzLyPI4qf_s4A0,10
86
- ingestify-0.3.0.dist-info/RECORD,,
83
+ ingestify-0.3.1.dist-info/METADATA,sha256=ddM76vlnc0jHh_b79Mxc9fHW5L38O2Aque3rhcKv5pI,18853
84
+ ingestify-0.3.1.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
85
+ ingestify-0.3.1.dist-info/entry_points.txt,sha256=czYYXeX2ul4zdeB6bKlz3HaUF7zyVVcj9E_sRNDisI0,53
86
+ ingestify-0.3.1.dist-info/top_level.txt,sha256=Lwnjgns4KequS7KiicXhh6mLUvcdfjzLyPI4qf_s4A0,10
87
+ ingestify-0.3.1.dist-info/RECORD,,