do_utils
Utils write for common usage.
do_time
Func timer - count func time with decorator
- Usage:
from do_utils import do_time
from time import sleep
@do_time()
def do_print():
sleep(0.01)
class A(object):
@do_time(func=False)
def do_print(self):
sleep(0.01)
do_cache
Do cache for GET request url handler in Tornado server
do_cache:
do cahche for request with uri & user & params
cache_key include (protocol, host_name, path, md5(current_user, params))
cache_expire depend on kwargs expire, the default is 5*60s
cache from write_buffer that have not flushed wrote by self.write() and will be flush
if cache is none:
get data & return data & do cache
else:
return cache
do_api_cache:
do cache for api handler
if status_code == 200:
do_cache
do_temp_cache:
do cache for template handler
- Usage:
from do_utils import do_api_cache, do_temp_cache
class ApiHandler(object):
@do_api_cache(10)
def get(self):
print 'get api'
@do_temp_cache(10, with_user=False)
def get(self):
print 'get template'
Change History
- v0.0.1
do utils
do api/template cache for tornado server with redis
- v0.0.2
bugfix for install_requires cannot using 'requirements.txt'
add prefix for cache_key: 'cache:'
- v0.0.3
bugfix for Python3 and dependence
- v0.0.4.2
bugfix for Python3 and update dependence
Metadata
Release files for do-utils 0.0.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| do_utils-0.0.4.2.tar.gz | 9.6 kB | Without provenance | Details for do_utils-0.0.4.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| do_utils-0.0.4.2-py3-none-any.whl | Python 3 | none | any | Details for do_utils-0.0.4.2-py3-none-any.whl |
Total release size: 20.2 kB
Release files / do_utils-0.0.4.2.tar.gz
| Download URL | do_utils-0.0.4.2.tar.gz |
|---|---|
| Size | 9.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
282be9c3b5802ebab0b240bb0553e713c1f46a7f3739e5839644df1f1234b1a3
|
|
BLAKE2b-256 checksum How to use checksums |
b7c7a1c9cee77fc4887062a6523244451014cf6e284cce239a7b9cb1879ac47f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Release files / do_utils-0.0.4.2-py3-none-any.whl
| Download URL | do_utils-0.0.4.2-py3-none-any.whl |
|---|---|
| Size | 10.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
781c483c8f3409d55d6bd326db3793f4eda8c2920f615b1636f06542a40b7902
|
|
BLAKE2b-256 checksum How to use checksums |
eed6cee5d9ba010f7878e47dcf158498c6ab59ddff3b94eb6265e48765652d9e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Security for do-utils 0.0.4.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.