Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

TechWiz-3/python-utils

Repository files navigation

Random python utils I'm making for my own use. Also using this to apply some basic OOP

pip install wise-py-utils
>>> from wise.<util_file> import <UtilClass>
# Example:
>>> from wise.datetimeutils import GetDay

Enter the specific directory to get more about each utility.

πŸ—“οΈ datetime-utils

Returns a string containing the weekday of the current or specified date.

πŸ’» cpu-utils

πŸ“ typo-remover

In depth info

Datetime utils

The python datetime module is very versatile however as shown in this stackoverflow answer. Getting a date's weekday as a string is not so simple. Python's datetime. datetime.weekday() returns an integer, 0 for Monday ... ... and 6 for Sunday.

This module allows me to get a string containing the date (current or otherwise specified) with a single method.

Examples

Simply get the current day of the week

today = GetDay()
print(today.get_weekday())
Output:
'Saturday'

Get the day of a specified date

from datetime import datetime
today = GetDay(datetime(2017, 2, 2))
print(today.get_weekday())
Output:
'Thursday'

Get the day based on the weekday number using the `get_weekday_from_number() classmethod

>>> import datetime
>>> number = datetime.datetime.today().weekday()
>>> print(number)
1
>>> print(GetDay.get_weekday_from_number(number))
'Tuesday'

Enter typos

Often when hitting enter, I accidentally hit a key next to it. Often the resulting input can end up looking like this.

characters = ["/", "'" "\" "]"]
input = "<regular input> <random-character><enter>"

This library is designed to remove trailing special characters from strings and integers and return what the user actually mean to enter.

Scan files

Scans a specified file for a regex or string pattern and returns a list of all the results`

About

Random python utils I'm making for my own use. Also using this to apply some basic OOP

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /