pathpilot 0.5.0__tar.gz → 0.6.0__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.
- {pathpilot-0.5.0 → pathpilot-0.6.0}/PKG-INFO +2 -2
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/__init__.py +1 -1
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/_file/kinds/_csv.py +16 -11
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/_file/kinds/_excel.py +4 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/_file/kinds/_parquet.py +11 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pyproject.toml +1 -1
- {pathpilot-0.5.0 → pathpilot-0.6.0}/uv.lock +1 -1
- {pathpilot-0.5.0 → pathpilot-0.6.0}/.gitignore +0 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/.python-version +0 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/LICENSE +0 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/README.md +0 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/_file/__init__.py +0 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/_file/_utils.py +0 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/_file/base/__init__.py +0 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/_file/base/_decorators.py +0 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/_file/base/core.py +0 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/_file/base/df_dispatch_file.py +0 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/_file/kinds/__init__.py +0 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/_file/kinds/_pickle.py +0 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/_file/kinds/_sqlite.py +0 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/_file/kinds/_text.py +0 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/_file/kinds/_zip.py +0 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/_file/utils.py +0 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/_folder/__init__.py +0 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/_folder/backup.py +0 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/_folder/folder/__init__.py +0 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/_folder/folder/_contents/__init__.py +0 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/_folder/folder/_contents/base.py +0 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/_folder/folder/_contents/files.py +0 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/_folder/folder/_contents/subfolders.py +0 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/_folder/folder/core.py +0 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/_folder/utils.py +0 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/_utils.py +0 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/config.py +0 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/core.py +0 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/decorators.py +0 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/exceptions.py +0 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/path.py +0 -0
- {pathpilot-0.5.0 → pathpilot-0.6.0}/pathpilot/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: pathpilot
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
4
4
|
Summary: Simplifies file and folder manipulation
|
|
5
5
|
Project-URL: repository, https://github.com/zteinck/pathpilot
|
|
6
6
|
Project-URL: homepage, https://github.com/zteinck/pathpilot
|
|
@@ -3,7 +3,11 @@ import oddments as odd
|
|
|
3
3
|
import pandas as pd
|
|
4
4
|
import polars as pl
|
|
5
5
|
|
|
6
|
-
from ...decorators import
|
|
6
|
+
from ...decorators import (
|
|
7
|
+
assert_exists,
|
|
8
|
+
check_read_only,
|
|
9
|
+
)
|
|
10
|
+
|
|
7
11
|
from ..base import DfDispatchFile
|
|
8
12
|
|
|
9
13
|
|
|
@@ -21,6 +25,16 @@ class CsvFile(DfDispatchFile):
|
|
|
21
25
|
#| Instance Methods |
|
|
22
26
|
#╰-------------------------------------------------------------------------╯
|
|
23
27
|
|
|
28
|
+
@assert_exists
|
|
29
|
+
def scan(self, **kwargs):
|
|
30
|
+
return pl.scan_csv(self.path, **kwargs)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@check_read_only
|
|
34
|
+
def sink(self, lf, **kwargs):
|
|
35
|
+
lf.sink_csv(self.path, **kwargs)
|
|
36
|
+
|
|
37
|
+
|
|
24
38
|
def _read_with_pandas(self, **kwargs):
|
|
25
39
|
defaults = {
|
|
26
40
|
'encoding': 'ISO-8859-1',
|
|
@@ -41,13 +55,4 @@ class CsvFile(DfDispatchFile):
|
|
|
41
55
|
|
|
42
56
|
|
|
43
57
|
def _save_with_polars(self, obj, **kwargs):
|
|
44
|
-
obj.write_csv(self.path, **kwargs)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
def scan(self, **kwargs):
|
|
48
|
-
return pl.scan_csv(self.path, **kwargs)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
@check_read_only
|
|
52
|
-
def sink(self, lf, **kwargs):
|
|
53
|
-
lf.sink_csv(self.path, **kwargs)
|
|
58
|
+
obj.write_csv(self.path, **kwargs)
|
|
@@ -507,6 +507,10 @@ class ExcelFile(DfDispatchFile):
|
|
|
507
507
|
char_limit = 31
|
|
508
508
|
name = name[:char_limit]
|
|
509
509
|
|
|
510
|
+
# Excel forbids certain characters
|
|
511
|
+
forbidden_chars = {':','\\','/','?','*','[',']'}
|
|
512
|
+
name = ''.join('-' if x in forbidden_chars else x for x in name)
|
|
513
|
+
|
|
510
514
|
# ensure truncated sheet names are unique
|
|
511
515
|
sheet_names = set(self.sheet_names)
|
|
512
516
|
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import polars as pl
|
|
2
2
|
|
|
3
|
+
from ...decorators import (
|
|
4
|
+
assert_exists,
|
|
5
|
+
check_read_only,
|
|
6
|
+
)
|
|
7
|
+
|
|
3
8
|
from ..base import File
|
|
4
9
|
|
|
5
10
|
|
|
@@ -17,11 +22,17 @@ class ParquetFile(File):
|
|
|
17
22
|
#| Instance Methods |
|
|
18
23
|
#╰-------------------------------------------------------------------------╯
|
|
19
24
|
|
|
25
|
+
@assert_exists
|
|
20
26
|
def scan(self, **kwargs):
|
|
21
27
|
lf = pl.scan_parquet(self.path, **kwargs)
|
|
22
28
|
return lf
|
|
23
29
|
|
|
24
30
|
|
|
31
|
+
@check_read_only
|
|
32
|
+
def sink(self, lf, **kwargs):
|
|
33
|
+
lf.sink_parquet(self.path, **kwargs)
|
|
34
|
+
|
|
35
|
+
|
|
25
36
|
def read(self, **kwargs):
|
|
26
37
|
df = pl.read_parquet(self.path, **kwargs)
|
|
27
38
|
return df
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|