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’

Numbers

round_to_n_decimal_places(value, n)

Returns number rounded to n decimal places.

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.2.0.tar.gz (3.4 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for python-pragmatic-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9e2a5a279f0dcc4a0c6834c2d51ec9820e04e9d821b4b92d0bef0471581622d7
MD5 d259498ef7629835288df48def872116
BLAKE2b-256 c5f25c5b9dc8c7884c944e8d3f4e943984204813067c564c4464a512fbf0b5ff

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