Skip to main content

A util package for python

Project description

utils for Flask Web & Crawler


philosophy: DRY don't repeat yourself


pip3 install icecola


  • ModelViewSet: quickly build CRUD for REST api, like django_restframework

from flask_utils.restframework import ModelViewSet

from jasmine_app.models.user import User
from import Video

class UserView(ModelViewSet):
    model_class = User

class Video(ModelViewSet):
    model_class = Video

from jasmine_app.api.views import UserView, Video
from flask_utils.views import register_api

from . import api

register_api(api, Video, "video_api", "/video/")
register_api(api, UserView, "user_api", "/user/")

crawler utils

add cache implement for crawler

def test_mongo_cache(mongo_cache):
    key1 = "key"
    value1 = "value"

    mongo_cache[key1] = value1
    assert mongo_cache[key1] == value1
    assert len(mongo_cache) == 1
    assert set(mongo_cache.keys()) == {key1}
    assert set(mongo_cache.values()) == {value1}
    assert len(mongo_cache) == 0

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 icecola, version 0.5
Filename, size File type Python version Upload date Hashes
Filename, size icecola-0.5-py3-none-any.whl (9.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size icecola-0.5.tar.gz (6.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page