nice-path 0.1.0__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.
nice_path/__init__.py ADDED
@@ -0,0 +1,13 @@
1
+ from pathlib import Path
2
+
3
+
4
+ def nice_path(path: Path | str) -> str:
5
+ """Return a nice path string, relative to ~ if possible."""
6
+ p = Path(path).expanduser().resolve()
7
+ home = Path.home()
8
+ try:
9
+ rel = p.relative_to(home)
10
+ rel_str = str(rel)
11
+ return "~/" + (rel_str if rel_str != "." else "")
12
+ except ValueError:
13
+ return str(p)
nice_path/py.typed ADDED
File without changes
@@ -0,0 +1,16 @@
1
+ Metadata-Version: 2.4
2
+ Name: nice-path
3
+ Version: 0.1.0
4
+ Summary: Nice formatting of paths
5
+ Author: Tom Koelman
6
+ Author-email: Tom Koelman <tkoelman@xs4all.nl>
7
+ License-Expression: MIT-0
8
+ License-File: LICENSE
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
14
+ Requires-Python: >=3.10
15
+ Description-Content-Type: text/markdown
16
+
@@ -0,0 +1,6 @@
1
+ nice_path/__init__.py,sha256=_vIfkV7DQPzcZ-6I38_WG_NFw57Y69ceYqE_ksG22fk,369
2
+ nice_path/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ nice_path-0.1.0.dist-info/licenses/LICENSE,sha256=039VUpZuMYL9TKmO8aJw8gWch3lDFgDj1iI6XsO0VZQ,910
4
+ nice_path-0.1.0.dist-info/WHEEL,sha256=Uo4e6VmJM8J_cLBTtiWBRVQkc1yUEkw94xaL0B_lH6c,80
5
+ nice_path-0.1.0.dist-info/METADATA,sha256=ixw3x55ibNMnqwbaLY4BDUVZppw6DERktKbpZBC3hWs,535
6
+ nice_path-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: uv 0.10.7
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,16 @@
1
+ MIT No Attribution
2
+
3
+ Copyright (c) 2026 Tom Koelman
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this
6
+ software and associated documentation files (the "Software"), to deal in the Software
7
+ without restriction, including without limitation the rights to use, copy, modify,
8
+ merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9
+ permit persons to whom the Software is furnished to do so.
10
+
11
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
12
+ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
13
+ PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
14
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
15
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
16
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.