Makes a string file path compatible (Windows)
# Tested with:
# Python 3.9.13
# Windows 10
$pip install windows-filepath
import sys
import pandas as pd
import inspect
from windows_filepath import make_filepath_windows_comp, allow_long_path_windows
# creating some random data
teststuff = [x + '.png' if ini % 2 == 0 else x for ini, x in enumerate(inspect.getsource(pd).splitlines())]
for _ in teststuff:
# doesn't check the length, you can change the windows settings by calling allow_long_path_windows()
# This will set the MAX_PATH to 32,767
fp = make_filepath_windows_comp(
filepath=_,
fillvalue="_", # replacement of any illegal char
reduce_fillvalue=True, # */<> (illegal chars) -> ____ (replacement) -> _ (reduced replacement)
remove_backslash_and_col=False, # important for multiple folders
spaceforbidden=True, # '\s' -> _
other_to_replace=(";", ",", "[", "]", "`", "="), # other chars you don't want in the file path
slash_to_backslash=True, # replaces / with \\ before doing all the other replacements
)
print(_)
print(fp, end='\n\n')
Metadata
Release files for windows-filepath 0.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| windows_filepath-0.10.tar.gz | 4.5 kB | Without provenance | Details for windows_filepath-0.10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| windows_filepath-0.10-py3-none-any.whl | Python 3 | none | any | Details for windows_filepath-0.10-py3-none-any.whl |
Total release size: 10.6 kB
Release files / windows_filepath-0.10.tar.gz
| Download URL | windows_filepath-0.10.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aeb19549eacc9b93bb8f43865544e887c9bf58d976a72174e06217f0814250bc
|
|
BLAKE2b-256 checksum How to use checksums |
8e0009abfe7bc94963c842a39cb098f95daa27072f79c27c4987fc9d2ed2bd56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / windows_filepath-0.10-py3-none-any.whl
| Download URL | windows_filepath-0.10-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ae1a9e640ecaee1fad9e6b7e82c1a251cf9809e0243d21e973a2cc883702fc3e
|
|
BLAKE2b-256 checksum How to use checksums |
ca34b445d7c4343ad6d9b04d4e66ae73916d444f948c8cffd67fd43fcfab06bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Security for windows-filepath 0.10
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.