Skip to main content

A simple Python string utilities library

Project description

🧵 PyStringLite

A lightweight educational Python library that re-implements some of the most commonly used built-in string methods — manually, without using Python's internal string functions.

⚡ Great for learning how core string functions work under the hood! 📦 Available on PyPI (soon)

✨ Features

✅ Capitalization (capitalize) ✅ Counting substrings (count) ✅ Checking character types (isdigit, islower, isupper) ✅ Find & Index (find, index) ✅ Replace occurrences (replace) ✅ Strip whitespace (lstrip, rstrip) ✅ Split string from right (rsplit) ✅ Swap case (swapcase)

All functions are implemented using basic Python logic (loops, ASCII checks, slicing) — no shortcuts using built-ins.

🚀 Installation

Once you upload to PyPI, users will install with:

pip install funcLibrary

📚 Usage Example

import funcLibrary.string_methods as psl

print(psl.capitalize("hello"))           # Hello
print(psl.count("lo", "hello world"))    # 1
print(psl.endswith("world", "hello world"))  # True
print(psl.find("lo", "hello"))           # 3
print(psl.isdigit("12345"))              # True
print(psl.islower("hello"))              # True
print(psl.isupper("HELLO"))              # True
print(psl.replace("lo", "L0", "hello", 1)) # heL0o
print(psl.rstrip("hello   "))            # "hello"
print(psl.lstrip("   hello"))            # "hello"
print(psl.swapcase("Hello"))             # hELLO

🎯 Why This Library?

Python's built-in string methods are optimized and complex inside CPython. This project:

🔍 Helps you understand string manipulation logic 🎓 Serves as a learning tool for new developers 💡 Shows how things work “behind the scenes”

🔬 Benchmarks

These functions are not meant to replace Python’s built-ins for performance — this is an educational project.

But hey, you're free to benchmark and compare 😉

You already imported perf_counter — maybe later add a bench.py to compare your

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

funclibrary-0.1.1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

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

funclibrary-0.1.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for funclibrary-0.1.1.tar.gz
Algorithm Hash digest
SHA256 396721258d56e963af91d91ad0060b7e6102959d59a647c9677ed8c449861e14
MD5 815031e8a32bffba440285a15d399574
BLAKE2b-256 edfb3687cd33c893a43d033ec9ca08794f9b246e5edf1e67787f89078a200f14

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for funclibrary-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3933fa2c95ec2ec5ba6e6e00b075a9a1a4fdf7a9967e2eb627436b5ad8497302
MD5 f14cf0c9aa0be5d87982a88ccf3e2c3e
BLAKE2b-256 f159ff001fe1e40f2ba76f92c647f7fc04fe0523c1d9c265db634662505a1b50

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