semvec/pypi-packages huggingface dataset:
db_integration_test 1.1.0
Easily setup relational database fixtures and assert database contents in unittest.
License: MIT
Keywords: testing
fixture
test data
database
assertion
integration

db_integration_test
===================

Easily setup relational database fixtures and assert database contents in unittest.


Install
-------

.. code-block:: bash

    $ pip install db_integration_test


Usage
-----

.. code-block:: python

    from dbit import DatabaseTestCase, fixture

    class SomeTest(DatabaseTestCase):

        def setUp(self):
            # the DB connection has to be created before the setUp is run.
            # DatabaseTestCase only ever creates a single connection. Multiple calls to connect are ignored.
            # to connect to a different DB, call self.disconnect(), then self.connect() with a different connection string.
            # uses SQLAlchemy under the hood
            self.connect('postgresql+psycopg2://user:pass@localhost/test_db')
            super().setUp()

        @fixture("table_name", [{'id': 1, 'value': 'abc'}, {'id': 2, 'value': 'def'}])
        def test_something_with_your_database(self):
            # interact with the DB
            # self.engine contains the SQLAlchemy Engine
            # self.session contains the SQLAlchemy ORM session
            # self.base contains the automap base for the current database
            # self.disconnect() disconnects from the DB

            # assert that the table contents match the fixture exactly
            self.assertMatchFixture("table_name", self.get_table_contents(self.base.classes.table_name))

            # assert that some number of rows appear in the fixture
            self.assertAllInFixture("table_name", [{'id': 1, 'value': 'abc'}])
pvt 0.3
Python virtual environment tool
License: MIT

pvt by Richard Cook
===================

|View on PyPI| |Licence|

Python virtual environment tool

Clone repository
----------------

::

    git clone https://github.com/rcook/pvt.git

Developer notes
---------------

Various package properties are defined in ``pvt/__init__py``:

-  ``__project_name__``
-  ``__version__``
-  ``__description__``

When publishing a new build of the package, ensure that ``__version__``
is incremented as appropriate.

Licence
-------

Released under `MIT License <LICENSE>`__

.. |View on PyPI| image:: https://img.shields.io/pypi/v/pvt.svg
   :target: https://pypi.python.org/pypi/pvt
.. |Licence| image:: https://img.shields.io/badge/license-MIT-blue.svg
   :target: https://raw.githubusercontent.com/rcook/pvt/master/LICENSE
nodeconductor-auth-openid 0.8.5
Waldur plugin bringing OpenID-based authentication support.
License: MIT

NodeConductor OpenID
====================

NodeConductor plugin bringing OpenID-based authentication support.

Usage
-----

1. Install the plugin

2. Run migrations to create new tables.

.. code-block::

    nodeconductor migrate --noinput

3. Add your OpenID to your user account:

.. code-block::

    NodeConductor admin > Core > Django_Openid_Auth > User open ids > Add user open id
    User: <your-django-user-id>
    Claimed id: <openid.claimed_id> (example: https://launchpad.net/~johndoe)
    Display name: <your-display-name>

4. Navigate to `<nodeconductor-url>/api-auth/openid/login` and try to log in using your OpenID provider URL

Known issues
------------

**Database migrations do not work correctly with MySQL**

Running migrations (step 3 of 'Usage' section) may fail with following error:

.. code-block::

    django.db.utils.OperationalError: (1170, "BLOB/TEXT column 'claimed_id' used in key specification without a key length")

This is a `known issue<https://bugs.launchpad.net/django-openid-auth/+bug/524796>`_ of `django-openid-auth<https://pypi.python.org/pypi/django-openid-auth/>`_ :
Django `does not allow<https://code.djangoproject.com/ticket/2495>`_ `TextField` to be unique.

Fix exists but it is not yet merged as of 2016-05-03.

To work around the problem you will have to manually patch the `django-openid-auth` code as follows:

.. code-block:: python

    # File: django_openid_auth/migrations/0001_initial.py
    -    claimed_id = models.TextField(max_length=2047, unique=True)
    +    claimed_id = models.CharField(max_length=255, unique=True)

    # File: django_openid_auth/migrations/0001_initial.py
    -                ('claimed_id', models.TextField(unique=True, max_length=2047)),
    +                ('claimed_id', models.CharField(unique=True, max_length=255)),

-- and launch the migrations again.
django-in-memory-models 1.0.5
In memory models for Django, store in memory, query with instance.attribute
License: MIT

## Introduce
For performance critical fields and models, and don't want to lose the convenience of getting them like attributes.

You can adding user page view by `user.statistics.visits += 1` and get the value by `user.statistics.visits.value
`

## Backends

- redis
- ssdb

## Install
`pip install django-in-memory-models`


## Example

```
from in_memory.ssdb.fields import SSDBSortedIntegerField as IntegerField
# from in_memory.redis.fields import RedisSortedIntegerField as IntegerField


# InMemoryModel do not create tables when migrating.
# You can add fields to django.db.models.Model directly.
class AccountStatistics(InMemoryModel):
    user = InMemoryOneToOneKey(User, related_name='statistics')
    total_subscription = IntegerField(default=0)

    @classmethod
    def get_by_user(cls, pk):
        instance = cls(user_id=pk)
        return instance

    def __str__(self):
        return '<Account Statistics: %s>' % self.user

s = User.objects.first().statistics
s.total_subscription.reset()
print(s.total_subscription.value)
s.total_subscription += 1
print(s.total_subscription.value)
s.total_subscription = 200
print(s.total_subscription.value)
top_users = s.total_subscription.top(1)
print(top_users)
top_user = top_users[0]
print(top_user)
print(top_user.user)
print(top_user.total_subscription.value)
```

Output

```
0
1
200
[<AccountStatistics: <Account Statistics: oldcai>>]
<Account Statistics: oldcai>
oldcai
200
```

## TODO

- Django system cache backend
bmi-ilamb 0.1.1
BMI for ILAMB
License: MIT
Keywords: CSDMS BMI ILAMB model benchmark

[![Build Status](https://travis-ci.org/permamodel/bmi-ilamb.svg?branch=master)](https://travis-ci.org/permamodel/bmi-ilamb)
[![Code Health](https://landscape.io/github/permamodel/bmi-ilamb/master/landscape.svg?style=flat)](https://landscape.io/github/permamodel/bmi-ilamb/master)
[![Coverage Status](https://coveralls.io/repos/permamodel/bmi-ilamb/badge.svg?branch=master)](https://coveralls.io/r/permamodel/bmi-ilamb?branch=master)

# bmi-ilamb

A Basic Model Interface (BMI)
for version 2 (Python)
of the International Land Model Benchmarking Project (ILAMB)
benchmarking toolkit.

* The [journal article](http://dx.doi.org/10.1016/j.cageo.2012.04.002)
  that describes BMI
* ILAMB [home page](https://www.ilamb.org/)
* ILAMB [source code repository](https://bitbucket.org/ncollier/ilamb)
* ILAMB [documentation](http://climate.ornl.gov/~ncf/ILAMB/docs/index.html)

## Installation

Clone and install **bmi-ilamb** into a Python distribution with

    $ git clone https://github.com/permamodel/bmi-ilamb
    $ cd bmi-ilamb
    $ python setup.py install

ILAMB itself must also be installed;
follow the [instructions](http://climate.ornl.gov/~ncf/ILAMB/docs/install.html)
in the ILAMB documentation
for downloading and installing ILAMB
into the same Python distribution as **bmi-ilamb**.

## Use

Two configuration files are needed:
one for ILAMB, the other for the BMI.
A description of the ILAMB configuration file can be found
in the ILAMB documentation.
The BMI configuration file contains values
that are passed to ILAMB's `ilamb-run` script.
Examples (
[ilamb.cfg](https://github.com/permamodel/bmi-ilamb/blob/master/bmi_ilamb/data/ilamb.cfg)
and
[bmi_ilamb.yaml](https://github.com/permamodel/bmi-ilamb/blob/master/bmi_ilamb/data/bmi_ilamb.yaml),
respectively)
are given in the **data** directory
of this repository.

In a Python session, execute:

```python
from bmi_lamb import BmiIlamb

m = BmiIlamb()
m.initialize('/path/to/bmi_ilamb.yaml')
m.update()  # calls the ilamb-run script
m.finalize()
```

The path to the BMI configuration file can be relative or absolute.

The result:
```bash
$ ls -F
_build/ log
```

View the run log with:

    $ cat log

Display ILAMB's graphical output with a web browser:

    $ firefox _build/index.html
date-query 0.10.2
A program to query dates
License: MIT
Keywords: date scheduling

A date query program
====================

This is a date query program. It is in its initial stages. Currently, it
supports requests for the first occurrence of a given weekday for a given year.

The need for this program arose when I needed to provide a list of dates to
someone to schedule a year's worth of meetings on the first Tuesday of
every month.
reflection 0.1.1
A modern and pythonic GUI library
License: MIT
Keywords: GUI,interface,tkinter,tk

==========
reflection
==========

Reflection is a wrapper around `tkinter`_ with support for Python 2 and 3.

It aims to be a more intuitive way of creating graphical interfaces, while keeping the ability to modify widgets in any way you want.
Although still in alpha, things are looking good for development.
The next versions will bring event handling, new widgets and window manager interactions.

Features
--------

* Support for the following widgets:

   * ``Application`` (``tkinter.Tk``)
   * ``Window`` (``tkinter.Toplevel``)
   * ``Frame`` (``tkinter.Frame``)
   * ``Text`` (``tkinter.Label``)
   * ``Image`` (``tkinter.Label``)
   * ``Button`` (``tkinter.Button``)
   * ``Entry`` (``tkinter.Entry``)

* Support for more than 30 image types (requires the `PIL`_ library)
* Custom styles to personalize interfaces
* Completely clutter-free!

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

Getting started is easy. Just download the latest version from PyPi.org:

.. code-block:: shell

    pip install reflection

*Note:* You may need to replace ``pip`` with ``pip3`` if you plan on using reflection in Python 3.

Help
----

Reflection is still in alpha, so bugs are to be expected. The semantics of the library may change a great deal over time.

|

If you've found a bug or have a question, please open an issue on GitHub `here`_.

.. _tkinter: https://github.com/python/cpython/tree/3.6/Lib/tkinter
.. _PIL: http://pythonware.com/products/pil/
.. _here: https://github.com/Coal0/reflection/issues/new
assign 1.0.1
A Black Magic for support obj.__assign__ method
License: MIT

# Assign

---------

`assign` is a black magic module for supporting `obj.__assign__`:

### How to use it:

#### 1. magic patch

Suppose that there is a `test.py`

```python

a = 1


class T():
    def __assign__(self, v):
        print('called with %s' % v)


b = T()
c = b

```
It just works as:

```python
Python 3.6.0 (default, Mar  6 2017, 15:44:48)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import magic
>>> import test
called with c

```

#### 2. manually patch

```
from assign.patch import patch_module
import test

patch_module(test)

```

### Install

just:

`pip install assign`

### Notes

* Tested with `Py2.7` and `Py3.6`

### Known Issues

* 1. Won't work under `REPL`
* 2. May slow import operation.
* 3. May failed when patch some modules like `os` and `sys`
gec 0.1.1
A ECC implementation via oop style abstract algebra
License: MIT


# A Pure Python implementtation of Calculator over ECC Groups


* in `tests/test_bitcoin_genpub.py` you can check the bitcoin case, verified with `Vitalik Buterin`'s `pybitcointools`.

Note that, this implementation may cause 10 times slower than `Vitalik Buterin`'s `fast jacobian` implementation.