Skip to main content

A comprehensive Python math utility library for interviews and competitive programming.

Project description

infe

PyPI version License: MIT Python Tests

A professional, comprehensive Python math and string utility library for interviews, competitive programming, and educational purposes.

Features

🔢 Basic Operations

  • is_even, is_odd, is_positive, is_negative
  • swap, largest_of_three, sum_first_n
  • factorial, power, multiplication_table
  • sum_even_range, sum_odd_range

🔢 Digit-Based Programs

  • count_digits, reverse_number, sum_digits, product_digits
  • is_palindrome_number, is_disarium, is_neon, is_spy
  • is_duck, is_harshad, max_digit, min_digit
  • count_eo_digits (Even/Odd count), sum_even_digits, sum_odd_digits

🔢 Primes & Factors

  • is_prime, primes_in_range, sum_primes, prime_factors
  • gcd, lcm, are_coprime, is_composite

🔢 Special Numbers

  • is_armstrong, is_perfect, is_abundant, fibonacci_series
  • is_strong (formerly Krishnamurthy), is_happy, is_magic
  • is_perfect_square, is_perfect_cube, is_triangular

🔤 String Utilities

  • count_vc (Vowels/Consonants), no_spaces, char_freq
  • dup_chars, is_anagram, first_non_rep, first_rep

📋 List/Array Utilities

  • max_list, second_max, unique (Remove duplicates)
  • rotate_left, rotate_right

Installation

pip install infe

Usage

import infe

# Check for a Strong (Krishnamurthy) number
print(infe.is_strong(145))  # True

# String operations
v, c = infe.count_vc("Hello World")
print(f"Vowels: {v}, Consonants: {c}")

# List operations
my_list = [10, 20, 30, 20, 10]
print(infe.unique(my_list))  # [10, 20, 30]

Running Tests

pip install pytest
pytest

License

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

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

infe-0.1.1.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

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

infe-0.1.1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file infe-0.1.1.tar.gz.

File metadata

  • Download URL: infe-0.1.1.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.4

File hashes

Hashes for infe-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2b97e388ac4e21906dff2cb6a17883fd3ec16577286f0958a399fb509d73502a
MD5 2ed5206f80325a8e6650271f3389d2df
BLAKE2b-256 dfbcad2b917c29c0d99d785918662e9db630a80d72806157acb2d9646cf04649

See more details on using hashes here.

File details

Details for the file infe-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: infe-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.4

File hashes

Hashes for infe-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 53af8254faca35064feb4138f7970c2f3d6ce24502b54d681588deef972e2ac2
MD5 93632cd3117c25369be60dee9e2194d4
BLAKE2b-256 378993fc9445d4fb387190acf1fa1f8c9581a950b87dd6b2b45d29fa967ff1d7

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