Skip to main content

JustBard's Python Utilities

Project description

jblib

Author: Justin Bard

This module was written to minimize the need to write the functions I use often.

INSTALL: python3 -m pip install jblib


The source code can be viewed here: https://github.com/ANamelessDrake/jblib

More of my projects can be found here: http://justbard/com


import jblib

    class cd()

        Example: 
            with cd(directory):
                print (os.getcwd()) 

            print (os.getcwd()) ## Back at the originating directory on exit
    class hilight(string).color(highlight=True, bold=True)

        Example:
            print (hilight("Hello World").red(bold=True))

            Or you could make an object:
                text = hilight("Bar")

                print ("Foo "+text.blue())

            To return the original string:
                print (text.string)

        Available Colors:
            red
            green
            yellow
            blue
            purple
            teal
            white

import convert_module

    Module to convert various data

            def convert_time_from_seconds(seconds_given)
                Converts a seconds into minutes, hours and days. 

            def IP2Int(ip)
                Converts a IPv4 address to a interger - This is useful to store IP addresses in databases

            def Int2IP(ipnum)
                Converts a interger back to an IPv4 address

            def urlcode(url, encode=False)
                Wrapper for urllib.parse.quote and urllib.parse.unquote.
                From urllib docs - Replace special characters in string using the %xx escape. Letters, digits, and the characters '_.-' are never quoted. By default, this function is intended for quoting the path section of URL. 
                - https://docs.python.org/3.1/library/urllib.parse.html?highlight=urllib#urllib.parse.quote

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

jblib-1.6.27.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

jblib-1.6.27-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file jblib-1.6.27.tar.gz.

File metadata

  • Download URL: jblib-1.6.27.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for jblib-1.6.27.tar.gz
Algorithm Hash digest
SHA256 825ae1e358ca996b072763c97e24279a098cc597f215ba0af958f653ea13025a
MD5 c670c171972b5c348c3531873cd927f0
BLAKE2b-256 955be0ad7c052481540aad904f97e1a540c54bc82e6a27dbd04fa08c167532bf

See more details on using hashes here.

File details

Details for the file jblib-1.6.27-py3-none-any.whl.

File metadata

  • Download URL: jblib-1.6.27-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for jblib-1.6.27-py3-none-any.whl
Algorithm Hash digest
SHA256 f03e0f166c5043f4aa55dec2135bf3038dce48d1ac1d83072a69b9fe15f765a3
MD5 a932758a58d40bca690564429de232d9
BLAKE2b-256 e31064f036849bf63cbb2651381c6b9bd2c5a72bfa7b20aed58262d77baad8ea

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