Skip to main content

A simple utility package for string and math functions

Project description

๐Ÿ”ง LogicTools

๐Ÿง  Overview

LogicTools is a Python package that provides utility functions for string and mathematical operations. It simplifies common tasks like text manipulation and basic calculations for developers.


โœจ Features

๐Ÿ”ค String Utilities

  • ๐Ÿ”  Convert strings to uppercase
  • ๐Ÿ”„ Reverse strings
  • ๐Ÿ”ข Count characters in a string

โž— Mathematical Utilities

  • ๐Ÿงฎ Calculate factorials
  • ๐Ÿ›ก๏ธ Perform division with proper error handling

๐Ÿ“ฆ Installation

Install LogicTools using pip:

pip install logictools

๐Ÿš€ Usage

๐Ÿ”ค String Utilities

from logictools import convert_to_uppercase, reverse_string, character_count

text = "Hello"
print(convert_to_uppercase(text))  # Output: HELLO
print(reverse_string(text))        # Output: olleH
print(character_count(text))       # Output: 5

โž— Mathematical Utilities

from logictools import factorial, divide

# Factorial calculation
print(factorial(5))   # Output: 120

# Division with error handling
print(divide(10, 2))  # Output: 5.0

try:
    print(divide(10, 0))  # Raises ZeroDivisionError
except ZeroDivisionError as e:
    print(f"Error: {e}")

๐Ÿ“ Project Structure

logictools/
โ”‚โ€”โ€” logictools/            
โ”‚   โ”œโ€” __init__.py        
โ”‚   โ”œโ€” math_utils.py      # Math functions (factorial, divide)
โ”‚   โ””โ€” string_utils.py    # String functions
โ”‚
โ”‚โ€”โ€” tests/                 # Unit tests
โ”‚   โ”œโ€” test_math_utils.py
โ”‚   โ””โ€” test_string_utils.py
โ”‚
โ”‚โ€”โ€” .github/               # GitHub Actions CI/CD
โ”‚   โ””โ€” workflows/
โ”‚       โ””โ€” python-package.yml
โ”‚
โ”‚โ€”โ€” .gitignore             
โ”‚โ€”โ€” pyproject.toml         
โ”‚โ€”โ€” README.md              
โ”‚โ€”โ€” LICENSE                
โ”‚โ€”โ€” requirements.txt       

๐Ÿงช Development

โœ… Running Tests

poetry install --with dev
poetry run pytest

๐Ÿ› ๏ธ Building the Package

python -m build

๐Ÿš€ Publishing

๐Ÿ“ฆ Create a GitHub release โœ… The CI/CD pipeline will automatically publish to PyPI


โš ๏ธ Error Handling

The divide function includes:

  • โŒ Division by zero โ†’ ZeroDivisionError
  • ๐Ÿ—พ Invalid input types โ†’ TypeError

๐Ÿ“„ License

This project is licensed under the MIT License. See the LICENSE file for details.


๐Ÿ‘ค Contact


๐Ÿ” Simplify your logic. One tool at a time โ€” LogicTools.

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

logictools-0.1.12.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

logictools-0.1.12-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file logictools-0.1.12.tar.gz.

File metadata

  • Download URL: logictools-0.1.12.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.11.11 Windows/10

File hashes

Hashes for logictools-0.1.12.tar.gz
Algorithm Hash digest
SHA256 74a2612498acbc4058068c8cbe84647f16f8e50ad9f8f9dcdcc575d1330512ff
MD5 b3e57de67da2c6d63f9b2c46d1e139f5
BLAKE2b-256 f078cbc1b5a737ac3fc2aecaec20ad344bcbcfd99d5873f5b2c79268c87f04dc

See more details on using hashes here.

File details

Details for the file logictools-0.1.12-py3-none-any.whl.

File metadata

  • Download URL: logictools-0.1.12-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.11.11 Windows/10

File hashes

Hashes for logictools-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 da3a3dd71255d50d15edc587dd3f8224c7c8fdd836bad6dcd2bf44c46b5ed66b
MD5 898bfb4ae578f9e777ebc55facd8105c
BLAKE2b-256 3f704755959ab7d0b0b1566652653fe3a619aed8774181164e5180ad0a831115

See more details on using hashes here.

Supported by

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