Skip to main content

Pragmatic tools and utilities for Python projects

Project description

Pragmatic tools and utilities for Python projects.

Tested on Python 2.7.

Requirements

Some utilities require additional libraries as:

  • Pillow/PIL

  • pyBarcode

Installation

Using pip: pip install python-pragmatic

Usage

Classes

get_subclasses(classes, level=0)

Return the list of all subclasses for given class (or list of classes).

get_parent_classes(class)

Return the list of all parent classes for given class.

Dates

diff_month(date_from, date_to)

Returns number of months between dates ‘date_from’ and ‘date_to’

diff_days(date_from, date_to)

Returns number of days between dates ‘date_from’ and ‘date_to’

week_range(date)

Returns a tuple of ‘(start_date, end_date)’ of week range by given date.

OS

base64_to_file(content, file_path)

Stores base64 encoded content to file.

Strings

generate_hash(length=5)

Returns random generated string

barcode(code, args=None)

Returns barcode as string encoded in base64 format.

remove_accents(input)

Returns input string without accent characters.

Thirdparty

class BarcodeImageWriter(ImageWriter)

Fixed version of barcode.writer.ImageWriter.

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

python-pragmatic-0.5.0.tar.gz (3.7 kB view details)

Uploaded Source

File details

Details for the file python-pragmatic-0.5.0.tar.gz.

File metadata

  • Download URL: python-pragmatic-0.5.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/2.7.16

File hashes

Hashes for python-pragmatic-0.5.0.tar.gz
Algorithm Hash digest
SHA256 f0bad8f3197069bcdf3726f3f6feac3a6df03600596cf649a66e23b95fb66acc
MD5 4c3262c5a352c79f1fb36ab1057c619a
BLAKE2b-256 1d1c9d48b09ef171bb1795bc73ecaed0c2b9667180b50ecfdc174becb8968caa

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