Skip to main content

Tools for Python scripts or terminal

Project description

invesytoolbox

A set of useful tools, created for my own convenience.

Why "invesy"? Invesy (from German Inhaltsverwaltungssystem == content management system) is a closed source cms I created with Thomas Macher. It's only used in-house, that's why we didn't bother making it open source.

Invesy runs on Zope, so most of the individual website's logic runs in restricted Python. That's one reason for this toolbox: providing a set of useful functions in one single package which can be allowed in our restricted Python environment without having to allow a long list of external packages. Also some packages, while being importable, contain functions or methods not usable in restricted Python (like bs4's prettify).

That's also why all date and time functions also take into account the old DateTime (as opposed to datetime) package, on which Zope is still relying upon heavily.

The documentation can be found here.

History

0.0.23 (2024-07-22)

  • adjust_spaces_on_punctuation: inserts narrow (or normal spaces) for certain languages
  • value_2datatype:
    • default fmt changed to None (hopefully it doesn't break somewhere, but this is necessary)
    • 'pendulum' is now an option for the parameter
  • default for parameter fmt changed to None (this is necessary for the new pendulum conversion in value_2datatype to work) for
    • dict_2datatypes
    • dictlist_2datatypes

0.0.22 (2023-10-14)

  • normalize_name and could_be_a_name now have the boolean parameter lastname that indicates that a single-word name is to be treated as a last name, not a first name.
  • get_locale: locale can be only the language, without the country.
  • if get_locale fails to get the locale from the system (because invesytoolbox may be imported from a program called from an applicatio rather than the termial), it defaults to language: 'de' and country: 'AT'.
  • added support for pendulum DateTime
  • create_email_message: fixed MIMEMultipart settings

0.0.21 (2023-05-21)

  • New function unravel_duration: turns a duration string (for ex. '5T23:05:20') into a list or dictionary.

0.0.20 (2023-05-06)

  • New function add_time: adds (or subtracts) time to (or from) datetime and DateTime

0.0.19 (2023-04-07)

  • Corrected bug in fetch_holidays (argument length resulted in an error)

0.0.18 (2023-04-07)

  • new function change_h_tags (in new module itb_html)

0.0.17 (2023-03-01)

  • new function compare_phonenumbers: compares two phone numbers after normalizing them (process_phonenumber).

0.0.16

  • map_special_chars: works now.

0.0.15

  • could_be_a_name: can now handle names with multiple parts like "Robert De La Mancha". Per word, 2 capitals are allowed (i.e. "MacArthur" or "DeLa Cruz)

0.0.14

  • could_be_a_name and sort_names: now working also with prename-only and prenames including a hyphen.

0.0.13

  • get_dateformat now also processes time
  • str_to_dt now checks for valid string
  • is_valid_datetime_string: wrapper for checking with str_to_dt
  • remove_time from datetime or DateTime

0.0.12

  • removed documentation from the README file, instead a link to the gitlab pages
  • map_specialChars now recognizes Unicode character U+0308 (UTF-8 cc 88 = "COMBINING DIAERESIS").
  • any_2boolean
  • get_dateformat: argument checkonly
  • data functions: argument json_data changed to metadata (it's a dictionary)

0.0.11

  • BeautifulSoup and nameparser added to requirements.txt
  • Removed "Date" conversions (modified DateTime) because it's a bad idea
  • normalize_name (using nameparser) added to itb_text_name
  • capitalize_name rewritten (now quasi a wrapper for normalize_name)
  • could_be_a_name rewritten using normalize_name (nameparser)

0.0.10

  • check_spam for web forms
  • dictlist_2datatypes: iterates through a list of dictionaries and applies dict_2datatypes
  • prettify_html: provides prettify from BeautifulSoup, because it can't be used directly from restricted Python.
  • could_be_a_name: checks if a string could be a name

0.0.9

  • change_query_string respects Zope parameter converters (like paramname:int)

0.0.8

  • New submodule www
    • change_query_string

0.0.7

  • shorter submodule names (no _tools suffix)
  • is_holiday works without argument
  • create_email_message: new argument encoding
  • process_phonenumbers: cleaned up arguments
  • DT_date: strip a DateTime of its time (get a "naked" date)
  • could_be_a_name: check if a string could possibly be a name

0.0.6

  • renamed capitalize_text to capitalize_name and removed name argument
  • added Sphinx documentation

0.0.5 (2022-06-11)

  • removed terminal_tools (will be included in a separate package)

0.0.4 (2022-06-09)

  • better formatted README

0.0.3 (2022-06-09)

  • updated README (list of functions and a short description)

0.0.2 (2022-06-09)

  • removed VERSION file

0.0.1 (2022-06-09)

  • first version

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

invesytoolbox-0.0.23.tar.gz (37.5 kB view details)

Uploaded Source

File details

Details for the file invesytoolbox-0.0.23.tar.gz.

File metadata

  • Download URL: invesytoolbox-0.0.23.tar.gz
  • Upload date:
  • Size: 37.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.9

File hashes

Hashes for invesytoolbox-0.0.23.tar.gz
Algorithm Hash digest
SHA256 5ee206da87eb249d81f0e6402769d6e798cfcde20c9198887b25c419be1ced1b
MD5 b620d5a9ee006b8c51b1ea77a4ff6a98
BLAKE2b-256 3e363157ff18de158e9196de220a82674fbcd5140e858c4c0ff8f3f50a4a7ab9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page