filename utility
Project description
이 설명은 최신 버전이 아닐 수 있습니다. 만약 최신 버전을 확인하고 싶으시다면 여기를 참고하세요.
pyfilename
안전한 파일 이름을 제공하는 라이브러리입니다.
시작하기
- 파이썬을 설치합니다.
- cmd 창을 열어 pip 명령어를 실행합니다.
pip install -U pyfilename
파일 이름 변환하기
다음과 같은 함수를 통해 파일 이름을 변환할 수 있습니다.
translate_to_safe_name: 파일명으로 사용하기에 안전한 string으로 변환합니다.
translate_to_safe_path_name: 파일 경로로 사용하기에 안전한 string으로 변환합니다.
safe_name_to_original_name: 파일명으로 사용하기에 안전한 string으로 변환한 값을 다시 일반적인 값으로 변경할 때 쓰입니다.
is_vaild_file_name: 파일명으로 쓸 수 있는지 확인합니다. 파일명으로 사용이 부적합하면 False를 반환합니다.
예시
>>> import pyfilename as pf
>>>
>>> pf.is_vaild_file_name('hello_world?.txt') # Character '?' is invalid to use in file name
False
>>> (safe_name := pf.translate_to_safe_name('hello_world?.txt')) # Convert to safe name
'hello_world?.txt'
>>> pf.is_vaild_file_name(safe_name) # Now it's True.
True
Relese Note
0.2.0 (Sep 10, 2023): 전체적인 구현 변경
0.1.0: 첫 릴리즈
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyfilename-0.4.0.tar.gz
(11.4 kB
view hashes)
Built Distribution
pyfilename-0.4.0-py3-none-any.whl
(11.2 kB
view hashes)
Close
Hashes for pyfilename-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9824c4b5ca8fbe2b8730e6f7e11c6cd4de391d1e7f562866520a034c043b20f |
|
MD5 | 0c454b45ea0cd70448bef881625efa3f |
|
BLAKE2b-256 | c98b8e773712b51e2778aa6d45729dc2bd50d461726e646cfd50b92b2258fd15 |