semvec/pypi-packages huggingface dataset:
django-submodel 0.1
A Django json field behaves as a model instance and supports seamless inline editing in Django admin.
License: MIT

===============
django-submodel
===============

A Django field which: works like a model instance, stores sub-model fields in single DB column, and supports smooth editing in Django admin. 

django-submodel works on Django 1.3+

Installation
============
#. ``pip install django-submodel``

Usage
=====

::

    # in you_app/models.py

    from django.db import models
    from submodel.fields import SubModelField


    # Define (field_name, model_field_instance) tuples in "fields" parameter in SubModelField,
    #   similar as normal Model definition
    # If SubModelField such as pref field is newly added to an existed model,
    #   you may want to use south to migrate the schema
    class UserProfile(models.Model):
        realname = models.CharField(max_length=100)
        pref = SubModelField(u'user preference',
                     fields=(
                         ('title', models.CharField(max_length=10)),
                         ('color', models.IntegerField(choices=((0, 'Black'), (1, 'White')))),
                         ('birthday_day', models.DateTimeField()),
                         ('feel_luck', models.BooleanField(default=True))))

::

    # in you_app/admin.py, to enable editing of sub fields of pref in Django admin

    from submodel.admin import SubModelFieldInlineAdmin
    from . models import UserProfile

    class PrefInilneAdmin(SubModelFieldInlineAdmin):
        model = UserProfile._meta.get_field('pref').submodel # TODO improve

    class UserProfileAdmin(admin.ModelAdmin):
        inlines = [PrefInilneAdmin]

    admin.site.register(UserProfile, UserProfileAdmin)

::

    >>> # TODO in Python shell, the value of pref field as a model instance


TODO
====
    - add tests
    - simpler API
    - dump and modify Deserializer to support missing subfields. schema policy?
    - better history
    - check compatibility w/ django-reversion and others ...
    - possible config
    - more strict check such as attname confliction, for example FK field user and field user_id
django-nosqladmin 0.1.1
An introspective interface for Django and Document Based NoSQL databases
License: MIT
Keywords: mongodb,django,nosql

=================
django-nosqladmin
=================

Many NoSQL databases, mostly the Document based ones, translate into Python as a list of dictionaries, right? So why do us developers try to staple document databases into Django's traditional style relational introspection and tools? It's like we're trying to add object impedance mismatch to something that avoids it in the first place.

Taking lessons learned from django-mongonaut, django-nosql-admin is an introspection tool for NoSQL databases. Our original test case is MongoDB, but if this works we'll invite authorship of interfaces for other NoSQL databases.

Fundamentals
============

* Display the results of lists of dictionaries
* mongoadmin.py features:

    * Define a collection
    * Only show ObjectId by default
    * Can add search fields which attempt to search
    * Can add list fields which try to display
    * Define which collections are displayed.
    
Sample mongoadmin.py file::

    # mongoadmin.py
    class ProfileAdmin(MongoAdmin):
        
        collection = 'Profile'
        search_fields = ['username']
        list_fields = ['username']
    
        def has_view_permission(self, request):
            return True

    class ArticleAdmin(MongoAdmin):

        collection = 'Article'
        search_fields = ['title',]
        list_fields = ['title','create_date']

            
    admins = [ProfileAdmin(), ArticleAdmin()]
mordor 1.1
Land of Shadow
License: MIT

Three sides of Mordor were bounded by mountain ranges, arranged in a rough
rectangle: Ered Lithui, translated as 'Ash Mountains' in the north, Ephel
Duath, translated as 'Fence of Shadow' in the west, and an unnamed (or was
possibly still called Ephel Duath) range in the south. In the northwest corner
of Mordor, the deep valley of Udun formed the region's gate and guard house.
That was the only entrance for large armies, and was where Sauron built the
Black Gate of Mordor, and later where Gondor built the Towers of the Teeth.
Behind the Black Gate, these towers watched over Mordor during the time of
peace between the Last Alliance and Sauron's return. In front of the Morannon
lay the Dagorlad or the Battle Plain.
mylit 0.1.2
Literate programming for Python
License: MIT
Keywords: literate programming

`mylit` is a simple tool for literate programming in Python.

Literate Python programs are just regular Python source files with extensive
comments. When `mylit` is run with a literate Python program as input, it
creates an HTML file containing the comments and highlighted source code.  You
can use HTML markup in comments as you may see fit.

In addition to simple comments, the HTML compilation process can be customized
by starting a comment line with `##`. Anything that follows on such a line will
be executed in the parser's context. The code can, for example, set variables,
manipulate the generated HTML, or generate debug output. Look at the `mylit`
source code to see what it can do.

Lines starting with `#!` are ignored completely. This way, you can comment out
things that are not meant to be included in the final HTML file.

Here's a simple example of what a literate program might look like::

    #!/usr/bin/env python
    #! This line is ignored, as is the previous line.

    #! Set the title variable of the parser:
    ## title = "mylit example"

    # <h1>A simple mylit example</h1>
    # This is a simple example of literate <a
    # href="http://www.python.org/">Python</a> programming with <a
    # href="http://pypi.python.org/pypi/mylit">mylit</a>.

    # Here we define a function that checks whether a given pair of coordinates
    # lies within a circle of radius <code>r</code>.
    def in_circle(x, y, r):
        # We first square both <code>x</code> and <code>y</code>, and sum them up.
        s = x ** 2 + y ** 2

        # <p>Note how the above comment contains HTML markup. The indentation of
        # the highlighted Python code is unaffected by interspersed comments.</p>

        # Here we check whether the coordinates (<code>x</code>, <code>y</code>)
        # lie within a circle of radius <code>r</code>.
        if s < r ** 2:
            # Everything's okay, so we can return <code>True</code>:
            return True
        else:
            # We may have a problem here. Better print a warning.
            import warnings
            warnings.warn("Danger, Will Robinson!")
            return False

    # When this program is run from the command line, it performs a simple test.
    if __name__ == "__main__":
        assert in_circle(3, 4, 5.1) == True
        assert in_circle(3, 4, 4.9) == False

Of course, `mylit` itself is a literate Python program.
django-qwert 0.2.2
A trivia collection framework for Django
License: MIT
Keywords: django trivia snipet collection framework

django-qwert is a trivia snippet collection of Django which used in 
`Kawaz <http://www.kawaz.org>`_

Install
==============
::

    pip install django-qwert

Features
================

1.  Http403 exception

    Like ``Http404`` exception. You can raise ``Http403`` exception and
    ``HttpResponseForbidden`` will be responsed

2.  User based exception

    Super user can see Django technical exception page even when
    ``DEBUG=False``

3.  Global request

    Developpers can access ``request`` instance duaring request process
    with thread local mechanisms

4.  ``with_request`` decorator

    To enable handling ``request`` instance in form, convert form class and 
    classbased generic view class. It is useful to determine the author of
    the object in method of form.

5.  Useful templatetags and some extra builtin templatetags

    +   expr (extra builtin)

        calculate python expression in template

    +   evaluate

        evaluate django template in string

    +   truncateletters (extra builtin)
    
        like ``truncatewords``, this truncate letters. Useful to use the
        language which does not have space for delimiter (like Japanese,
        Chinese ...etc)

    +   markdown

        enhanced markdown filter which can care about the markdown extensions.
        ``markdown`` is required to use this templatetag.

    +   urlize_html

        ``urlize`` filter for HTML string. ``BeautifulSoup`` is required to
        use this templatetag

6.  Enhanced override_settings

    Similar with Django 1.4 ``override_settings`` but it will recall
    ``syncdb`` command when new app is appended to ``INSTALLED_APPS``.
    And ``with_apps`` and ``without_apps`` decorator/context manager is 
    added.

7.  Automatically test user is created in ``syncdb`` command

Settings
================

``AUTO_CREATE_TESTUSER``
    To disable automatically creating test user in ``syncdb`` command, set
    ``False`` to this setting. Default: ``True``

``TESTUSER_USERNAME``
    An username of test user. Default: ``'admin'``

``TESTUSER_EMAIL``
    An email address of test user. Default: ``"%s@test.com" %
    TESTUSER_USERNAME``

``TESTUSER_PASSWORD``
    A password of test user. Default: ``'password'``

``ENABLE_EXTRA_BUILTINS``
    To disable adding extra templatetags to buitlin, set ``False``.
mapq 0.3
An easy-to-use Mapquest Geocoding API wrapper.
License: MIT
Keywords: mapquest,geocoding,google maps,geocode

Interacting with the Mapquest Geocoding API should be easy.

    >>> import mapq

    >>> mapq.key('my_api_key')

    >>> mapq.address('155 9th St San Francisco, CA')
    [{'lots': {'of': 'results'}}, ...]

    >>> mapq.batch('94103', '1 Infinity Loop Cupertino', 'Yerba Buena Park')
    [{'multiple': 'locations'}, ...]

    >>> mapq.geocode('155 9th St San Francisco, CA')
    {'single': {'geocode': 'result'}}

    >>> mapq.reverse(37.775002, -122.418297)
    {'looks': {'like': '155 9th St'}}

    >>> mapq.latlng('155 9th St San Francisco, CA')
    {'lat': 37.775002, 'lng': -122.418297}