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.0.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.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: funclibrary-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 06b5cbcc99331e831401371404ea53e464191e7b392b04f0101a5c9038f6669a
MD5 2ed5fb6130ab8c69ff6f9bba5e692085
BLAKE2b-256 ba9b1edfe5be5c137d7d9b07517735b7b303ac5a02ad8ba13303fe25489a6444

See more details on using hashes here.

File details

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

File metadata

  • Download URL: funclibrary-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c6be81f3ff2df888a8ec6082ebcfa52fd54664793be5a5b51d1088cd322448cb
MD5 df38b94b526026617b5611461d3025b1
BLAKE2b-256 c2181c9e0ef49116ed0f26034ae6dc88f6c8d8fb0adbfeb0d7d42a6cccdab837

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