Skip to content

visaplan/visaplan.tools

Repository files navigation

https://travis-ci.org/visaplan/visaplan.tools.svg?branch=master

https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336:target:https://pycqa.github.io/isort/

visaplan.tools

This is a collection of utility modules for Python projects.

Features

  • batches module:

    Support batches, generating (items, label) tuples

  • buildout module, for buildout-built projects:

    Function checkPathForPackage to check a given package against a versions whitelist. Useful if you like to constrain the versions of that package without actually requiring it.

  • 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

  • csvfiles module:

    • provides an excel_ssv dialect (semicolon-separated)
  • dates module:

    • parse dates, supporting multiple formats
  • 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
  • htmlohmy module:

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

    (This module was named ``html`` in earlier releases up to 1.3.x but was renamed due to import problems in Python 3.)

  • http module:

    • extract_hostname (using url.split and raising ValueError)
  • lands0 module:

    • several tools to work with lists and strings
  • lock module:

    • provide the ConvenientLock LockFile context manager, based on zc.lockfile_; specify the lock extra to install the dependencies.
  • minicurr module:

    • pretty minimal currency-related stuff
  • 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
  • sql module:

    • functions for the generation of SQL statements, including insert, update, delete and select.

      The visaplan.zope.reldb package has a copy of this module which uses the SQLAlchemy placeholders convention (:name).

  • times module:

    • functions related to date and/or time calculations
  • words module:

    • A head function to extract the first N characters or words, trying to avoid breaking words (strictly heuristically, for now).

Documentation

The modules are documented by doctests. Apart from this, we don't have real user documentation yet (sorry).

Some of the docstrings are written in German.

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).

About

General tools modules for Python projects

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors