semvec/pypi-packages huggingface dataset:
neverbounce 0.2.0
API library for the NeverBounce email verification service.
License: MIT
Keywords: api,email,verification

NeverBounce
===========

Python API wrapper library for the `NeverBounce`_ email
verification service.

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

.. code::

    $ pip install neverbounce

The only dependency is the `requests`_ library.

Usage
-----

`Sign up`_ to get an `API username and key`_ and 1000 free monthly
verifications. The **free account** supports only **single verifications**.

Single verification
~~~~~~~~~~~~~~~~~~~

.. code::

    >>> from neverbounce import NeverBounce

    >>> neverbounce = NeverBounce('my_api_username', 'my_api_key')
    >>> verified = neverbounce.verify('martin@martinkosir.net')

    >>> print(str(verified))
    martin@martinkosir.net: valid

    >>> print(verified.email, verified.result_text, verified.result_code, verified.is_valid)
    martin@martinkosir.net valid 0 True

Bulk verification
~~~~~~~~~~~~~~~~~

To use this features you need to `configure a payment method`_ in
NeverBounce account settings.

.. code::

    >>> from neverbounce import NeverBounce
    >>> neverbounce = NeverBounce('my_api_username', 'my_api_key')

Create the job and get it's id:

.. code::

    >>> emails = ['some.email@example.com', 'john.smith@gmail.com']
    >>> job_id = neverbounce.create_job(emails).job_id

Periodically check the status of verification job:

.. code::

    >>> job_status = neverbounce.check_job(job_id)

Use the `results` generator to iterate over verified emails if the job has been completed:

.. code::

    >>> if job_status.is_completed:
    ...     for verified in neverbounce.results(job_id):
    ...         print(verified.email, verified.result_text, verified.result_code, verified.is_valid)
    some.email@example.com invalid 1 False
    john.smith@gmail.com invalid 1 False

Account information
~~~~~~~~~~~~~~~~~~~

Get the information about your API account:

.. code::

    >>> from neverbounce import NeverBounce
    >>> neverbounce = NeverBounce('my_api_username', 'my_api_key')
    >>> account = neverbounce.account()

    >>> print(str(account))
    Credits: 999, Jobs Completed: 22, Jobs Processing: 0

    >>> print(account.credits, account.jobs_completed, account.jobs_processing)
    999 22 0

Documentation
-------------

-  `Official docs for the NeverBounce RESTful API`_


.. _NeverBounce: https://neverbounce.com/
.. _requests: http://docs.python-requests.org/
.. _Sign up: https://app.neverbounce.com/register
.. _API username and key: https://app.neverbounce.com/settings/api
.. _configure a payment method: https://app.neverbounce.com/settings/billing
.. _Official docs for the NeverBounce RESTful API: https://docs.neverbounce.com/

Build status
------------

.. image:: https://travis-ci.org/martinkosir/neverbounce-python.svg?branch=master
    :target: https://travis-ci.org/martinkosir/neverbounce-python
txweb 0.0.8
python web framework
License: MIT
Keywords: toughstruct

# txweb

TOUGHSTRUCT项目WEB框架，基于Python2.7, twisted, cyclone组成的WEB开发框架。

## 快速安装 

    pip install -U https://github.com/talkincode/txweb/archive/master.zip

## 创建项目

以下指令会从github下载应用模板并创建应用目录，目录名就是应用名，参数 -U 表示重新下载，否则直接取本地缓存

    txwebctl --create -U --dir=appdir

## 运行项目

以下指令会在8888端口（可选）监听http请求，--logging=none是由于cyclone内部自动打印日志，与txweb日志打印重复，所以关掉。

    txwebctl --port=8888 --dir=appdir --conf=appdir/etc/appname.json -logging=none

    [May 25 09:30:13 appname] Log opened.
    [May 25 09:30:13 appname] add free route [/:<class 'appname.handlers.index.IndexHandler'>]
    [May 25 09:30:13 appname] Application starting on 8888
    [May 25 09:30:13 appname] Starting factory <txweb.web.Application instance at 0x105731e18>
ecache 0.1.2
Cache integration with sqlalchemy.
License: MIT

Ecache for sqlalchemy
=====================


Run test
--------

.. code:: bash

    make unittest


Installation / Rquirements
--------------------------

.. code::

    pip intall ecache


Usage
-----

With Flask Integrate
~~~~~~~~~~~~~~~~~~~~

.. code:: python

    from flask import Flask, jsonify
    from flask_sqlalchemy import SQLAlchemy

    from ecache.ext.flask_cache import CacheableMixin, query_callable, regions

    app = Flask(__name__)
    app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db'
    app.debug = True
    db = SQLAlchemy(app)

    class User(db.Model, CacheableMixin):
        """Default backend is redis and expiration time is 1 hour, default
        region name is `default`, you can override this:

            cache_regions = your_regions
            cache_label = your_label
        """

        id = db.Column(db.Integer, primary_key=True)
        name = db.Column(db.String)

    @app.route('/users')
    def all_users():
        """Result will try to get from cache first. load from db if cache miss.
        """
        users = [user.to_dict() for user in User.cache.filter()]
        return jsonify(users=users)


    @app.route('/users/<int:user_id')
    def view_user(user_id):
        """Result will try to get from cache first. load from db if cache miss.
        """
        user = User.cache.get(user_id)
        return jsonify(user.to_dict())

More detail see `example`_

.. _`example`: https://github.com/MrKiven/ECache/blob/master/ecache/ext/example.py


With Pure SQLAlchemy model Integrate
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: python

    # -*- coding: utf-8 -*-

    import redis
    from sqlalchemy import (Column, Integer, String, SmallInteger)

    from ecache.core import cache_mixin
    from ecache.db import db_manager, model_base

    # alsosee :class:`ecache.db.DBManager`
    DBSession = db_manager.get_session('test')
    cache_client = redis.StrictRedis()
    CacheMixin = cache_mixin()
    DeclarativeBase = model_base()


    class TodoListModel(DeclarativeBase, CacheMixin):
        __tablename__ == 'todo_list'
        TABLE_CACHE_EXPIRATION_TIME = 3600

        id = Column(Integer, primary_key=True)
        title = Column(String, default='')
        is_done = Column(SmallInteger, default=0)

        @classmethod
        def get_todo(cls, todo_id):
            todo = cls.get(todo_id)  # `cls.get` inherited from `CacheMixin`
            return todo

        @classmethod
        def add(cls, title):
            todo = cls(title=title)
            s = DBSession()
            s.add(todo)
            s.commit()