Skip to main content

bag library

bag contains code for many purposes, which I find myself reusing in multiple programs – so this code must be version-controlled. I use SQLAlchemy and Pyramid a lot.

Documentation is at http://docs.nando.audio/bag/latest/

The library, tested on Python 3.4 and 3.5, is hosted at https://github.com/nandoflorestan/bag where you can do your bug reports and pull requests.

  • bag 0.8.0 is the last version that supported Python 2.6.

  • bag 0.9.0 is the last version that supported Python 2.7. Many modules probably still work with Python 2.7, but I do not intend to bother testing on Python 2 anymore.

This version of bag was published with releaser.

Most important library contents

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

  • bag.spreadsheet – Import CSV and Excel spreadsheets based on headers on the first row. 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.pathlib_complement – A Path subclass that does what pathlib doesn’t do.

  • bag.subcommand – Use argh to dispatch to subcommands with their command-line arguments.

  • bag.web.burla – Powerful URL generation independent of web frameworks, working in Python and in the client (Javascript) too. Also provided is Pyramid integration for it.

  • bag.web.flash_msg – Advanced flash messages for any web framework. Also provided is Pyramid integration.

  • 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

If you use SQLAlchemy

Commands

  • delete_old_branches – Deletes git branches that have already been merged onto the current branch. Optionally, filter the branches by age (in days).

  • reorder_po – Reorders .po files (usually after transifex messes up the order of the translations in them) so the diff is always readable.

Less important library contents

  • bag.check_rst – Verifies reStructuredText content for correctness.

  • bag.console – Functions for user interaction at the console.

  • bag.corrupt_image – Read image files and do something if they are corrupt.

  • bag.file_existence_manager – Tools for finding duplicate files using hashes.

  • 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.show_progress – Don’t leave your user wondering if your program is hanging; print the progress every few seconds.

  • bag.streams – Functions that use streams (open files).

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

  • bag.text.words – Contains lists of nouns and adjectives and can generate a random combination words – good for generating funny test data.

  • bag.time – Functions to make it easier to work with datetimes. Includes a JSON encoder that supports time, datetime and Decimal.

Metadata

Release files for bag 1.0.0

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 1.0.0
File Size Uploaded Provenance Actions
bag-1.0.0.tar.gz 116.2 kB Without provenance Details for bag-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bag 1.0.0
File Interpreter ABI Platform Actions
bag-1.0.0-py2.py3-none-any.whl Python 3, Python 2 none any Details for bag-1.0.0-py2.py3-none-any.whl

Total release size: 256.8 kB

Release files / bag-1.0.0.tar.gz

Download URL bag-1.0.0.tar.gz
Size 116.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3a29c74ec9b17551b03e8aa60afec2967087e3074d00fb9ea6d0c45b2e72f4e8
BLAKE2b-256 checksum
How to use checksums
89116aec41d6ecba6813d66f0032fea9e01d5256d96b4a5c5f9bc3863384e34b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / bag-1.0.0-py2.py3-none-any.whl

Download URL bag-1.0.0-py2.py3-none-any.whl
Size 140.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
56566857f46ef93d9c354534d7594f3591712bb8e8959ff49e2ffbfc24e0f35e
BLAKE2b-256 checksum
How to use checksums
7fb3d8ffe95bd52232512abeaa3de6b66914d1e1ad341c0248227baaf36b91b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for bag 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

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