scrapy.utils.serialize.ScrapyJSONEncoder

Here are the examples of the python api scrapy.utils.serialize.ScrapyJSONEncoder taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

5 Examples 7

Example 1

Project: scrapy Source File: exporters.py
Function: init
    def __init__(self, file, **kwargs):
        self._configure(kwargs, dont_fail=True)
        self.file = file
        kwargs.setdefault('ensure_ascii', not self.encoding)
        self.encoder = ScrapyJSONEncoder(**kwargs)
        self.first_item = True

Example 2

Project: scrapy-kafka Source File: pipelines.py
Function: init
    def __init__(self, producer, topic):
        """
        :type producer: kafka.producer.Producer
        :type topic: str or unicode
        """
        self.producer = producer
        self.topic = topic

        self.encoder = ScrapyJSONEncoder()

Example 3

Project: scrapy-rabbitmq Source File: pipelines.py
Function: init
    def __init__(self, server, exchange_name):
        self.server = server
        self.exchange_name = exchange_name
        self.encoder = ScrapyJSONEncoder()

Example 4

Project: scrapy Source File: exporters.py
Function: init
    def __init__(self, file, **kwargs):
        self._configure(kwargs, dont_fail=True)
        self.file = file
        kwargs.setdefault('ensure_ascii', not self.encoding)
        self.encoder = ScrapyJSONEncoder(**kwargs)

Example 5

Project: scrapy Source File: test_utils_serialize.py
Function: set_up
    def setUp(self):
        self.encoder = ScrapyJSONEncoder()