semvec/pypi-packages huggingface dataset:
django-uwsgi-alt 17.6.3
uWSGI stuff for Django projects
License: MIT
Keywords: uwsgi,django,mail,cache,template

django-uwsgi
~~~~~~~~~~~~

Django related examples/tricks/modules for uWSGI


Screenshots
~~~~~~~~~~~

`django-debug-toolbar <http://django-debug-toolbar.readthedocs.org/en/latest/>`_ panel

.. image:: https://github.com/unbit/django-uwsgi/raw/master/docs/screenshots/screenshot1.png


`Wagtail <https://github.com/torchbox/wagtail>`_ admin interface:

.. image:: https://github.com/unbit/django-uwsgi/raw/master/docs/screenshots/screenshot2.png

.. image:: https://github.com/unbit/django-uwsgi/raw/master/docs/screenshots/screenshot3.png

Emperor's Vassal Admin Panel

.. image:: https://github.com/unbit/django-uwsgi/raw/master/docs/screenshots/screenshot4.png

`django.contrib.admin <https://docs.djangoproject.com/en/1.10/ref/contrib/admin/>`_ interface

.. image:: https://github.com/unbit/django-uwsgi/raw/master/docs/screenshots/screenshot5.png

Documentation
~~~~~~~~~~~~~

`Read the documentation at rtfd.org <http://django-uwsgi.rtfd.org/>`_

Contributors
~~~~~~~~~~~~

See `CONTRIBUTORS <https://github.com/unbit/django-uwsgi/raw/master/CONTRIBUTORS>`_

License
~~~~~~~

`MIT <https://github.com/unbit/django-uwsgi/raw/master/LICENSE>`_
tle-storage-service 1.0.7
Small aiohttp server application for TLE storage
License: MIT

TLEStorageService
_________________

Small aiohttp server application for TLE storage


Requirements
------------

- aio-nasa-tle-loader >= 1.0.0
- aio-space-track-api >= 2.1.1
- aiohttp >= 2.1.0
- aiopg >= 0.13.0
- alembic >= 0.9.2
- pyaml >=16.12.2
- sqlalchemy >= 1.1.10
- ujson >= 1.35


Installing
__________

::

    pip install tle-storage-service


Getting started
---------------

Start aiohttp application:

.. code-block:: python

    #!/usr/bin/env python3
    # -*- coding: utf-8 -*-
    import logging
    import os

    from aiohttp import web

    from tle_storage_service import TleStorageService, load_cfg, LOG_FORMAT

    DIR = os.path.abspath(os.path.dirname(__file__))


    if __name__ == '__main__':
        logging.basicConfig(level=logging.INFO, format=LOG_FORMAT)
        app = TleStorageService(config=load_cfg(path=os.path.join(DIR, 'config', 'server.yaml')))
        web.run_app(app, port=8080)


Create periodic script for refresh db

.. code-block:: python

    #!/usr/bin/env python3
    # -*- coding: utf-8 -*-
    import asyncio
    import logging
    import os

    from aio_nasa_tle_loader import AsyncNasaTLELoader
    from aio_space_track_api import AsyncSpaceTrackApi
    from aiopg.sa import create_engine

    from tle_storage_service import periodic_task, load_cfg, nasa, space_track, LOG_FORMAT

    DIR = os.path.abspath(os.path.dirname(__file__))
    CFG = load_cfg(path=os.path.join(DIR, 'config', 'periodic.yaml'))

    logger = logging.getLogger(__name__)


    @periodic_task(CFG['sync'].get('space-track', 4) * 3600)
    async def call_space_track(engine, api_params, satellites, loop):
        async with AsyncSpaceTrackApi(loop=loop, **api_params) as api:
            await space_track(engine, api, satellites)


    @periodic_task(CFG['sync'].get('nasa', 0.5) * 3600)
    async def call_nasa(engine, loop):
        async with AsyncNasaTLELoader(loop=loop) as loader:
            await nasa(engine, loader)


    async def run(db_params, api_params, satellites, loop):
        async with create_engine(loop=loop, **db_params) as engine:
            await asyncio.gather(
                call_nasa(engine, loop),
                call_space_track(engine, api_params, satellites, loop),
                loop=loop
            )


    def notify_callback(msg):
        logger.info('[%s] Receive msg <- "%s"', msg.channel, msg.payload)


    if __name__ == '__main__':

        logging.basicConfig(format=LOG_FORMAT, level=logging.DEBUG)

        loop = asyncio.get_event_loop()
        loop.create_task(run(CFG['db'],
                             CFG['space-track'],
                             CFG['sync']['satellites'],
                             loop))

        try:
            loop.run_forever()
        finally:
            loop.close()


More code examples into `examples` directory

Source code
-----------

The latest developer version is available in a github repository:
https://github.com/nkoshell/tle-storage-service
ooquery 0.8.2
OpenObject Query Parser
License: MIT

****************
OpenObject Query
****************

Python 2.7 and >=3.5

.. image:: https://travis-ci.org/gisce/ooquery.svg?branch=master
    :target: https://travis-ci.org/gisce/ooquery
.. image:: https://coveralls.io/repos/github/gisce/ooquery/badge.svg?branch=master
    :target: https://coveralls.io/github/gisce/ooquery?branch=master
.. image:: https://img.shields.io/pypi/v/ooquery.svg
    :target: https://pypi.python.org/pypi/ooquery


Parsers OpenObjectes queries like:

.. code-block:: python

   import pyscopg2

   from oopgrade.oopgrade import get_foreign_keys
   from ooquery import OOQuery

   conn = psycopg2.connect("dbname=test user=postgres")
   with conn.cursor() as cursor:
       def fk_function(table):
           return get_foreign_keys(cursor, table)

       q = OOQuery('account_invoice', fk_function)
       sql = q.select(['number', 'state']).where([
           ('state', '=', 'open'),
           ('partner_id.name', '=', 'Pepito')
       ])
       cursor.execute(*sql)

Support for reading from joined tables

.. code-block:: python

    q = OOQuery('account_invoice', fk_function)
    sql = q.select(['number', 'partner_id.name', 'partner_id.vat']).where([
        ('state', '=', 'open')
    ])
python-c 1.0
An alternative to python -c with much less typing, at the price of being dirtier.
License: MIT

python-c
========

An alternative to python -c with much less typing, at the price of being dirtier.

**Installation**::

    $ pip install python-c

Usage
=====

If you have a file named foo.py with::

    def quite():
       return 5
    def loud():
        print 'hello'
    def double(arg):
       return arg*2

Instead of::

  $ python -c "import foo; foo.loud();"
  hello

You can now write::

    $ python-c foo 'loud()'
    hello

You can load multiple files::

  $ python-c foo,foo2 'loud()'
  hello

or directories::

  $ python-c ./,./dir1,./dir2/test.py 'loud()'
  hello

In cases where it works (e.g clashes between files are benign), you can **minimize your typing** and omit the first argument, the current directory is then loaded by default::

    $ python-c 'loud()'
    hello

Printing
========

Printing is handled for you::

    $ python-c foo 'quite()'
    5

The result of the call (if any) is printed, even though the function does not call 'print'.

More examples
=============

You can pass arguments to your functions::

    $ python-c foo 'double(2)'
    4

You can execute arbitrary code in your single line::

    $ python-c foo '"hot" if double(2) == 4 else "cold"'
    hot

This includes printing::

    $ python-c foo.py 'print "double {} is {}".format(2, double(2))'
    double 2 is 4

Rationale
=========
**Time** is our most valuable non-possesion. The python interpreter must be clean and unambiguous, including the way it handls it's option '-c'. However, more often than not, I will accept being dirty (e.g live with benign clashes between files) and simply type **python-c 'test23()'** as opposed to the double as long **python -c 'import foo.py; foo.test23()'**. Such dirty functionality should not be built into the interpreter, hence *python-c*: the tool playfully indicates its motivation by saving you from typing a space between 'python' and '-c'.