semvec/pypi-packages huggingface dataset:
django-basicauth 0.5.3
Basic auth utilities for Django.
License: MIT

================
django-basicauth
================

Basic auth utilities for Django.

Requires
========

Tested under...

* Python

  * 3.6
  * 3.7
  * 3.8
  * 3.9

* Django

  * 2.2
  * 3.0
  * 3.1

Installation
============

::

    pip install django-basicauth


Usage
=====

.. code-block:: python

    from basicauth.decorators import basic_auth_required

    @basic_auth_required
    def myview(request):
        ...

or by a middleware.

.. code-block:: python

    MIDDLEWARE = (
        'basicauth.middleware.BasicAuthMiddleware',
        ...
    )


Basic Auth for specific requests only
-------------------------------------

To apply basic auth for specific requests,
Use ``target_test`` argument.

In the below code, anonymous users will be required Basic Auth
Authenticated users can pass it without `Basic ...` header.

.. code-block:: python

    from basicauth.decorators import basic_auth_required

    @basic_auth_required(
        target_test=lambda request: not request.user.is_authenticated
    )
    def myview(request):
        ...

``target_test`` accepts ``typing.Callable[[HttpRequest], bool]``,
and if the callable returns ``True``, Basic Auth will be required.

Applying decorator to CBVs
==========================

To apply ``@basic_auth_required`` decorator to Class Based Views,
use ``django.utils.decorators.method_decorator``.

.. code-block:: python

    from django.utils.decorators import method_decorator
    from basicauth.decorators import basic_auth_required

    @method_decorator(basic_auth_required, name='dispatch')
    class YourView(TemplateView):
        template_name = "my-template.html"

Settings
========

* ``BASICAUTH_USERS`` (required): Dictionary including keys as username and values as passwords.
* ``BASICAUTH_REALM``: realm string, default is "Secure resource".
* ``BASICAUTH_DISABLE``: Disable all of barriers by this library.


Changes
=======

0.5.3 (2020-11-17)
----------------------------
* Added supporting Django3 and Python3.8,3.9
    * Thanks @rhoboro !
* Dropped Py2, Django1.11

0.5.2 (2019-04-06)
----------------------------
* Added supporting Django2.2

0.5.1 (2018-08-06)
--------------------------
* Added supporting Django2.1
    * Thanks @rhymes

0.5 (2018-05-09)
---------------------
* Added supporting Django2.0
    * Thanks @timheap

0.4.2 (2017-11-27)
------------------
* Fixed to avoid timing attacks
    * Lots of thanks for Hugo Castilho

0.4.1 (2017-10-20)
------------------
* Added ``target_test`` argument for the decorator.

0.4 (2017-09-30)
----------------

* Supported Python 2.7
* Dropped Django1.9
* Supported Django 1.10+ style middleware

0.3 (2017-08-28)
----------------

* Added ``BASICAUTH_DISABLE`` setting
* Changed API of ``basicauthutils.validate_request``
    * Fixed to return True/False
    * Adding REMOTE_USER by this function

0.2.1 (2017-08-28)
------------------

* Officially supported Django 1.11, 1.10, 1.9

0.2 (2016-03-31)
----------------

* Added BasicAuthMiddleware https://github.com/hirokiky/django-basicauth/pull/3

0.1 (2015-04-20)
----------------

* Initial
stress-stressrunner 1.0.1
A stressrunner similar as TextTestRunner for stress test, support for html report.
License: MIT
Requires Python: >=3.4.0
Keywords: stress,stressrunner,html,unittest

# stress-runner
A runner similar as TextTestRunner for stress test, support for html report.
Based on unittest, support iterative exection, html report, send html report, etc.
dstart 0.0.2
Easy docker-compose pick-and-start
License: MIT
Requires Python: >3.6.0
Keywords: docker docker-compose utils start

# dstart - Docker start
Command to select services to start with docker-compose

![Usage gif](https://github.com/nano-labs/dstart/blob/main/imgs/dstart.gif)

## Install
```
pip3 install dstart
```

## Usage
```shell
> dstart
```
- SPACEBAR to select services
- ENTER to start selected services

```shell
$ dstart --help
usage: dstart [-h] [-f FILE] [--print-only] [--extra ...]

Command to select services to start with docker-compose.

optional arguments:
  -h, --help            show this help message and exit
  -f FILE, --file FILE  Specify an alternate compose file (default: docker-compose.yml)
  --print-only          Just print docker-compose command and exit
  --extra ...           Extra arguments will be passed to `docker-compose up` command
```

## How does it work
It uses `docker-compose` command to list all running container then `docker-compose up <SERVICES>` to start them

### See also
[dkill](https://github.com/nano-labs/dkill) - Docker Kill
discordbotdash-xCloudzx 0.14
A Discord bot management package
License: MIT

# discordbotdash
A discord.py package for testing Discord bots in your browser and viewing statistics. You can turn commands on and off, see the code for them, and view your shards with their respective latencies. This is still in development and more features will come.

## Installation
  * PyPi
    1. Download the latest version of the package from [TestPyPi](https://test.pypi.org/project/discordbotdash-xCloudzx/) (will be moved to PyPi soon). 
    1. Move (cd) to the discordbotdash directory.
    2. Run `python setup.py install`.

## Usage - Example
Once you have installed it, you can easily open up a dashboard in your browser:
```py
import discord
from discord.ext import commands
import discordbotdash.app.dash as dbd

bot = commands.AutoShardedBot("!")

@bot.event
async def on_ready():
    dbd.openDash(bot)

bot.run("token")
```
Ensure that you are opening the dashboard before you are running the bot with `bot.run`. Your dashboard will be open on `127.0.0.1:5000` once you have run `openDash`.

## Contributing
  * Pull Requests for new features are always welcome.
  * If you have a suggestion or a bug to report, open an issue.
scrapy-spiderstats-extension 0.0.2
Scrapy Spider Stats to MongoDB Extension
License: MIT
Requires Python: >=3.6.0

# Scrapy SpiderStats Extension

将 Spider Stats 存储到 MongoDB 的扩展，可以用于爬虫监控和统计。

## 安装

```shell script
pip install scrapy-spiderstats-extension
```

## 使用

在 `settings.py` 配置文件中开启 `SpiderStats` 

```python
EXTENSIONS = {
    "scrapyspiderstats.SpiderStats": 0
}
STATS_MONGODB_URI = "mongodb://localhost:27017"
STATS_MONGODB_DB = "scrapy"
STATS_MONGODB_COL = "spiderstats"
```

## 存储结果

> 启动状态

```json
{
    "_id":"5fb23d9cbaf515d71d3a9c6c",
    "log_count/INFO":9,
    "start_time":"2020-11-16T08:51:40.705Z",
    "stats_id":"2b55df7b46a548269ca603bb7ad889b2",
    "spider_name":"test",
    "pages":0,
    "pagerate":0,
    "items":0,
    "itemrate":0,
    "record_time":"2020-11-16T08:51:40.706Z"
}
```


> 记录状态

```json
{
    "_id":"5fb23dd8baf515d71d3a9c6d",
    "log_count/INFO":12,
    "start_time":"2020-11-16T08:51:40.705Z",
    "stats_id":"2b55df7b46a548269ca603bb7ad889b2",
    "spider_name":"test",
    "pages":510,
    "pagerate":510,
    "items":0,
    "itemrate":0,
    "record_time":"2020-11-16T08:52:40.713Z",
    "log_count/DEBUG":1034,
    "scheduler/enqueued/redis":521,
    "scheduler/dequeued/redis":520,
    "downloader/request_count":520,
    "downloader/request_method_count/GET":520,
    "downloader/request_bytes":239235,
    "downloader/response_count":510,
    "downloader/response_status_count/200":510,
    "downloader/response_bytes":110675,
    "response_received_count":510,
    "downloader/exception_count":3,
    "downloader/exception_type_count/twisted-internet-error-TimeoutError":3,
    "retry/count":3,
    "retry/reason_count/twisted-internet-error-TimeoutError":3
}
```

> 完成状态

```json
{
    "_id":"5fb23e2ebaf515d71d3a9c6f",
    "log_count/INFO":16,
    "start_time":"2020-11-16T08:51:40.705Z",
    "stats_id":"2b55df7b46a548269ca603bb7ad889b2",
    "spider_name":"test",
    "pages":1000,
    "pagerate":6,
    "items":0,
    "itemrate":0,
    "record_time":"2020-11-16T08:54:06.125Z",
    "log_count/DEBUG":2015,
    "scheduler/enqueued/redis":1007,
    "scheduler/dequeued/redis":1007,
    "downloader/request_count":1007,
    "downloader/request_method_count/GET":1007,
    "downloader/request_bytes":463763,
    "downloader/response_count":1000,
    "downloader/response_status_count/200":1000,
    "downloader/response_bytes":216997,
    "response_received_count":1000,
    "downloader/exception_count":7,
    "downloader/exception_type_count/twisted.internet.error.TimeoutError":7,
    "retry/count":7,
    "retry/reason_count/twisted.internet.error.TimeoutError":7,
    "elapsed_time_seconds":145.420645,
    "finish_time":"2020-11-16T08:54:06.125Z",
    "finish_reason":"finished"
}
```