Skip to main content

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 code is at https://github.com/nandoflorestan/bag where you can do your bug reports and pull requests.

This version of bag was published with releaser.

Most important library contents

  • 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.transecma – Complete solution for javascript internationalization. Compatible with jquery templates. Includes transecma.js.

  • bag.web.flash_msg has been removed in favor of a better module in the kerno library. It defines a rich class for UI messages to be stored in the HTTP session.

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

Compiling the documentation

Install make, activate your virtualenv, and then:

pip install sphinx sphinx-autodoc-typehints
./build_sphinx_documentation.sh

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bag-4.0.0.tar.gz (102.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bag-4.0.0-py3-none-any.whl (115.1 kB view details)

Uploaded Python 3

File details

Details for the file bag-4.0.0.tar.gz.

File metadata

  • Download URL: bag-4.0.0.tar.gz
  • Upload date:
  • Size: 102.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.9

File hashes

Hashes for bag-4.0.0.tar.gz
Algorithm Hash digest
SHA256 53cafdfe028e1a17dff20cb964d6c393a51b410c2cbe65a3e4373ac0681cc994
MD5 5de9f29f8256a73015c5111347841ade
BLAKE2b-256 a1e326e8131d2cbcf81678bb264d69f0c4f0fb4f6c97d6d1c33f87ef4a1dd2f0

See more details on using hashes here.

File details

Details for the file bag-4.0.0-py3-none-any.whl.

File metadata

  • Download URL: bag-4.0.0-py3-none-any.whl
  • Upload date:
  • Size: 115.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.9

File hashes

Hashes for bag-4.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e1c119e07403e46acd353e9e671060c9c31eb91de0adb77b998afa06f22f0a71
MD5 6a29a787ab7236a10f11437d1f8b08aa
BLAKE2b-256 afc3f0c11207d0b0ae0e610270ad713307522ab205a47c6e63ee7e8a7082bf87

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page