=============== LIBRARY RULES =============== From library maintainers: - Simplicity is king ### Install blanc-space Locally Source: https://github.com/bbakersmith-grindr/blanc-space/blob/main/README.md Installs the blanc-space library from a local project directory using pip. This is useful for development or when you have the project files available. ```Bash cd blanc-space pip install . ``` -------------------------------- ### Processing Configuration Files with unicodify Source: https://github.com/bbakersmith-grindr/blanc-space/blob/main/README.md Demonstrates how `unicodify` can be used to standardize whitespace in configuration file lines, ensuring consistent parsing. ```Python from blanc_space.unicodify import unicodify config_line = "database_host = localhost" processed = unicodify(config_line) print(processed) # Output: "database_host\u0020=\u0020localhost" ``` -------------------------------- ### Log Analysis with unicodify Source: https://github.com/bbakersmith-grindr/blanc-space/blob/main/README.md Shows how `unicodify` can normalize log entries by replacing tabs with their Unicode representations, aiding in consistent log analysis. ```Python from blanc_space.unicodify import unicodify log_entry = "2023-01-01 10:30:00\tINFO\tApplication started" cleaned = unicodify(log_entry) print(cleaned) # Output: "2023-01-01\u002010:30:00\u0009INFO\u0009Application\u0020started" ``` -------------------------------- ### Alternative Import Styles for unicodify Source: https://github.com/bbakersmith-grindr/blanc-space/blob/main/README.md Shows different ways to import and use the `unicodify` function, either directly or by aliasing the module. ```Python # Import the function directly from blanc_space.unicodify import unicodify # Or import the module from blanc_space import unicodify as uc result = uc.unicodify("Hello world") ``` -------------------------------- ### Basic Usage of unicodify Source: https://github.com/bbakersmith-grindr/blanc-space/blob/main/README.md Demonstrates the core functionality of the `unicodify` function by converting strings containing spaces and tabs into their Unicode escape sequences. ```Python from blanc_space.unicodify import unicodify # Example with spaces text_with_spaces = "Hello world" result = unicodify(text_with_spaces) print(result) # Output: "Hello\u0020world" # Example with tabs text_with_tabs = "Name\tAge\tCity" result = unicodify(text_with_tabs) print(result) # Output: "Name\u0009Age\u0009City" # Example with mixed whitespace mixed_text = "First line\n\tSecond line with spaces" result = unicodify(mixed_text) print(result) # Output: "First\u0020line\n\u0009Second\u0020line\u0020with\u0020spaces" ``` -------------------------------- ### Error Handling for Non-String Input Source: https://github.com/bbakersmith-grindr/blanc-space/blob/main/README.md Demonstrates the `TypeError` raised by the `unicodify` function when a non-string input is provided, along with how to catch this exception. ```Python from blanc_space.unicodify import unicodify try: result = unicodify(123) # This will raise TypeError except TypeError as e: print(f"Error: {e}") # Output: "Error: Input must be a string" ``` -------------------------------- ### Test Blanc-Space unicodify Function Source: https://github.com/bbakersmith-grindr/blanc-space/blob/main/README.md Provides simple test cases for the `unicodify` function in the `blanc_space.unicodify` module. It covers basic functionality, edge cases like empty strings and strings without spaces, and error handling for invalid input types. ```Python # Simple test cases from blanc_space.unicodify import unicodify # Test basic functionality assert unicodify("a b") == "a\u0020b" assert unicodify("a\tb") == "a\u0009b" assert unicodify("a\t b") == "a\u0009\u0020b" # Test edge cases assert unicodify("") == "" assert unicodify("no_spaces_or_tabs") == "no_spaces_or_tabs" # Test error handling try: unicodify(None) assert False, "Should raise TypeError" except TypeError: pass # Expected ``` -------------------------------- ### Debugging CSV Data with unicodify Source: https://github.com/bbakersmith-grindr/blanc-space/blob/main/README.md Illustrates using `unicodify` to reveal inconsistent spacing in CSV data, making it easier to identify formatting issues. ```Python from blanc_space.unicodify import unicodify # Debug CSV data with inconsistent spacing csv_line = "John Doe,25, Software Engineer" print("Original:", repr(csv_line)) print("Unicodified:", unicodify(csv_line)) # Shows: "John\u0020Doe,25,\u0020Software\u0020Engineer" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.