thds.core 1.32.20250313161106__py3-none-any.whl → 1.32.20250320152121__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.

Potentially problematic release.


This version of thds.core might be problematic. Click here for more details.

@@ -1,25 +1,26 @@
1
+ import os
1
2
  import typing as ty
2
3
  from functools import partial
3
4
  from pathlib import Path
4
5
 
5
6
  from ..files import is_file_uri, path_from_uri, to_uri
6
7
  from ..hashing import Hash
7
- from ..types import StrOrPath
8
8
  from . import _download
9
9
  from .src import Source
10
10
 
11
11
  # Creation from local Files or from remote URIs
12
12
 
13
13
 
14
- def from_file(filename: StrOrPath, hash: ty.Optional[Hash] = None, uri: str = "") -> Source:
14
+ def from_file(
15
+ filename: ty.Union[str, os.PathLike], hash: ty.Optional[Hash] = None, uri: str = ""
16
+ ) -> Source:
15
17
  """Create a read-only Source from a local file that already exists.
16
18
 
17
19
  If URI is passed, the local file will be read and hashed, but the final URI in the
18
20
  Source will be the one provided explicitly. NO UPLOAD IS PERFORMED. It is your
19
21
  responsibility to ensure that your file has been uploaded to the URI you provide.
20
22
  """
21
- path = path_from_uri(filename) if isinstance(filename, str) else filename
22
- assert isinstance(path, Path)
23
+ path = path_from_uri(filename) if isinstance(filename, str) else Path(filename)
23
24
  if not path.exists():
24
25
  raise FileNotFoundError(path)
25
26
 
@@ -40,6 +41,7 @@ class FromUri(ty.Protocol):
40
41
  and the hash will be included in the Source object regardless, and will
41
42
  be validated (if non-nil) at the time of source data access.
42
43
  """
44
+ ...
43
45
 
44
46
 
45
47
  class FromUriHandler(ty.Protocol):
@@ -47,6 +49,7 @@ class FromUriHandler(ty.Protocol):
47
49
  """Returns a FromUri object containing the URI if this URI can be handled. Returns
48
50
  None if this URI cannot be handled.
49
51
  """
52
+ ...
50
53
 
51
54
 
52
55
  def register_from_uri_handler(key: str, handler: FromUriHandler):
thds/core/types.py CHANGED
@@ -1,4 +1,6 @@
1
1
  import os
2
2
  import typing as ty
3
3
 
4
- StrOrPath = ty.Union[str, os.PathLike]
4
+ StrOrPath = ty.Union[
5
+ str, os.PathLike
6
+ ] # DEPRECATED - please be explicit about this bc it isn't much extra typing
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: thds.core
3
- Version: 1.32.20250313161106
3
+ Version: 1.32.20250320152121
4
4
  Summary: Core utilities.
5
5
  Author-email: Trilliant Health <info@trillianthealth.com>
6
6
  License: MIT
@@ -38,7 +38,7 @@ thds/core/stack_context.py,sha256=17lPOuYWclUpZ-VXRkPgI4WbiMzq7_ZY6Kj1QK_1oNo,13
38
38
  thds/core/thunks.py,sha256=p1OvMBJ4VGMsD8BVA7zwPeAp0L3y_nxVozBF2E78t3M,1053
39
39
  thds/core/timer.py,sha256=1FfcQ4-Gp6WQFXR0GKeT_8jwtamEfnTukdSbDKTAJVM,5432
40
40
  thds/core/tmp.py,sha256=KgBAwQCmpm7I762eLRu-3MSfH3dKnqlrJkZ5nmPcRbc,3110
41
- thds/core/types.py,sha256=Pbo5bF3b14V8eeabpnffWOPJDAGrMcKBCh5e-ZvipJk,70
41
+ thds/core/types.py,sha256=sFqI_8BsB1u85PSizjBZw8PBtplC7U54E19wZZWCEvI,152
42
42
  thds/core/log/__init__.py,sha256=bDbZvlxyymY6VrQzD8lCn0egniLEiA9hpNMAXZ7e7wY,1348
43
43
  thds/core/log/basic_config.py,sha256=2Y9U_c4PTrIsCmaN7Ps6Xr90AhJPzdYjeUzUMqO7oFU,6704
44
44
  thds/core/log/json_formatter.py,sha256=C5bRsSbAqaQqfTm88jc3mYe3vwKZZLAxET8s7_u7aN0,1757
@@ -46,7 +46,7 @@ thds/core/log/kw_formatter.py,sha256=9-MVOd2r5NEkYNne9qWyFMeR5lac3w7mjHXsDa681i0
46
46
  thds/core/log/kw_logger.py,sha256=CyZVPnkUMtrUL2Lyk261AIEPmoP-buf_suFAhQlU1io,4063
47
47
  thds/core/log/logfmt.py,sha256=i66zoG2oERnE1P_0TVXdlfJ1YgUmvtMjqRtdV5u2SvU,10366
48
48
  thds/core/source/__init__.py,sha256=RiaUHNunoaw4XJUrwR5vJzSS6HGxOUKUONR_ipX5654,424
49
- thds/core/source/_construct.py,sha256=klN6-fSJrsbbUhp92wzhJcF73h_PKKJItNLC__vwlIs,3122
49
+ thds/core/source/_construct.py,sha256=plSyQZRe8h0X7PpbfMjhm1qkFgrcyuSrReyWQo28YfA,3121
50
50
  thds/core/source/_download.py,sha256=pUhkphHdB7y4ZpxZZ6ITIS5giXMHuRf420yYAJwx6aE,2924
51
51
  thds/core/source/serde.py,sha256=wXCfuv_Dv3QvJJr-uebGmTrfhCU_1a8VX3VJnXhVHfU,3539
52
52
  thds/core/source/src.py,sha256=9A_8kSBUc5k6OLAYe5EW_VogpXFIqofow7Rxl8xv-eg,4559
@@ -66,8 +66,8 @@ thds/core/sqlite/structured.py,sha256=swCbDoyVT6cE7Kl79Wh_rg5Z1-yrUDJbiVJF4bjset
66
66
  thds/core/sqlite/types.py,sha256=oUkfoKRYNGDPZRk29s09rc9ha3SCk2SKr_K6WKebBFs,1308
67
67
  thds/core/sqlite/upsert.py,sha256=BmKK6fsGVedt43iY-Lp7dnAu8aJ1e9CYlPVEQR2pMj4,5827
68
68
  thds/core/sqlite/write.py,sha256=z0219vDkQDCnsV0WLvsj94keItr7H4j7Y_evbcoBrWU,3458
69
- thds_core-1.32.20250313161106.dist-info/METADATA,sha256=aU8Atw1LfImdXipy09FeOmbHFrgcZWboZxJhvRMS2DE,2277
70
- thds_core-1.32.20250313161106.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
71
- thds_core-1.32.20250313161106.dist-info/entry_points.txt,sha256=bOCOVhKZv7azF3FvaWX6uxE6yrjK6FcjqhtxXvLiFY8,161
72
- thds_core-1.32.20250313161106.dist-info/top_level.txt,sha256=LTZaE5SkWJwv9bwOlMbIhiS-JWQEEIcjVYnJrt-CriY,5
73
- thds_core-1.32.20250313161106.dist-info/RECORD,,
69
+ thds_core-1.32.20250320152121.dist-info/METADATA,sha256=96O82eQPUZFHyRdaAx_NLd1BW-ZGMj1mGQ8QRfJUC4w,2277
70
+ thds_core-1.32.20250320152121.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
71
+ thds_core-1.32.20250320152121.dist-info/entry_points.txt,sha256=bOCOVhKZv7azF3FvaWX6uxE6yrjK6FcjqhtxXvLiFY8,161
72
+ thds_core-1.32.20250320152121.dist-info/top_level.txt,sha256=LTZaE5SkWJwv9bwOlMbIhiS-JWQEEIcjVYnJrt-CriY,5
73
+ thds_core-1.32.20250320152121.dist-info/RECORD,,