Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

Repack is a collection of well known Python utilities nicely packed together.

Project description

Welcome to Repack!

Repack is a collection of well known utilities nicely packed together. To illustrate the idea, imagine, you need to pass an object via URL query string, with Repack it looks like:

import repack

token1 = (repack
            .send({'id': 10001, 'desc':'this is a token' }))

But normally, you would do:

import json
import zlib
import base64
import urllib.parse

string = json.dumps({'id': 10001, 'desc':'this is a token' })
stream = bytes(string, 'utf-8')
stream = zlib.compress(stream)
string = base64.b64encode(stream)
token1 = urllib.parse.quote(string)

Feel the difference :) Also you want it to be lasy, so you can make a converter once and use it later:

urlit = (repack

Like this:

token1 = urlit.send({'id': 10001, 'desc':'this is a token' })

Or like this:

token2 = urlit.send('another token lol')
token3 = urlit.send('one more yay')
token4 = urlit.send('yay!!!')

You can chain the utilities as filter, meaning, values interpreted as False will not pass:

with (repack
        .filter()) as f:




Another example is iterator, which allows to set source later:

with (repack
        .iterator()) as iterator:

    results = []
    for v in iterator.send(iter(['1 ','\t2', '\n3'])):

Results in:

[1, 2, 3]

Or vice versa, using accumulator:

with (repack
        .accumulator()) as acc:

    acc.send('1 ')

    results = []
    for v in acc:

The package is under development. Everyone is welcome to contribute. For TODOs, please see the current TODO list in the root folder.


  • Python 3.4.2


sudo pip install repack


As easy as adding more filters to filters/ or more flows to flows/

Project details

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
Repack-0.1.1.tar.gz (7.5 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page