Skip to main content

A package for validating file paths across different operating systems and storage services.

Project description

File Path Validator (FPV) 🚀

Welcome to File Path Validator (FPV)! This Python package provides a robust solution for validating file paths across different operating systems and cloud storage providers, ensuring that your paths are safe and compliant with the respective file system rules. 🖥️✨

Features 🌟

  • Cross-Platform Support: Validates file paths for Windows, macOS, and Linux.
  • User-Friendly Error Messages: Easy-to-understand error messages for non-tech-savvy users.
  • Customizable Validation: Supports various file name restrictions and length limitations.

Supported Platforms 🖥️

Operating Systems

  • Windows
  • macOS
  • Linux (Debian/Ubuntu)

Cloud Storage Providers

  • Box
  • Dropbox
  • Egnyte
  • OneDrive
  • SharePoint
  • ShareFile

Installation 📦

To install File Path Validator, clone the repository and install it using pip:

pip install file-path-validator

Usage 📖

# the purpose of this file is just to highlight how the code can be used.
from FPV import Validator


def main():
    example_path = " /path /to./file*.txt"
    
    # Create a validator object
    validator = Validator(example_path)

    # Access the original path
    print("Original Path:", validator.original_path)

    # Get a cleaned version of your path
    cleaned_path = validator.get_cleaned_path()
    print("Cleaned Path:", cleaned_path)  # Output should be "/path/to/file.txt"

    # Check if the original path is valid
    try:
        validator.check_if_valid()
        print("Path is valid!")
    except ValueError as e:
        print(f"Validation Error: {e}")

    # Auto-clean the path upon creating the validator object
    validator_auto_clean = Validator(example_path, auto_clean=True)
    print("Automatically Cleaned Path:", validator_auto_clean.path)


if __name__ == "__main__":
    main()

Notes on os_sync

  • The os_sync parameter allows you to specify the operating system for additional validation checks.
  • If not provided, the validator will not default to any OS. Because it is possible in a lot of cloud storage systems to only read / write files to their systems without ever syncing up the file storage to an operating system.

Contributing 🤝

We welcome contributions! If you'd like to help improve File Path Validator, please fork the repository and submit a pull request.

Thank you for checking out File Path Validator (FPV)! Happy coding! 🎉

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

file-path-validator-2.2.1.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

file_path_validator-2.2.1-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file file-path-validator-2.2.1.tar.gz.

File metadata

  • Download URL: file-path-validator-2.2.1.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.10

File hashes

Hashes for file-path-validator-2.2.1.tar.gz
Algorithm Hash digest
SHA256 4f0d0bbf2a1e9c850d44124432f81d423857df250a3f3c0ea5c0ab898bb0ea85
MD5 e409f615d2b038be28e58a7d822896f9
BLAKE2b-256 2e93eebc07b61872018bd0b25832b2922461979e7f5416583733c3283ae77d92

See more details on using hashes here.

File details

Details for the file file_path_validator-2.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for file_path_validator-2.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 796cd2636e2ed3369042c9a4b9ff345cbf09bb874215caed3057fb2290b011f7
MD5 4ff15e57b5989d08ed60ef0a3c8c29f4
BLAKE2b-256 fc4f7e3cf25acb7e58140754051384cbd7ee08f99087a7829521d5f1ad7d763d

See more details on using hashes here.

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