Skip to main content

filename utility

Project description

이 설명은 최신 버전이 아닐 수 있습니다. 만약 최신 버전을 확인하고 싶으시다면 여기를 참고하세요.

pyfilename

안전한 파일 이름을 제공하는 라이브러리입니다.

시작하기

  1. 파이썬을 설치합니다.
  2. 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


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.2.0.tar.gz (7.4 kB view hashes)

Uploaded Source

Built Distribution

pyfilename-0.2.0-py3-none-any.whl (8.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page