Skip to main content

Functions and classes for many purposes, that I use all the time in multiple programs.

The fact that these are just bits and pieces does not prevent them from having bugs, so they are under version control at http://code.google.com/p/bag

The library is tested on Python 2.7 and 3.3.

Most important library contents

  • bag.csv2 – The infamous csv Python module does not support unicode; problem solved.

  • bag.csv3 – In web apps, uploaded files come as byte streams, so we provide a decoding generator. If you’d like the order of the CSV columns not to matter, there is a header-based reader. There is also a buffered CSV writer for outputting CSV in a web app.

  • bag.email_validator – The ultimate functions for email validation and domain validation, as well as an email address harvester.

  • bag.file_id_manager – Use this to hash your files, store the hashes, and know when you already have some file.

  • bag.web.transecma – Complete solution for javascript internationalization. Compatible with jquery templates. Includes transecma.js.

  • bag.web.web_deps – Ensure your javascript libraries and CSS stylesheets appear in the right order, and require them from different parts of your code.

If you use the Pyramid web framework

  • bag.web.pyramid.flash_msg – Advanced flash messages scheme for Pyramid.

  • bag.web.pyramid.locale – Easily enable and disable locales, let users switch languages, and use the browser’s languages by default.

  • bag.web.pyramid.plugins_manager – Make your Pyramid app extensible through plugins.

  • bag.web.pyramid.starter – Reusable configurator for starting up Pyramid web applications.

  • bag.web.pyramid.genshi – Use the Genshi templating language with the Pyramid web framework.

  • bag.web.pyramid.kajiki – Use the Kajiki templating language with the Pyramid web framework.

Less important library contents

  • bag.bytes_box – Wraps an Image in another object that can instantiate it from a number of sources (bytes, files etc.) and then copy, resize or write it. The interface is experimental but seems to be very convenient.

  • bag.file_watcher – Watches a bunch of files and when one of them is modified, runs a callback. Also useful for reloading Python modules when they are altered.

  • bag.log – Convenient logging initialization.

  • bag.html – Encode and decode HTML and XML entities.

  • bag.memoize – Memoize decorator with a LRU (least recently used) cache, which can take a keymaker function as an argument.

  • bag.more_codecs – Got text in some weird encoding that Python doesn’t know? OK, use iconv to decode it.

  • bag.percentage_done – Don’t leave your user wondering if your program is hanging; print the percentage of work done every few seconds.

  • bag.sqlalchemy.context – Convenient SQLALchemy initialization, at last.

  • bag.text – Functions for working with unicode strings.

Metadata

Release files for bag 0.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bag 0.3.3
File Size Uploaded
bag-0.3.3.tar.gz 65.9 kB Details

Release files / bag-0.3.3.tar.gz

Download URL bag-0.3.3.tar.gz
Size 65.9 kB
Tags Source
SHA-256 checksum
How to use checksums
92bb30f945bdc8e32934d370ac81df4c240182d98675be4219f4e97829051a5f
BLAKE2b-256 checksum
How to use checksums
6d043f6d5c781d6e0a4bf4fba366a0207282795ddaafb7ee0599d2e79d17e39f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

5.0.1

2 release files

5.0.0

2 release files

4.0.0

2 release files

3.1.0

2 release files

3.0.0

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.3.0

2 release files

1.2

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.9.0

2 release files

0.8.0

1 release file

0.7.0

1 release file

0.6.1

1 release file

0.6.0

1 release file

0.5.0

1 release file

0.4.5

1 release file

0.4.4

1 release file

0.4.3

1 release file

0.4.2

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.12

1 release file

0.3.11

1 release file

0.3.10

1 release file

0.3.9

1 release file

0.3.8

1 release file

0.3.7

1 release file

0.3.6

1 release file

0.3.5

1 release file

0.3.4

1 release file

This release

0.3.3 This release

1 release file

0.3.2

1 release file

0.3.1

0.3

0.2.0

0.1.2

0.1.1

0.1.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page