Skip to main content

Universal functions and decorators and some packages extras

Project description


General-purpose classes and functions.


pip install -i shuff-utils


dict that allows you to call its keys with the dot.

d = DottedDict({'a': 'test'})
# 'test'
d = DottedDict(a='test')
# 'test'


Class for measuring an execution time.

# Init and set name of the whole period
timer = Timer('whole_period')
# Start custom measurement
timer.add_point('first block')
timer.add_point('second block')
# Stop custom measurement
timer.stop('first block')
timer.add_point('third block')
# Stop all the intervals and print summary details
# [2017-10-09 17:06:10 INFO] PROFILING: whole_period: 5000, first block: 3000, second block: 2000, third block: 2000

Flask functions

token_required - Bearer token decorator

Decorator that checks Bearer (static) Authorization token


import os

from dotenv import load_dotenv
from flask_restful import Resource
from snuff_utils.flask_decorators import token_required

# Get token from .env file
MY_TOKEN = os.getenv('MY_TOKEN', '')

class CallbackEvents(Resource):

    def post(self):
        # some code here
        return {}

Other functions

Other functions is not described yet. You can see them in the corresponding modules. Some of them have descriptions in their docstrings.



  • marshmallow_extras.convert now can take many functions as arguments.
  • Added marshmallow_extras.convert_items function.
  • Added marshmallow_extras.apply function - with it deserialize parameter can apply many functions to value.


The package is named after Slipknot's song. Thanks to the band, it helps a lot.

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 snuff-utils, version 1.0.3
Filename, size File type Python version Upload date Hashes
Filename, size snuff-utils-1.0.3.tar.gz (30.8 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