pathpilot 0.4.1__tar.gz → 0.4.3__tar.gz

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.
Files changed (36) hide show
  1. {pathpilot-0.4.1 → pathpilot-0.4.3}/PKG-INFO +5 -7
  2. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/__init__.py +1 -1
  3. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/_file/base/df_dispatch_file.py +2 -2
  4. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/_file/kinds/_csv.py +1 -0
  5. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/_file/kinds/_excel.py +11 -5
  6. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/_folder/folder/_contents/base.py +3 -7
  7. {pathpilot-0.4.1 → pathpilot-0.4.3}/pyproject.toml +5 -4
  8. {pathpilot-0.4.1 → pathpilot-0.4.3}/LICENSE +0 -0
  9. {pathpilot-0.4.1 → pathpilot-0.4.3}/README.md +0 -0
  10. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/_file/__init__.py +0 -0
  11. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/_file/_utils.py +0 -0
  12. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/_file/base/__init__.py +0 -0
  13. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/_file/base/_decorators.py +0 -0
  14. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/_file/base/core.py +0 -0
  15. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/_file/kinds/__init__.py +0 -0
  16. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/_file/kinds/_parquet.py +0 -0
  17. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/_file/kinds/_pickle.py +0 -0
  18. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/_file/kinds/_sqlite.py +0 -0
  19. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/_file/kinds/_text.py +0 -0
  20. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/_file/kinds/_zip.py +0 -0
  21. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/_file/utils.py +0 -0
  22. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/_folder/__init__.py +0 -0
  23. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/_folder/backup.py +0 -0
  24. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/_folder/folder/__init__.py +0 -0
  25. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/_folder/folder/_contents/__init__.py +0 -0
  26. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/_folder/folder/_contents/files.py +0 -0
  27. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/_folder/folder/_contents/subfolders.py +0 -0
  28. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/_folder/folder/core.py +0 -0
  29. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/_folder/utils.py +0 -0
  30. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/_utils.py +0 -0
  31. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/config.py +0 -0
  32. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/core.py +0 -0
  33. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/decorators.py +0 -0
  34. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/exceptions.py +0 -0
  35. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/path.py +0 -0
  36. {pathpilot-0.4.1 → pathpilot-0.4.3}/pathpilot/utils.py +0 -0
@@ -1,26 +1,24 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pathpilot
3
- Version: 0.4.1
3
+ Version: 0.4.3
4
4
  Summary: Library that facilitates file and folder manipulation in Python.
5
5
  License: MIT
6
6
  License-File: LICENSE
7
7
  Author: Zachary Einck
8
8
  Author-email: zacharyeinck@gmail.com
9
- Requires-Python: >=3.8,<4.0
9
+ Requires-Python: >=3.11,<4.0
10
10
  Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Programming Language :: Python :: 3
12
- Classifier: Programming Language :: Python :: 3.8
13
- Classifier: Programming Language :: Python :: 3.9
14
- Classifier: Programming Language :: Python :: 3.10
15
12
  Classifier: Programming Language :: Python :: 3.11
16
13
  Classifier: Programming Language :: Python :: 3.12
17
14
  Classifier: Programming Language :: Python :: 3.13
18
15
  Classifier: Programming Language :: Python :: 3.14
19
16
  Requires-Dist: XlsxWriter
20
17
  Requires-Dist: cachegrab (>=0.2.2)
21
- Requires-Dist: clockwork (>=0.5.0)
18
+ Requires-Dist: clockwork (>=0.6.0)
19
+ Requires-Dist: fastexcel
22
20
  Requires-Dist: numpy
23
- Requires-Dist: oddments (>=0.8.1)
21
+ Requires-Dist: oddments (>=0.9.0)
24
22
  Requires-Dist: pandas
25
23
  Requires-Dist: polars
26
24
  Project-URL: Homepage, https://github.com/zteinck/pathpilot
@@ -21,5 +21,5 @@ from .utils import (
21
21
  get_modified_date,
22
22
  )
23
23
 
24
- __version__ = '0.4.1'
24
+ __version__ = '0.4.3'
25
25
  __author__ = 'Zachary Einck <zacharyeinck@gmail.com>'
@@ -31,7 +31,7 @@ class DfDispatchFile(File):
31
31
 
32
32
 
33
33
  @inject_df_backend
34
- def _save(self, obj, df_backend, **kwargs):
34
+ def _save(self, obj=None, df_backend=None, **kwargs):
35
35
 
36
36
  if df_backend == 'pandas':
37
37
  cast_func = odd.to_pandas_frame
@@ -40,7 +40,7 @@ class DfDispatchFile(File):
40
40
  cast_func = odd.to_polars_frame
41
41
  save_func = self._save_with_polars
42
42
 
43
- if _is_frame(obj):
43
+ if obj is not None and _is_frame(obj):
44
44
  obj = cast_func(obj)
45
45
 
46
46
  save_func(obj, **kwargs)
@@ -25,6 +25,7 @@ class CsvFile(DfDispatchFile):
25
25
  defaults = {
26
26
  'encoding': 'ISO-8859-1',
27
27
  'keep_default_na': False,
28
+ 'na_values': [''],
28
29
  }
29
30
  params = defaults | kwargs
30
31
  return pd.read_csv(self.path, **params)
@@ -854,7 +854,7 @@ class ExcelFile(DfDispatchFile):
854
854
  if (
855
855
  isinstance(k, str)
856
856
  and odd.column_name_is_datelike(k)
857
- and not np.issubdtype(df[k].dtype, np.timedelta64)
857
+ and not pd.api.types.is_timedelta64_dtype(df[k])
858
858
  ):
859
859
  datelike_columns.add(k)
860
860
 
@@ -928,8 +928,10 @@ class ExcelFile(DfDispatchFile):
928
928
  datetime_columns = set()
929
929
 
930
930
  for k in list(datelike_columns):
931
- if np.issubdtype(df[k].dtype, np.datetime64) \
932
- or df[k].isna().all():
931
+ if (
932
+ pd.api.types.is_datetime64_any_dtype(df[k])
933
+ or df[k].isna().all()
934
+ ):
933
935
  continue
934
936
 
935
937
  fmt = date_formats.get(k)
@@ -1325,7 +1327,11 @@ class ExcelFile(DfDispatchFile):
1325
1327
 
1326
1328
 
1327
1329
  def _read_with_pandas(self, **kwargs):
1328
- params = {'keep_default_na': False} | kwargs
1330
+ defaults = {
1331
+ 'keep_default_na': False,
1332
+ 'na_values': [''],
1333
+ }
1334
+ params = defaults | kwargs
1329
1335
  return pd.read_excel(self.path, **params)
1330
1336
 
1331
1337
 
@@ -1515,7 +1521,7 @@ class ExcelFile(DfDispatchFile):
1515
1521
  df = normalize_if_lossless(
1516
1522
  df=df,
1517
1523
  selector=selector,
1518
- expr=((selector.round(decimals) % 1) == 0),
1524
+ expr=((selector % 1) == 0),
1519
1525
  dtype=pl.Int64
1520
1526
  )
1521
1527
 
@@ -135,8 +135,7 @@ class FolderContents(object):
135
135
  ------------
136
136
  name_pattern : str
137
137
  If not None, only object names meeting this pattern will be
138
- considered candidates. This argument is passed as the
139
- pd.Series.str.contains 'pat' argument.
138
+ considered candidates.
140
139
  name_literal
141
140
  Determines how 'name_pattern' is interpreted:
142
141
  • True → literal string
@@ -157,17 +156,14 @@ class FolderContents(object):
157
156
  There are a few scenarios to consider:
158
157
  • 'date_pattern' is None → an attempt will be made to derive
159
158
  the regex pattern using 'date_format' as the template.
160
- • 'date_pattern' is not None → 'date_format' is optional but
161
- it can be included if you do not want to rely on
162
- pd.to_datetime inferring the format.
159
+ • 'date_pattern' is not None → 'date_format' is optional.
163
160
 
164
161
  Example:
165
162
  ------------
166
163
  Dealing with the same example from above, all the following
167
164
  combinations will achieve the same result since the None values
168
165
  being inferred:
169
- • date_pattern=r'\d{4}\-\d{2}\-\d{2}',
170
- date_format='%Y-%m-%d'
166
+ • date_pattern=r'\d{4}\-\d{2}\-\d{2}', date_format='%Y-%m-%d'
171
167
  • date_pattern=None, date_format='%Y-%m-%d'
172
168
  • date_pattern=r'\d{4}\-\d{2}\-\d{2}', date_format=None
173
169
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pathpilot"
3
- version = "0.4.1"
3
+ version = "0.4.3"
4
4
  description = "Library that facilitates file and folder manipulation in Python."
5
5
  authors = ["Zachary Einck <zacharyeinck@gmail.com>"]
6
6
  license = "MIT"
@@ -9,14 +9,15 @@ repository = "https://github.com/zteinck/pathpilot"
9
9
  homepage = "https://github.com/zteinck/pathpilot"
10
10
 
11
11
  [tool.poetry.dependencies]
12
- python = "^3.8"
13
- clockwork = ">=0.5.0"
12
+ python = "^3.11"
13
+ clockwork = ">=0.6.0"
14
14
  cachegrab = ">=0.2.2"
15
- oddments = ">=0.8.1"
15
+ oddments = ">=0.9.0"
16
16
  polars = "*"
17
17
  pandas = "*"
18
18
  numpy = "*"
19
19
  XlsxWriter = "*"
20
+ fastexcel = "*"
20
21
 
21
22
  [build-system]
22
23
  requires = ["poetry-core"]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes