Saravanan666/pypi-org huggingface dataset:
Package: django-inline-svg
A simple plugin that adds ansvgtemplate tag to inline your SVGs in your
Django templates.InstallationInstall it from pypi.$ pip install django-inline-svgAddsvgto yourINSTALLED_APPS.INSTALLED_APPS = (
    ...
    'svg',
    ...
)UsageStore your SVGs in folder namedsvgat the root of any of your static file
directories.my_app
|-- static
|   |-- svg
|       |-- logo.svg
|       |-- check.svg
|       |-- cross.svgUse thesvgtemplate tag.{% load svg %}

<h1 class="logo">{% svg 'logo' %}</h1>You can setSVG_DIRSto control where to look for your svgs.# settings.py

SVG_DIRS=[
    os.path.join(BASE_DIR, 'my-svgs')
]SupportThe tests are run against Django 1.8, 1.9, 1.10 on Python 2.7, 3.3, 3.4, 3.5.LicenseMIT
Package: django-inline-wrestler
django-inline-wrestler=======================Make django admin lists easier to sort with jQuery and Grappelli.This plugin turns an ordinary order field into a high-powered sorting tool including:* Drag-and-Drop* Jump to Top and Jump to Bottom buttons* Jump one up and Jump one bottom* Send directly to a position in the list* Sort by a custom fieldFor inline admin forms:* Adjust table headers so they line up with the actual columns* Make table headers sortable, so you can sort by a particular field (supports sorting by text inputs, text areas, check boxes, image uploads, and fks)* Positioning order buttons anywhere in the table![Screenshot of Django inline items](/../master/docs/screenshots/screenshot.png?raw=true "Screenshot of Tabular Inline Items")![Screenshot of Django inline items](/../master/docs/screenshots/simplified.png?raw=true "Screenshot of simplified Inline Items")Requirements=====Requires Django and django-grappelliUsage=====1. pip install django-inline-wrestler2. Add 'django_inline_wrestler' to your INSTALLED_APPS list in your project's settings.py```pythonfrom django_inline_wrestler.admin import TabularInlineOrderable, AdminListOrderablefrom .models import *class ItemInline(TabularInlineOrderable):"""To bring drag-and-drop functionality to an inline:"""model = Itemfields = ('order', 'name', 'txtid', 'description')prepopulated_fields = {'txtid': ('name',)}class SubItemInline(TabularInlineOrderable):"""To bring drag-and-drop functionality to an inline, sorting on a custom field:"""model = SubItemfields = ('position', 'name', 'txtid')prepopulated_fields = {'txtid': ('name',)}#To override which field is used for ordering, add a class starting with order-by-[fieldname]. Make sure to also includeclasses = ['django-inline-wrestler', 'order-by-position']#Add any of the following css classes to this list to disable any of the buttons:#'inline-wrestler-drag-disabled', 'inline-wrestler-move-disabled',#'inline-wrestler-move-bottom-disabled', 'inline-wrestler-move-top-disabled',#'inline-wrestler-move-up-disabled', 'inline-wrestler-move-down-disabled',#'inline-wrestler-jump-disabled'class ObjectAdmin(AdminListOrderable):"""To bring drag-and-drop functionality to a changelist view:"""model = Objectfields = ('priority', 'title')list_editable = ('priority',)change_list_template = 'admin/django_inline_wrestler/change_list.html'custom_list_order_by = 'priority'inlines = [ItemInline, SubItemInline]```
Package: django-in-memory-models
## IntroduceFor 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)@classmethoddef get_by_user(cls, pk):instance = cls(user_id=pk)return instancedef __str__(self):return '<Account Statistics: %s>' % self.users = User.objects.first().statisticss.total_subscription.reset()print(s.total_subscription.value)s.total_subscription += 1print(s.total_subscription.value)s.total_subscription = 200print(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```01200[<AccountStatistics: <Account Statistics: oldcai>>]<Account Statistics: oldcai>oldcai200```## TODO- Django system cache backend
Package: django-inoa-chronograph
Chronograph is a simple application that allows you to schedule management commands to be run at regular intervals.
Schedules can be defined in Django’s built-in admin interface. Requires cron or a similar tool (e.g. Windows Task Scheduler).Chronograph has been forked by Inoa (http://www.inoa.com.br) so we could continue to update and maintain the library.
The former version in PyPI was out of date and apparently no longer mantained. Multiple forks exist around the internet
(mainly in GitHub), and we hope to eventually combine the best from all of them.Grab the source or view the full documentation in GitHub:https://github.com/joaofrancese/django-chronograph
Package: django-in-request-cache
Django cache backend stored in django requestInstallation$pipinstalldjango-in-request-cacheFast InRequestCacheInRequestCache is implementation of django cache interface.
It uses instance of python dict assigned to each django request object to store cached values.django-globalsis used to make request object accessible everywhere.
This cache has the same limitations as standard django InMemory cache - Cross process access isn’t possible.
InRequestCache goes one step further and makes cross thread access impossible.
InRequestCache is different in each request.
InRequestCache should be faster than InMemory cache, because there is no read/write lock.
It makes sense to use InRequestCache for values which will be accessible multiple times in the same request.
Cache invalidation is hard, but because cache lives for request period only it isn’t a big problem.Quick startAdd “django-in-request-cache” to your setting as cache like this:from django.conf.global_settings import CACHES as DEFAULT_CACHES

CACHES = dict(
    DEFAULT_CACHES,
    cache_in_request={
        'BACKEND': 'django_in_request_cache.cache.InRequestCache',
        # 'LOCATION': '_dinr_cache',  # request property name to store data
        # 'OPTIONS': {
        #     # if set then no value is stored for more than MAX_TIME time.
        #     'MAX_TIMEOUT': 10,  # in seconds,
        # },
    },
)Add django-globals middleware to your settings like this:MIDDLEWARE_CLASSES = [
    ...,
    'django_globals.middleware.Global',
]Speed up slower cache with faster cacheWhy do we want to cache a cache?
In my case I have one value in redis cache, which was accessed 20 times during the same django request.
Every read from redis takes ~1ms, it makes ~20ms just read the same value 20 times.
To speed it up I want cache my value in faster cache (InRequestCache, InMemoryCache etc.)
CacheACache class is implementation of django cache interface which allows read value from slower cache
only once and ‘cache’ it again in faster in memory cache.
Most of the time faster cache is back populated from slower cache. In this case we doesn’t have information whe value expire.
In that case cache max expiration time for cached value is value expire time + slow cache expiration time.
Therefore fast cache expiration timeshould be set very low(in number of seconds).CacheACache configurationHow to cache a slower but cross process cache backend:from django.conf.global_settings import CACHES as DEFAULT_CACHES

CACHES = dict(
    DEFAULT_CACHES,
    redis_cache = {
        'BACKEND: 'redis_cache.RedisCache',
        ...
    },
    cache_in_request={
        'BACKEND': 'django_in_request_cache.cache.InRequestCache',
        'LOCATION': '_redis_cache_mirror',  # request property name
    },
    combined_in_request_and_redis_cache={
        'BACKEND': 'django_in_request_cache.cache.CacheACache',
        'OPTIONS: {
            'FAST_CACHE': 'cache_in_request',  # cache alias
            'FAST_CACHE_MAX_TIMEOUT': 5,  # in seconds
            'CACHE_TO_CACHE': 'redis_cache',  # cache alias
        },
    },
)RequirementsDjango>= 1.6django-globals>= 0.2LicenseThe MIT License
Package: django-insight
Django Insight User Guide=========================Insight keeps track of how users get to your site. It allows you to create an origin with an associated URL. If a user browses to this URL,they are redirected to the main site and their origin is stored when they register. You can browse to Insight on Django's admin interface tosee stats like registration growth per origin and the percentage of users coming from a specific origin.How to use----------1. Add `insight` to INSTALLED_APPS.2. Run `manage.py migrate insight` (requires South).3. Create as many origins as you need via the Django admin interface (URLs are automatically generated).4. Use the URLs on other websites to direct people to your site.Requirements------------- Django 1.4 and above- The following Django modules:- `django.contrib.auth`- `django.contrib.contenttypes`- `django.contrib.sessions`- The following Django middlewares:- `django.contrib.auth.middleware.AuthenticationMiddleware`- `django.contrib.sessions.middleware.SessionMiddleware`- SouthAuthors=======Praekelt Foundation-------------------* Rizmari VersfeldChangelog=========0.2.2 (10-09-2014)------------------#. Allow a hyphen as part of the tracking code.0.2.1 (22-10-2013)------------------#. Replace deprecated `adminmedia` with `staticfiles` tag.#. Fix bugs in graph drawing.0.2 (22-10-2013)----------------#. Support for custom user models in Django 1.5 and up.0.1 (02-04-2013)----------------#. Send `origin_hit` signal on url hit. Other apps can use it for custom tracking.#. Can enable/disable registration tracking per origin.#. Add ability to record querystring parameters in tracking urls.0.0.1 (28-06-2012)------------------#. First release
Package: django-inspect
Provides inspection conveniences fordjangomodels.FeaturesConvenience attributesall_fieldsAll model fields, including all relationships (back and forth).fieldsOnly local fields, ie. any regular field and relationships (excluding backwards).non_rel_fieldsBasically the same thing asfields, but excluding all relationships.fk_fieldsLocal foreign key fields.backwards_fk_fieldsOnly backwards foreign key fields.all_fk_fieldsAll foreign key fields (back and forth).m2m_fieldsLocal many to many fields.backwards_m2m_fieldsOnly backwards many to many fields.all_m2m_fieldsAll many to many fields (back and forth).Sub-inspectingFuther inspection on relationship fields.After inspecting a model (creating anInspectinstance) call:inspect.sub_inspect("field")Paths are supported too:inspect.sub_inspect("field.other_field..")It returns a newInspectinstance, containing information about
the target model of the relationship field.InstallationAvailable throughpip:$ pip install django-inspectUsageSimple inspectionfromdjango.contrib.auth.modelsimportUserfromdjango_inspectimportInspectinspect=Inspect(User)# Using an instance/object is also possible.# user = User()# inspect = Inspect(user)inspect.fields[u'id','password','last_login','is_superuser','username','first_name','last_name','email','is_staff','is_active','date_joined','groups','user_permissions']inspect.non_rel_fields[u'id','password','last_login','is_superuser','username','first_name','last_name','email','is_staff','is_active','date_joined']inspect.m2m_fields['groups','user_permissions']inspect.backwards_fk_fields['logentry_set']Sub-inspectingfromdjango.contrib.auth.modelsimportUserfromdjango_inspectimportInspectinspect=Inspect(User)sub_inspect=inspect.sub_inspect("user_permissions")sub_inspect.all_fields[u'id','name','content_type','codename']futher_inspect=sub_inspect.sub_inspect("content_type")futher_inspect.all_fields[u'id','name','app_label','model']# Sub-inspecting by pathsub_inspect=inspect.sub_inspect("user_permissions.content_type")sub_inspect.all_fields[u'id','name','app_label','model']TestingInstallRunmake installto install dev requirements.Run testsRunmake testto run tests.
Package: django-inspectdb
A fork of Django management commandinspectdb. It was first created to get
the correctmax_lengthof MySQL inspection, seeticket #5725.InstallationFirst install the package using pip:pip install django-inspectdbAdd it to yourINSTALLED_APPS:INSTALLED_APPS = (
    ...
    'inspectdb',
    ...
)UsageJust use it as the normalinspectdb management command:python manage.py inspectdb > models.py
Package: django-inspectdb-refactor
[![PyPI version](https://badge.fury.io/py/django-inspectdb-refactor.svg)](https://badge.fury.io/py/django-inspectdb-refactor)Django Inspectdb Refactor========================A simple utility command based on django inspectdb management command.Overview:---------Django's ``inspectb`` command prepares database models classes based on existing database.This is very handy tool, in case we have to work on some already existing database.It outputs the classes to standard output, which can be pipelined to a python file.But when you have a large database, containing hundreds of tables, the models file becomes too large. It is better to write ``separate model file for each table`` and keep that under models folder inside the app directory. Django will get the model classes from the ``init`` file you write inside the models folder.Same holds for admin, views and forms.Django Inspectdb Refactor will automatically create the required folders and create separate python files for each model.Requirements:-----------Requires Django version >= 1.9Installation:------------You can install it via pip or to get the latest version clone this repo.`pip install django-inspectdb-refactor`Add ``inspectdb_refactor`` to your ``INSTALLED_APPS`` inside settings.py of your project.Usage:-----The command accepts two command line arguments:- ``app`` : This is a required argument. You need to provide app_label in order tomake models in that particular app.- ``database``: To specify a particular database. Otherwise picks default from settings.For example, If you have an app called ``products`` and database ``product_db`` then`python manage.py inspectdb_refactor --database=product_db --app=products`License:--------Django Inspectdb Refactor is an Open Source project licensed under the terms of the BSD3 license.
Package: django-inspect-model
Django-inspect-modelAuthors: Mathieu Agopian andcontributorsLicence: BSDCompatibility: Python 2.6, Python 2.7, Python 3.3, Python 3.4, Django 1.3+Requirements: noneProject URL:https://github.com/magopian/django-inspect-model/Documentation:http://django-inspect-model.readthedocs.org/en/latest/Django-inspect-model is a model inspection utility for Django. It allows you to
easily list all available “items” on a model, and get their value.An item is either:a django field (standard field or relation field)a standard attributea method that only takes one attribute: ‘self’a propertyThe code is generic enough to be applied on just any python object, so Django
isn’t a requirement. However, it was tailored towards Django models.InstallUsing pip:pip install django-inspect-modelUsageInstantiateinspect_model.InspectModelwith your model class or instance, and profit.>>> from django.contrib.comments.models import Comment
>>> from inspect_model import InspectModel
>>> im = InspectModel(Comment)
>>> im.fields
['comment', 'id', 'ip_address', 'is_public', 'is_removed', 'object_pk',
'submit_date', 'user_email', 'user_name', 'user_url']
>>> im.relation_fields
['content_type', 'site', 'user']
>>> im.many_fields
['flags']
>>> im.attributes
[]
>>> im.methods
['get_as_text', 'get_content_object_url']
>>> im.properties
['email', 'name', 'pk', 'url', 'userinfo']
>>> im.items
['comment', 'content_type', 'email', 'flags', 'get_as_text',
'get_content_object_url', u'id', 'ip_address', 'is_public', 'is_removed',
'name', 'object_pk', 'pk', 'site', 'submit_date', 'url', 'user',
'user_email', 'user_name', 'user_url', 'userinfo']HackingSetup your environment:git clone https://github.com/magopian/django-inspect-model.git
cd django-inspect-modelHack and run the tests usingToxto test
on all the supported python and Django versions:make testTo build the docs:make docs
Package: django-inspire-eu
Django Inspire EUThis package is the django implementation from thethemesof the infrastructure for spatial information in Europe (INSPIRE)DocumentationThe full documentation is athttps://django-inspire-eu.readthedocs.io.QuickstartInstall Django Inspire EU:Stable version, preferably within a virtual environment:$ mkvirtualenv django-inspire-eu
$ pip install django-inspire-euDevelopment version:$ pip install -e git+https://github.com/xusy2k/django-inspire-eu.git@master#egg=django-inspire_euAdd it to yourINSTALLED_APPS:INSTALLED_APPS = (
    ...
    "inspire_eu.apps.InspireEuConfig",
    ...
)Customizesettings:INSPIRE_EU_THEMESINSPIRE_EU_DEFAULT_SRIDINSPIRE_EU_BASE_MODELMIGRATION_MODULES:Very importantif you
want avoid problems with migrations filesMake and execute migrations:python manage.py makemigrations
python manage.py migratePopulate base models:This django command fetch values fromhttps://inspire.ec.europa.eu. In particular: Status:
(valid,invalid,retired),Theme,Application Schema,Code Listand
For each Code List key, fetch all its Code List Valuespython manage.py load_initial_inspire [-l <language>]  # Default: enAdd Django Inspire EU's URL patterns:from inspire_eu import urls as inspire_eu_urls

urlpatterns = [
    ...
    url(r"^", include(inspire_eu_urls)),
    ...
]Working exampleFollow steps atdjango-example
directoryRunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxDevelopment commandspip install -r requirements_dev.txt
invoke -lCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.2.2 (2021-06-01)Fixed related_name and related_query_name at AbstractOfficialArea modelUpdated python-slugify according its documentation0.2.1 (2021-03-19)Added BaseInspireEUModel at CadastralZoning and CadastralParcelTypo fixed AbstractCadastralParcel.national_cadastal_reference to
AbstractCadastralParcel.national_cadastral_reference0.2.0 (2021-02-26)First release on PyPI.0.1.0 (2021-02-07)First release on GitHub.
Package: django-instagram
master================
django-instagram
================A Django application that allows to use some template tags to display content
from an Instagram public profile.RequirementsDjango >= 1.11lxmlrequestssorl-thumbnailPillowInstallationInstall Django with your favourite linux packaging system or you can use pip
for installing python packages, if Django is not an official package for
your distribution:Use pip to install Django Instagram:pipinstalldjango-instagramPip should take care of the package dependencies for Django Instagram.ConfigurationAdd the application to INSTALLED_APPS:INSTALLED_APPS=('...','django_instagram',)Rebuild your application database, this command depends on which
version of Django you are using.In Django 2.0 (recommended):pythonmanage.pymakemigrationsdjango_instagramThem migrate the db:pythonmanage.pymigrateUsageTheinstagram_user_recent_mediabrings into context two objects:profile: Contains the who scraped object.recent_media: Contains the recent media, like 10 or 12 entries or so.A Djangourls.pyexample using aTemplateViewView class with a context variable calledinstagram_profile_name:fromdjango.contribimportadminfromdjango.urlsimportpathfromdjango.views.genericimportTemplateViewurlpatterns=[path('admin/',admin.site.urls),path('',TemplateView.as_view(template_name='index.html',extra_context={"instagram_profile_name":"amd"})),]You can display the data contained inrecent_medialist like this:<!DOCTYPE html>{% load instagram_client %}<htmllang="en"><head><metacharset="UTF-8"><title>{{ instagram_profile_name|capfirst }} Instagram feed</title></head><body><h1>{{ instagram_profile_name|capfirst }} Instagram Feed</h1><divid="django_recent_media_wall">{% instagram_user_recent_media instagram_profile_name %}
    {% for media in recent_media %}<divclass="django_instagram_media_wall_item"><ahref="//instagram.com/p/{{ media.shortcode }}"target="_blank"><imgsrc="{{ media.thumbnail_src }}"/><span>{{ media.edge_media_to_caption.edges.0.node.text }}</span></a></div>{% endfor %}</div><p>Got from instagram</p></body></html>There are also two inclusion tags that includes an example of
how to parse data from Instagram, you can also use them like
this:{% load instagram_client %}<h1>Instagram media wall</h1>{% instagram_recent_media_wall username="intel" %}<h1>Instagram sliding box</h1>{% instagram_recent_media_box username="intel" %}FiltersAs you may have noticed some filters can be used for sizing
the pictures, here is the list of the usable fitlers:For standard size:{% for media in recent_media %}
...<imgsrc="{{ media.thumbnail_src|standard_size }}"/>...
{% endfor %}For low resolution images:{% for media in recent_media %}
...<imgsrc="{{ media.thumbnail_src|low_resolution }}"/>...
{% endfor %}For thumbnail size:{% for media in recent_media %}
...<imgsrc="{{ media.thumbnail_src|thumbnail }}"/>...
{% endfor %}Releases0.3.2 Compatibility fix for Django 3.0.3.1 Template tag accepts context variables.0.3.0 Updates to the scraping algorithm.0.2.0 New scraping algorithm, removed Python Instagram.0.1.1 Numerous bug fixes, better documentation.0.1.0 Work in progress version.
Package: django-instagram-api
Django Instagram API====================[![Build Status](https://travis-ci.org/ramusus/django-instagram-api.png?branch=master)](https://travis-ci.org/ramusus/django-instagram-api) [![Coverage Status](https://coveralls.io/repos/ramusus/django-instagram-api/badge.png?branch=master)](https://coveralls.io/r/ramusus/django-instagram-api)Application for interaction with Instagram API objects using Django ORMInstallation------------pip install django-instagram-apiAdd into `settings.py` lines:INSTALLED_APPS = (...'oauth_tokens','m2m_history','taggit','instagram_api',)# oauth-tokens settingsOAUTH_TOKENS_HISTORY = True                                        # to keep in DB expired access tokensOAUTH_TOKENS_TWITTER_CLIENT_ID = ''                                # application IDOAUTH_TOKENS_TWITTER_CLIENT_SECRET = ''                            # application secret keyOAUTH_TOKENS_TWITTER_USERNAME = ''                                 # user loginOAUTH_TOKENS_TWITTER_PASSWORD = ''                                 # user passwordUsage examples--------------### Simple API request>>>from instagram_api.models import User, Media>>>u = User.remote.fetch(237074561)>>>print utnt_online>>>followers = u.fetch_followers()>>>medias = u.fetch_recent_media()>>>print medias[<Media: 935546412924881779_237074561>, <Media: 935398934535687014_237074561>, <Media: 935385433641536074_237074561>...]>>>m = Media.remote.fetch('937539904871536462_190931988')>>>comments = m.fetch_comments()>>>likes = m.fetch_likes()
Package: django-installable-skeleton
This is sample code used in the Real Python article [Writing an Installable Django App](???). The article describes how to take an app from an existing Django project and make it a stand-alone installable package avilable on PyPI.Installable AppThis app models a list of items on a receipt. Each item has a description and a cost. A receipt may reference multiple items.This app can be installed and used in your django project by:$pipinstallrealpython-django-receiptsEdit yoursettings.pyfile to include‘receipts’in theINSTALLED_APPSlisting.INSTALLED_APPS=[...'receipts',]Edit your projecturls.pyfile to import the URLs:url_patterns=[...path('receipts/',include('receipts.urls')),]Finally, add the models to your database:$./manage.pymakemigrationsreceiptsThe “project” BranchThemaster branchcontains the final code for the PyPI package. There is also aproject branchwhich shows the “before” case – the Django project before the app has been removed.Docs & SourceArticle:https://realpython.com/installable-django-app/Source:https://github.com/realpython/django-receiptsPyPI:https://pypi.org/project/realpython-django-receipts/