semvec/pypi-packages huggingface dataset:
scrapy-random-ua 0.3
Scrapy Middleware to set a random User-Agent for every Request.
License: MIT
Keywords: scrapy random user-agent

Scrapy Random User-Agent
========================

Does your scrapy spider get identified and blocked by servers because
you use the default user-agent or a generic one?

Use this ``random_useragent`` module and set a random user-agent for
every request. 

Installing
----------

Installing it is pretty simple.

.. code-block:: python

    pip install git+https://github.com/cleocn/scrapy-random-useragent.git

Usage
-----

In your ``settings.py`` file, update the ``DOWNLOADER_MIDDLEWARES``
variable like this.

.. code-block:: python

    DOWNLOADER_MIDDLEWARES = {
        'scrapy.contrib.downloadermiddleware.useragent.UserAgentMiddleware': None,
        'random_useragent.RandomUserAgentMiddleware': 400
    }

This disables the default ``UserAgentMiddleware`` and enables the
``RandomUserAgentMiddleware``.

Now all the requests from your crawler will have a random user-agent.
request-validator 2.0.5
Python request validator
License: MIT
Keywords: request validator

Github
======

https://github.com/amirasaran/request_validator

request\_validator
==================

Python Request(json) Validator

how to install
==============

::

    pip install request_validator

How to use
==========

| Imaging you have a json response that get from rest api server and you
| must validate response.

**sample:**

::

    from request_validator.serializers import *
    from request_validator.fields import *


    class GlossDefSerializer(BaseSerializer):
        para = CharField()
        gloss_see_also = CharField(many=True, source="GlossSeeAlso")


    class GlossEntrySerializer(BaseSerializer):
        id = IntField(source="ID")
        sort_as = CharField(source="SortAs")
        gloss_term = CharField(source="GlossTerm")
        acronym = CharField(source="Acronym")
        abbrev = CharField(source="Abbrev", required=True, allow_blank=False)
        gloss_def = GlossDefSerializer(source="GlossDef")
        gloss_see = CharField(source="GlossSee")


    class GlossListSerializer(BaseSerializer):
        gloss_entry = GlossEntrySerializer(source="GlossEntry")


    class GlossDivSerializer(BaseSerializer):
        title = CharField()
        gloss_list = GlossListSerializer(source="GlossList")


    class GlossarySerializer(BaseSerializer):
        title = CharField()
        gloss_div = GlossDivSerializer(source="GlossDiv")


    class SampleSerializer(BaseSerializer):
        glossary = GlossarySerializer()


    sample_data = {
        "glossary": {
            "title": "example glossary",
            "GlossDiv": {
                "title": "S",
                "GlossList": {
                    "GlossEntry": {
                        "ID": 12,
                        "SortAs": "SGML",
                        "GlossTerm": "Standard Generalized Markup Language",
                        "Acronym": "SGML",
                        "Abbrev": "",
                        "GlossDef": {
                            "para": "A meta-markup language, used to create markup languages such as DocBook.",
                            "GlossSeeAlso": ["GML", "XML"]
                        },
                        "GlossSee": "markup"
                    }
                }
            }
        }
    }


    validator = SampleSerializer(data=sample_data)
    print('validation status:')
    print(validator.is_valid())
    print("\nvalidation errors:")
    print(validator.get_errors())
    print("\nvalidated data:")
    print(validator.validate_data())

**The above sample output:**

::

    validation status:
    False

    validation errors:
    {'glossary': {'gloss_div': {'gloss_list': {'gloss_entry': {'abbrev': ['This field cannot be blank']}}}}}

    validated data:
    {'glossary': {'title': 'example glossary', 'gloss_div': {'title': 'S', 'gloss_list': {'gloss_entry': {'acronym': 'SGML', 'gloss_term': 'Standard Generalized Markup Language', 'gloss_def': {'gloss_see_also': ['GML', 'XML'], 'para': 'A meta-markup language, used to create markup languages such as DocBook.'}, 'gloss_see': 'markup', 'sort_as': 'SGML', 'id': 12}}}}}
rentry 1.0.1
Markdown pastebin from command line
License: MIT
Keywords: markdown,pastebin,cli,terminal,console,markup

rentry
======

`Rentry.co`_ is a pastebin/publishing service with markdown support, preview, custom urls and editing.

This repository contains a simple script that allows pasting and editing from command line interface.

Installation
------------

Manually:

.. code:: sh

    wget https://raw.githubusercontent.com/radude/rentry/master/rentry -O ./rentry && chmod +x ./rentry

PyPI (Make sure you are using Python3 and pip3):

.. code:: sh

    pip install rentry

Usage
-----

.. code:: console

    $ rentry --help

    Usage: rentry {new | edit | raw} {-h | --help} {-u | --url} {-p | --edit-code} text

    Commands:
      new   create a new entry
      edit  edit an existing entry
      raw   get raw markdown text of an existing entry

    Options:
      -h, --help                 show this help message and exit
      -u, --url URL              url for the entry, random if not specified
      -p, --edit-code EDIT-CODE  edit code for the entry, random if not specified

    Examples:
      rentry new 'markdown text'               # new entry with random url and edit code
      rentry new -p pw -u example 'text'       # with custom edit code and url
      rentry edit -p pw -u example 'text'      # edit the example entry
      cat file | rentry new                    # read from pipe and paste it to rentry
      rentry raw -u example                    # get raw markdown text
      rentry raw -u https://rentry.co/example  # -u accepts absolute and relative urls


.. _Rentry.co: https://rentry.co