Skip to main content

General Python tools

Project description

This is a collection of utility modules for Python projects.

Features

  • coding module:

    Factory functions to create safe_encode resp. safe_decode functions as needed

  • classes module:

    Several simple but useful classes derived from Python dicts, e.g. Mirror and Proxy

  • debug module:

    • trace_this decorator

  • dicts module:

    • several tools to work with standard dictionaries

  • files module:

    • functions related to files; for now make_mtime_checker

  • html module:

    • HtmlEntityProxy - a dict which returns unicode characters when given a named HTML entity

  • http module:

    • extract_hostname (using url.split and raising ValueError)

  • lands0 module:

    • several tools to work with lists and strings

  • minifuncs module:

    • very small functions, for some cases where functions are used as arguments

  • profile module:

    • a StopWatch context manager and @profile decorator

  • sequences module:

    • tools for sequences, e.g. inject_indexes

  • times module:

    • functions related to date and/or time calculations

Documentation

The modules are documented by doctests. Full documentation for end users can be found in the “docs” folder.

Installation

Simply install visaplan.tools by using pip:

pip install visaplan.tools

or by adding it to your buildout:

[buildout]

...

eggs =
    visaplan.tools

and then running bin/buildout

Contribute

Support

If you are having issues, please let us know; please use the issue tracker mentioned above.

License

The project is licensed under the GNU General Public License v2 (GPLv2).

Contributors

Changelog

1.2.2 (unreleased)

  • new module buildout for use in buildout-built projects: use the checkPathForPackage function to check an installed package against a versions whitelist [tobiasherp]

1.2.1 (2018-09-17)

  • new module dates:

    • make_date_parser factory to create a parse_date function which understands multiple date formats

    • make_date_formatter factory to create a function which formats date, given as a datetime object or a tuple of int

  • new module profile:

    • StopWatch context manager and @profile decorator

  • new module mock:

    • a few small classes for use in doctests

    • the same module as visaplan.plone.tools.mock

  • module debug:

    • new decorators trace_this, log_result

    • new function print_indented

    • new factory function make_sleeper

  • module dicts:

    • new function make_key_injector

  • module minifuncs:

    • new function translate_dummy

  • module sequences:

    • new function nocomment_split

    • new function columns [tobiasherp]

  • module lands0:

    • new function join_stripped

  • License changed to GPLv2

1.2 (2018-07-11)

  • breaking changes:

    • classes: Proxy is now a factory rather than a class

  • modules debug, dicts, lands0, minifuncs [tobiasherp]

1.1 (2018-06-12)

  • modules sequences, times, files

  • Minor Bugfixes [tobiasherp]

1.0 (2018-06-11)

  • Initial release, including modules classes, html, http and coding [tobiasherp]

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

visaplan.tools-1.2.2.dev1.tar.gz (52.6 kB view details)

Uploaded Source

File details

Details for the file visaplan.tools-1.2.2.dev1.tar.gz.

File metadata

  • Download URL: visaplan.tools-1.2.2.dev1.tar.gz
  • Upload date:
  • Size: 52.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/2.7.5

File hashes

Hashes for visaplan.tools-1.2.2.dev1.tar.gz
Algorithm Hash digest
SHA256 a9f1749196456e1a0b245aac593fb33258ca9f0bcf942bda376927721541fa6e
MD5 32a88acd2b85e1274659d91113117ac1
BLAKE2b-256 03c00411f4e1cdc05bf14f7dcb3db577026f7005bfcf9d72773967730ded9255

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