semvec/pypi-packages huggingface dataset:
DStore-Mongo 0.1.0a1
DStore MongoDB Storage Layer
License: MIT

Welcome To DStore-Mongo
#######################

.. image:: https://img.shields.io/coveralls/MarkLark/dstore-mongo.svg
    :target: https://coveralls.io/github/MarkLark/dstore-mongo?branch=master

.. image:: https://img.shields.io/travis/MarkLark/dstore-mongo/master.svg
    :target: https://travis-ci.org/MarkLark/dstore-mongo

.. image:: https://img.shields.io/pypi/v/dstore-mongo.svg
    :target: https://pypi.python.org/pypi/dstore-mongo

.. image:: https://img.shields.io/pypi/pyversions/dstore-mongo.svg
    :target: https://pypi.python.org/pypi/dstore-mongo

DStore-Mongo is a MongoDB storage layer for DStore.
This allows you to use the same Model descriptions to Create, Read, Update and Delete from a Mongo DataBase.


Installing
==========

DStore-Mongo is available from the PyPi repository.

This means that all you have to do to install DStore-Mongo is run the following in a console:

.. code-block:: console

    $ pip install dstore-mongo

Minimal Example
===============

.. code-block:: python

    from dstore import Model, var, mod
    from dstore_mongo import MongoStore

    class Car( Model ):
        _namespace = "cars.make"
        _vars = [
            var.RowID,
            var.String( "manufacturer", 32, mods = [ mod.NotNull() ] ),
            var.String( "make", 32, mods = [ mod.NotNull() ] ),
            var.Number( "year", mods = [ mod.NotNull(), mod.Min( 1950 ), mod.Max( 2017 ) ] ),
        ]

    # Create the MemoryStore instance, and add Models to it
    store = MongoStore( self.models )
    store.init_app()
    store.set_config({
        "DSTORE_DB_HOST"  : "localhost",
        "DSTORE_DB_USER"  : "username",
        "DSTORE_DB_PASSWD": "password",
        "DSTORE_DB_DB"    : "dstoredb"
    })
    store.connect()
    store.create_all()

    # Destroy all instances and shut down the application
    store.destroy_all()
    store.disconnect()
    store.destroy_app()


Documentation: `ReadTheDocs <https://python-dstore.readthedocs.io/en/latest/storage.html#mongostore>`_

Source Code: `GitHub <https://github.com/MarkLark/dstore-mongo>`_
stickymeta 0.0.5
Handy tools to maintain persistent meta values between requests in Scrapy spiders
License: MIT
Keywords: scrapy

Scrapy Sticky Meta
==================

Handy tools to maintain persistent meta values between requests in
Scrapy spiders. Available as spider middleware and spider callback
decorators.

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

::

    pip install stickymeta

Usage
-----

As spider middleware
^^^^^^^^^^^^^^^^^^^^

Add middleware to ``settings.py``:

::

    SPIDER_MIDDLEWARES = {
        ...
        'stickymeta.StickyMetaMiddleware': 543,
        ...
    }

and ``sticky_meta`` attribute containing persistent ``meta`` keys to
spider:

::

    class TheSpider(scrapy.Spider):
        name = 'thespider'
        sticky_meta = ('cookiejar', 'foo', 'bar')

All values for the corresponding keys will be kept persistent between
all the requests and responses.

As decorators
^^^^^^^^^^^^^

@stick\_meta
''''''''''''

::

    from stickymeta import stick_meta

Keep persistent values for keys passed as decorator parameters:

::

    @stick_meta('a', 'b', 'c')
    def parse(self, response):
        ...
        yield scrapy.Request(url)
        

is equivalent to:

::

    def parse(self, response)
        ...
        meta = {
            'a': response.meta['a'],
            'b': response.meta['b'],
            'c': response.meta['c'],
        }
        yield scrapy.Request(url, meta=meta}
        

@stick\_cj
''''''''''

::

    from stickymeta import stick_cj

Shortcut for ``stick_meta`` handling ``cookiejar`` as default argument
value, so

::

    @stick_cj('a', 'b', 'c')
    def parse(self,response):
        ...
        

is equivalent to

::

    @stick_meta('cookiejar', 'a', 'b', 'c')
    def parse(self,response):
        ...
        

Spider attribute ``sticky_meta`` also affects to decorators, next two
pieces of code will handle ``meta`` in the same way:

::

    class TheSpider(scrapy.Spider):
        name = 'thespider'
        sticky_meta = ('a', 'b', 'c')
        
        @stick_meta()
        def parse(self, response):
            ...
            yield Request(url)
            

vs

::

    class TheSpider(scrapy.Spider):
        name = 'thespider'
        
        @stick_meta('a', 'b', 'c')
        def parse(self, response):
            ...
            yield Request(url)
pdfformulas 0.0.6
pdfformulas dumps the formulas of a PDF as PNG files in the ``formulas`` subfolder.
License: MIT
Keywords: PDF, Formula

usage: pdfformulas.py [-h] [--dxmin DXMIN] [--frompage FROMPAGE]
                      [--topage TOPAGE] [--page PAGE] [--formulaid FORMULAID]
                      [--stats]
                      pdffile

Dump the formulas of a PDF as PNG files in the ``formulas`` subfolder. The
subfolder ``formulas`` is created, if not there yet. The PDF content must be
accessible as text. 

positional arguments:
  pdffile               PDF file to parse and dump formulas of

optional arguments:
  -h, --help            show this help message and exit
  --dxmin DXMIN         Additional left margin, which defines what is normal
                        text. If the text before a formula is the beginning of
                        a paragraph it might start a little indented. In this
                        case it helps to move dxmin to the right. Units are
                        those used in the PDF. Try 10.
  --frompage FROMPAGE   PDF page number to start with.
  --topage TOPAGE       PDF page number to stop at.
  --page PAGE           PDF page number
  --formulaid FORMULAID
                        The regular expression by which a formula is found.
                        Formulas are recognized by their ID on the right. The
                        regular expression used is:: r'^\s*\(\d*\.\d*\)\s* '
                        e.g.:: (2.13) To find the rectangle comprising the
                        formula the text before and after is located, which
                        begins on the left of the page (dxmin). The formula is
                        assumed to be indented with regard to normal text.
  --stats               Only print (formula,page)-refs statistics. This tells
                        which formulas are most often referenced in normal
                        text and are thus likely the most important ones.


Requires: Pillow, PyMuPDF (needs compatible MuPDF installed), PdfMiner
Installation: LibMuPDF and PyMuPDF will need to be installed beforehand.
codethecity-slackbot 1.0.0.dev3
A framework for creating Slackbots for Python. Developed for CodeTheCity.
License: MIT
Keywords: slack bot development

SlackBot
----
Python based Slack Bot that makes use of `Python SlackClient`_

The inspiration
----

Using `How to Build Your First Slack Bot with Python`_, I went from not knowing Python to having my first bot up and running in under an hour. Using that knowledge as a basis I managed to put this together in under a day.



The following instructions are as much a reminder to myself how I did this as they are a guide to others.

Installation
----

SlackBot is available through the Python Package Index, PyPI_, you can install it with::

    pip install codethecity-slackbot

Alternatively, clone or fork the repository and use::

    python setup.py develop

to install locally for development. For local development you should also install the development dependencies (ideally in a ``virtualenv``) using::

    pip install -r requirements.txt

Usage
----

SlackBot
----
SlackBot is the base class that connects to your registered Slack Bot.

In order to use the class you must be using the your token from Slack. To set the environmant variable use::

    export SLACK_BOT_TOKEN='token'

It handles the following default commands:

* help - lists all other commands it provides
* who created - details of the author
* show selfied - shows an image of the bot
* show mugshot - shows a mugshot of the bot

EventbriteBot
----

EventbriteBot is a subclass of SlackBot and provides basic querying of Eventbrite events for a given user account.

It uses `Eventbrite Python SDK`_.

In order to use the class you must be using the your token from Eventbrite. To set the environmant variable use::

  export EVENTBRITE_TOKEN='token'

This is an example showing how the SlackBot class is subclassed and used.

Creating a sample project with SlackBot
----

Setup the working environment
----

Create a virtual Python environment::

  mkdir <botname>
  cd <botname>
  virtualenv venv

Start the virtual Python environemnt::

  source venv/bin/activate

Examples
----

See the /examples directory for examples of the kinds of bots that you can build with SlackBot.

Currently there is a bot for querying Eventbrite.

.. _PyPI: https://pypi.python.org/pypi
.. _`How to Build Your First Slack Bot with Python`: https://www.fullstackpython.com/blog/build-first-slack-bot-python.html
.. _`Python SlackClient`: http://slackapi.github.io/python-slackclient/
.. _`Eventbrite Python SDK`: http://eventbrite-sdk-python.readthedocs.io/en/latest/