Skip to main content

Util functions for python

Project description


pip install winkar_utils

Utils for python


Add chaining enumerate supports for iterables

import utils
range(10).map(lambda x: x**2) \
      .filter(lambda x: x>10) \
      .take(5) \
      .reduce(lambda x,y: x+y)


Add additional encodings for str

import utils
print "asd".encode("bin")   # => 011000010111001101100100
print "011000010111001101100100".decode("bin")  # => asd


Utils for coding concurrently

from utils.concurrent import multiThread

@multiThread(10)  # the param indicate how many threads to start
def ox(x):
    return x

ox(range(10))     # this will run concurrently
                  # param should be a collection of orgin param type


Utils for log

import logging
from utils.log import stream_handler, formatter, logger

logger.warn("test")   # the logger has been set level to warn
                      # use formatter as its default output format
                      # and will only print to stdout
                      # change log level = "test"  # change logger name


from utils.factor import factor
factor(130)         # => [2,5,13]
factor(131)         # => [1,131]

Which will also add a factor command like linux to PATH

Useful third-party libraries


A very useful integrated pwn library.

Pwntools github repo

Can just install through pip.

from pwn import *
context(arch = 'i386', os = 'linux')

r = remote('', 31337)


Library specially for format string exploit.

Install with pip.

import sys
from libformatstr import FormatStr

addr = 0x08049580
system_addr = 0x080489a3

p = FormatStr()
p[addr] = system_addr

# buf is 14th argument, 4 bytes are already printed
sys.stdout.write( p.payload(14, start_len=4) )


Library that supports bash-style wildcard.

Install with pip

from fnmatch import fnmatch
fnmatch("target", "tar*")     # => true
fnmatch("target", "TARG.T")   # => false

Project details

Download files

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

Files for winkar_utils, version 0.0.7
Filename, size File type Python version Upload date Hashes
Filename, size winkar_utils-0.0.7.tar.gz (4.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page