-
python3-async-lru-1.0.3-1.lbn36.noarch
async_lru :info: Simple lru cache for asyncio Installation .. code-block::
shell pip install async_lruUsage This package is 100% port of Python built-in
function functools.lru_cache < for asyncio <
Located in
LBN
/
…
/
Core Linux
/
BastionLinux 36
-
python3-asyncio-dgram-1.1.1-5.fc36.noarch
The goal of this package is to make implementing common patterns that
use datagrams simple and straight-forward while still supporting more
esoteric options. This is done by taking an opinionated stance on the
API that differs from parts of asyncio.
Located in
LBN
/
…
/
Core Linux
/
BastionLinux 36
-
python3-asyncio-throttle-1.0.2-2.lbn36.noarch
asyncio-throttle
Simple, easy-to-use throttler for asyncio.
Example
import time
import random
import asyncio
from asyncio_throttle import Throttler
async def worker(no, throttler, n):
for _ in range(n):
await asyncio.sleep(random.random() * 2)
async with throttler:
print(time.time(), 'Worker #%d: Bang!' % no)
async def main():
throttler = Throttler(rate_limit=5)
tasks = [
loop.create_task(worker(no, throttler, 10))
for no in range(5)
]
await asyncio.wait(tasks)
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()
Here I limited work rate to 5/sec while there are 5 workers.
And the result:
1508273760.3462772 Worker #2: Bang!
1508273760.590009 Worker #3: Bang!
1508273760.856431 Worker #0: Bang!
1508273761.0110679 Worker #2: Bang!
1508273761.086856 Worker #4: Bang!
1508273761.350699 Worker #3: Bang!
1508273761.5906 Worker #1: Bang!
1508273761.8655958 Worker #4: Bang!
1508273762.224158 Work
Located in
LBN
/
…
/
Core Linux
/
BastionLinux 36
-
python3-backoff-2.2.1-1.lbn36.noarch
This module provides function decorators which can be used to wrap
a function such that it will be retried until some condition is met.
It is meant to be of use when accessing unreliable resources with the
potential for intermittent failures i.e. network resources and external
APIs. Somewhat more generally, it may also be of use for dynamically
polling resources for externally generated content.
Located in
LBN
/
…
/
Core Linux
/
BastionLinux 36
-
python3-bindep-2.11.0-1.lbn36.noarch
Introduction Bindep is a tool for checking the presence of binary packages
needed to use an application / library. It started life as a way to make it
easier to set up a development environment for OpenStack projects. While
OpenStack depends heavily on pip for installation of Python dependencies, some
dependencies are not Python based, and particularly for testing, some
dependencies have to be...
Located in
LBN
/
…
/
Core Linux
/
BastionLinux 36
-
python3-bleach-allowlist-1.0.3-1.lbn36.noarch
Bleach allowlist A curated list of tags, attributes, and styles suitable for
filtering user-provided HTML using bleach < it consists of basic set of tags
suitable for rendering markdown, and markup intended for printing, as well as a
list of all CSS styles. Please send pull requests with improvements or lists of
tags and attributes for other purposes (wikis, comments, etc?).Installation
pip...
Located in
LBN
/
…
/
Core Linux
/
BastionLinux 36
-
python3-bracex-2.1.1-5.fc36.noarch
Bracex is a brace expanding library (à la Bash) for Python.
Brace expanding is used to generate arbitrary strings.
Located in
LBN
/
…
/
Core Linux
/
BastionLinux 36
-
python3-django-currentuser-0.8.0-2.lbn36.noarch
Conveniently store reference to request user on thread/db level.
Quickstart
Differences to django-cuser
Release Notes
Contributing
Reporting issues/improvements
Pull Requests
Setting up all Python versions
Code of Conduct
Quickstart
Install django-currentuser:
pip install django-currentuser
Add it to the middleware classes in your settings.py:
MIDDLEWARE = (
...,
'django_currentuser.middleware.ThreadLocalUserMiddleware',
)
Then use it in a project:
from django_currentuser.middleware import (
get_current_user, get_current_authenticated_user)
from django_currentuser.db.models import CurrentUserField
class Foo(models.Model):
created_by = CurrentUserField()
updated_by = CurrentUserField(on_update=True)
Differences to django-cuser
Both libraries serve the same purpose, but be aware of these
differences (as of django-cuser v.2017.3.16):
django-currentusers CurrentUserField stores the reference to the request user
at initialization of the mod
Located in
LBN
/
…
/
Core Linux
/
BastionLinux 36
-
python3-django-guardian-2.4.0-2.lbn36.noarch
django-guardian is an implementation of per object permissions [1] on top
of Djangos authorization backend
Documentation
Online documentation is available at https:/django-guardian.readthedocs.io/.
Requirements
Python 3.5+
A supported version of Django (currently 2.2+)
GitHub Actions run tests against Django versions 2.2, 3.0, 3.1, 3.2, and main.
Installation
To install django-guardian simply run:
pip install django-guardian
Configuration
We need to hook django-guardian into our project.
Put guardian into your INSTALLED_APPS at settings module:
INSTALLED_APPS = (
...
'guardian',
)
Add extra authorization backend to your settings.py:
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend', # default
'guardian.backends.ObjectPermissionBackend',
)
Create guardian database tables by running:
python manage.py migrate
Usage
After installation and project hooks we can finally use object permissions
with Django.
Lets start really quickly:
>>> fro
Located in
LBN
/
…
/
Core Linux
/
BastionLinux 36
-
python3-django-guid-3.5.1-1.lbn36.noarch
Django GUID
Django GUID attaches a unique correlation ID/request ID to all your log outputs for every request.
In other words, all logs connected to a request now has a unique ID attached to it, making debugging simple.
Which version of Django GUID you should use depends on your Django version and whether you run ASGI or WSGI servers.
Located in
LBN
/
…
/
Core Linux
/
BastionLinux 36