Skip to main content

py-simple-wrap ๐Ÿš€

All Contributors

Making Python feel like plain English.

PyPI Docs License: MIT GitHub stars

py-simple-wrap is a beginner-friendly Python wrapper package designed to help beginners and developers perform common tasks using simple, intuitive functions.

The goal of this project is to remove the need for memorizing complex syntax or writing repetitive boilerplate code, making Python more accessible and enjoyable for everyone.

You'll love py-simple-wrap if:

Typing SVG

Before and After

๐Ÿ˜ฐ The traditional way

import requests
from bs4 import BeautifulSoup

try:
    response = requests.get('https://github.com', timeout=10)
    response.raise_for_status()
    page = BeautifulSoup(response.content, 'html.parser')
    title = page.title.string
except Exception as e:
    print("The site is down or address is invalid.")

๐Ÿ˜Ž The py-simple-wrap way

from py_simple import get_page_title

print(get_page_title("https://github.com"))

๐Ÿ› ๏ธ Installation

pip install py-simple-wrap
from py_simple import make_blank_file, miles_to_km, is_valid_email

make_blank_file("notes.txt")
print(miles_to_km(26.2))                    # 42.16...
print(is_valid_email("hello@example.com"))  # True

Full walkthrough in QUICKSTART.md, or browse the full documentation site.

โญ If py-simple-wrap made something easier for you

Consider giving it a star โ€” it helps other beginners find it, and it genuinely makes my day. And if there's a function you wish existed, fork it and add it; this project grew because other people did exactly that. Every module below started here, except easy_strings, which came from a contributor.


๐Ÿ› ๏ธ Module Menu

py-simple-wrap provides simple modules designed to make common Python tasks easier.

๐Ÿ“‚ Easy File Manager

Click to expand โ€” file operations without the os boilerplate
Function What it does
make_blank_file("notes", "txt") Create an empty file
is_file_there("notes.txt") Check if a file exists
add_a_line("notes.txt", "hello!") Append a line to a file
read_file_to_list("notes.txt") Read lines into a list
remove_file("notes.txt") Delete a file
rename_file("old.txt", "new.txt") Rename a file
copy_file("src.txt", "dst.txt") Copy a file
list_files() / list_files("txt") List files, optionally by extension

๐Ÿ•ฐ๏ธ Easy Date Formatter

Click to expand โ€” readable dates without memorizing strftime codes

Get the current date in any format:

Function Example output
get_pretty_date() Friday, July 31, 2026
dd_mm_yyyy() 31-07-2026
mm_dd_yyyy() 07-31-2026
slash_dd_mm_yyyy() 31/07/2026
slash_mm_dd_yyyy() 07/31/2026

Need past or future dates? Add past_ or future_ to any function above and pass the number of days:

Pattern Example
past_<format>(7) past_pretty_date(7) โ†’ one week ago
future_<format>(30) future_dd_mm_yyyy(30) โ†’ 30 days from now

Also available: list_available_formats() to see all supported format names.

๐Ÿ”ข Easy Numbers

Click to expand โ€” number checks and calculations without the mental math
Function What it does Example
is_even(n) Check if a number is even is_even(90) โ†’ True
is_odd(n) Check if a number is odd is_odd(67) โ†’ True
is_positive(n) Check if a number is positive is_positive(90) โ†’ True
is_negative(n) Check if a number is negative is_negative(-10) โ†’ True
is_prime(n) Check if a number is prime is_prime(2) โ†’ True
is_evenly_divisible(n, d) Check if n divides evenly by d is_evenly_divisible(90, 9) โ†’ True
average(nums) Average of a list, rounded to 2 decimals average([1.5, 2, 3]) โ†’ 2.17
percentage_of(n, p) Get a percentage of a number percentage_of(100, 0.5) โ†’ 50.0
round_to_nearest(n, m) Round to the nearest multiple round_to_nearest(23, 5) โ†’ 25.0
greatest_common_divisor(a, b) Find the GCD of two numbers greatest_common_divisor(12, 18) โ†’ 6
clamp(n, min, max) Keep a number within a range clamp(15, 0, 10) โ†’ 10

๐Ÿ”ค Easy Strings

Click to expand โ€” string operations that read like English
Function What it does Example
remove_extra_spaces(text) Strip leading, trailing, and double spaces remove_extra_spaces(" hello world ") โ†’ "hello world"
to_snake_case(text) Convert to snake_case to_snake_case("Hello World") โ†’ "hello_world"
to_kebab_case(text) Convert to kebab-case to_kebab_case("Hello World") โ†’ "hello-world"
is_palindrome(text) Check if text reads the same backwards is_palindrome("Never odd or even") โ†’ True
is_alphanumeric(text) Check if text is letters and numbers only is_alphanumeric("Something123") โ†’ True
count_words(text) Count the number of words count_words("Hello world! How are you?") โ†’ 5

๐Ÿ”„ Easy Converter

Click to expand โ€” unit conversions without memorizing formulas

Time

Function Example
seconds_to_hh_mm_ss(3665) "01:01:05"
hh_mm_ss_to_seconds(1, 1, 1) 3661

Distance & Length

Function Example
km_to_mile(100) 62.13
miles_to_km(100) 160.93
meters_to_feet(100) 328.08
feet_to_meters(328.08) 100.0
cm_to_inches(100) 39.37
inches_to_cm(39.37) 100.0

Weight

Function Example
kg_to_lb(5) 11.02
lb_to_kg(110.23) 50.0

Temperature

Function Example
celsius_to_fahrenheit(25) 77.0
fahrenheit_to_celsius(104) 40.0

Volume

Function Example
fluid_oz_to_ml(1, standard='us') 29.6
fluid_oz_to_ml(1, standard='uk') 28.4
ml_to_fluid_oz(1, standard='us') 0.03
ml_to_fluid_oz(1, standard='uk') 0.04

Area

Function Example
sq_meters_to_sq_feet(10) 107.64
sq_feet_to_sq_meters(107.64) 10.0

Speed

Function Example
mph_to_kph(0.621371) 1.0
kph_to_mph(1.60934) 1.0

โœ… Easy Validator

Click to expand โ€” input validation without regex memorization
Function What it checks Example
is_valid_email(str) Valid email format is_valid_email("hello@world.com") โ†’ True
is_valid_username(str) Letters, numbers, and underscores only is_valid_username("user_name") โ†’ True
is_valid_url(str) URLs with http, https, or www is_valid_url("www.google.com") โ†’ True
is_valid_zipcode(int) 5-digit US zip code is_valid_zipcode(12345) โ†’ True
is_password_secure(str) 8+ chars, upper, lower, digits, special, no repeats is_password_secure("1andkrf!AG5") โ†’ True

๐ŸŒ Easy Web

Click to expand โ€” web scraping and checks without the requests/BS4 boilerplate
Function What it does Example
is_page_up(url) Check if a site returns 200 is_page_up("https://github.com") โ†’ True
get_page_title(url) Get the page title get_page_title("https://github.com") โ†’ "GitHub ยท ..."
get_page_content(url) Get prettified HTML get_page_content("https://google.com")
count_links(url) Count links on a page count_links("https://github.com") โ†’ 144
get_link_list(url) Get all links as a list get_link_list("https://github.com") โ†’ [...]
count_tags(url, tag) Count tags of a given type (e.g. 'a', 'img') count_tags("https://github.com", "img") โ†’ 12
get_tag_list(url, tag) Get useful info from each matching tag get_tag_list("https://github.com", "img") โ†’ [...]
print_allowed_tags() Print the supported tag โ†’ attribute map print_allowed_tags() โ†’ {'a': 'href', 'img': 'src'}
get_meta_description(url) Get all meta tag contents get_meta_description("https://github.com") โ†’ [...]
get_all_headers(url) Get text from all <header> tags get_all_headers("https://github.com") โ†’ [...]

๐ŸŽจ Easy Colors

Click to expand โ€” hex and RGB conversions without the manual math
Function What it does Example
is_valid_hex(str) Check if a string is a valid hex color is_valid_hex("#FFFFFF") โ†’ True
hex_to_rgb(str) Convert hex to (R, G, B) tuple hex_to_rgb("#FFFFFF") โ†’ (255, 255, 255)
rgb_to_hex(r, g, b) Convert RGB to hex string rgb_to_hex(255, 255, 255) โ†’ "#FFFFFF"

๐Ÿ”„ Easy Flow

Click to expand โ€” run Python files and time function calls without the boilerplate
Function What it does Example
run_py_file(filename) Run a .py file as __main__ run_py_file("script.py")
time_function_call(function, args=None) Runs a function once and returns how long it took, in seconds time_function_call(add, [2, 3]) โ†’ 0.000002

๐Ÿ“„ Easy JSON

Click to expand โ€” JSON file handling without the boilerplate
Function What it does Example
open_json(path) Read a JSON file into a dict open_json("config.json")
save_json_data(path, dict) Save a dict to a new JSON file save_json_data("config.json", {"name": "Sara"})
update_json(path, dict) Merge new data into an existing JSON file update_json("config.json", {"name": "Sara"})
pretty_json(data=dict) Pretty-print a dict as indented JSON pretty_json(data={"name": "Sara"})
pretty_json(filepath=path) Pretty-print a JSON file's contents pretty_json(filepath="config.json")
is_json_file(path) Check if a file exists and is .json is_json_file("config.json") โ†’ True
is_nested_json(data=dict) Check if a dict has any nested dicts/lists is_nested_json(data={"a": 1, "b": {"c": 2}}) โ†’ True
flatten_json(data=dict) Flatten a nested dict into single-level keys flatten_json(data={"a": 1, "b": {"c": 2}}) โ†’ {"a": 1, "b-c": 2}

๐Ÿ” Easy Regex

Click to expand โ€” pull common patterns out of text without writing regex
Function What it does Example
extract_emails(text) Find all email addresses in text extract_emails("Contact hello@example.com") โ†’ ['hello@example.com']
extract_urls(text) Find all URLs in text extract_urls("Visit www.example.com") โ†’ ['www.example.com']
extract_number_sequences(text) Find number sequences joined by -, _, :, or . (dates, times, IPs, IDs) extract_number_sequences("IP 192.168.1.1 at 14:32") โ†’ ['192.168.1.1', '14:32']
extract_numbers(text) Find all standalone digit sequences extract_numbers("I have 3 cats and 12 fish") โ†’ ['3', '12']

โšก Easy Async

Click to expand โ€” run multiple functions at the same time without touching ThreadPoolExecutor directly
Function What it does Example
run_at_the_same_time_no_params(functions) Runs multiple zero-argument functions at the same time run_at_the_same_time_no_params([add, sub]) โ†’ [('add', 2), ('sub', 2)]
run_at_the_same_time_with_params(functions_and_args) Runs multiple functions at the same time, each with its own arguments run_at_the_same_time_with_params([(add, 1, 1), (sub, 4, 2)]) โ†’ [('add', 2), ('sub', 2)]

๐Ÿค Contributing

I would love to have your help in making Python simpler for everyone!

Contributions of all sizes are welcome:

  • Fix documentation
  • Improve existing modules
  • Suggest new features
  • Add new functionality
  • Improve examples

Please check CONTRIBUTING.md before submitting changes.

Every contribution helps make py-simple-wrap better for beginners and developers.


๐Ÿค Contributors

A huge thank you to these wonderful people for helping make Python simpler for everyone!

Emoji Key:

  • ๐Ÿ’ป = Code
  • ๐Ÿ“– = Docs
  • ๐Ÿ› = Bug Reports
  • ๐Ÿงช = Tests
  • ๐Ÿš‡ = Infrastructure
  • ๐Ÿ›ก๏ธ = Maintainer
  • ๐Ÿ‘‘ = Original Author
  • ๐Ÿš€ = Project Management
  • โœ‹ = Collaborators
Sara Czasak
Sara Czasak

๐Ÿ›ก๏ธ ๐Ÿš€ ๐Ÿ’ป ๐Ÿ“– ๐Ÿ‘‘ โœ‹
jagjitkaur0000
jagjitkaur0000

๐Ÿงช โœ‹
atiqur rahman
atiqur rahman

๐Ÿงช โœ‹
Gaohar Imran
Gaohar Imran

๐Ÿงช ๐Ÿ’ป โœ‹
Yassin Azzouzi
Yassin Azzouzi

๐Ÿ“– โœ‹
ghostfix-pm
ghostfix-pm

๐Ÿš‡ ๐Ÿงช ๐Ÿ’ป ๐Ÿ“–
Pranjal Solanki
Pranjal Solanki

๐Ÿ’ป
Shivam Singh
Shivam Singh

๐Ÿ“– ๐Ÿงช ๐Ÿ’ป
Challa Leela Prasad
Challa Leela Prasad

๐Ÿ’ป
HeaTTap
HeaTTap

๐Ÿ“– ๐Ÿงช ๐Ÿ’ป
Avery Quinn
Avery Quinn

๐Ÿงช
Marcos Max
Marcos Max

๐Ÿ“–
Matheus
Matheus

๐Ÿงช
Mlandvo Maphalala
Mlandvo Maphalala

๐Ÿงช ๐Ÿ›

This project follows the all-contributors specification. Contributions of any kind welcome!


โš–๏ธ License

This project is licensed under the MIT License.

You are free to use, modify, and distribute it.

See the LICENSE.md file for the full legal text.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_simple_wrap-0.2.0.tar.gz (47.4 kB view details)

Uploaded Source

Built Distribution

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

py_simple_wrap-0.2.0-py3-none-any.whl (30.8 kB view details)

Uploaded Python 3

File details

Details for the file py_simple_wrap-0.2.0.tar.gz.

File metadata

  • Download URL: py_simple_wrap-0.2.0.tar.gz
  • Upload date:
  • Size: 47.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.10

File hashes

Hashes for py_simple_wrap-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8b9eebdccdf91fb0381ebd03dc5f3bf6cb70d68ea2ef6595899aad65e69e99d5
MD5 616f9911c85df5da819419a2db50710d
BLAKE2b-256 68752ba4f6fb9931ba64697b7f1392ff99bb25d8c9e3b3b1321a84555e3cdf29

See more details on using hashes here.

File details

Details for the file py_simple_wrap-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: py_simple_wrap-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 30.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.10

File hashes

Hashes for py_simple_wrap-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d60f16170c8c9f0f5c30bfc94365087ba27b5aa1f6f8bbeaa322636022cb8340
MD5 e0fa898e99e41315e9a01e7b64a95254
BLAKE2b-256 43e16a5447ac932ac11965b9512cd28d99c7ea0172eb9e2cf121f88902d85864

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