Saravanan666/pypi-org huggingface dataset:
Package: django-splitdate
django-splitdateThis app provides a form widget that uses three text inputs to enter the
day, month and year of a date for a standard DateField. The field is
based on Django’s forms.SplitDateTimeWidget.Quick startInstall django-splitdate:From the pip repository:pip install django_splitdateor directly from github:
`pip installgit+git://github.com/NB-Dev/django-splitdate.gitAdddjango_splitdateto yourINSTALLED_APPS:INSTALLED_APPS = (
    ...
    'django_splitdate',
)(optional) Customize the Settings (see below)Use the SplitDateField in your Forms:from django_splitdate.forms import SplitDateField
date = forms.SplitDateField()Global ConfigurationThe SplitDateField can be configured globally in your settings.py file
with the following optionsSPLITDATE_ORDER (String or Dict):Defines the ordering of the day, month and year fields.The order of the fields is defined by a three character string, that
contains the characters ‘d’(day), ‘m’(month), ‘y’(year) in the desired
order.The setting can either be such a string to be used on each
SplitDateField no matter what language is selected, or a dictionary
containing key, value pairs with a locale name as key and the
corresponding order string as value to be used depending on the current
localeDefault:dict((
    ('en', 'mdy'),
    ('de', 'dmy')
))SPLITDATE_PLACEHOLDER_DAY (String):A string defining the placeholder of the day field.Default:_('DD')SPLITDATE_PLACEHOLDER_MONTH (String):A string defining the placeholder of the month field.Default:_('MM')SPLITDATE_PLACEHOLDER_YEAR (String):A string defining the placeholder of the year field.Default:_('YYYY')Widget configurationIf you want to customize the widget of the SplitDateField, use the
SplitDateWidget.e.g. add a class:from django_splitdate.forms import SplitDateField, SplitDateWidget
    date = forms.SplitDateField(widget=SplitDateWidget(attrs={'class':'myclass'}))Additionally the widget takes the following local overwrites of the
global configurations at initialization:field_ordering (String or Dict):Local overwrite for SPLITDATE_ORDER. Possible values, see above.placeholder_day (String):Local overwrite for SPLITDATE_PLACEHOLDER_DAY. Possible values, see
above.placeholder_month (String):Local overwrite for SPLITDATE_PLACEHOLDER_MONTH. Possible values, see
above.placeholder_year (String):Local overwrite for SPLITDATE_PLACEHOLDER_YEAR. Possible values, see
above.Running the testsThe included tests can be run standalone by running thetests/runtests.pyscript. The only requirement for this is Django >=
1.7. If you also want to run coverage, you need to install it before
running the tests
Package: django-split-input
django_split_inputAboutThis is a django widget for multiple fixed size inputs for one form field. These could be used for those super fancy
verification code forms. The cursor is moved to the next input field using JS/jQuery.UsageInstalldjango_split_inputand add it to yourINSTALLED_APPS.pipinstalldjango-split-inputIn your settings.py:"django_split_input",InstalljQueryusing your preferred method (e.g.django-yarnpkg)Create a form with aCharField.UseSplitInputas a widget and supply the sizes of all input fields.fromdjangoimportformsfromdjango_split_inputimportSplitInputclassVerificationForm(forms.Form):auth_code=forms.CharField(label='Code',widget=SplitInput(sizes=(3,3,3)))
Package: django-split-settings
Organize Django settings into multiple files and directories. Easily
override and modify settings. Use wildcards in settings file paths
and mark settings files as optional.Readthis blog postfor more information.
Also, check thisexample project.RequirementsWhile this package will most likely work with the most versions ofdjango, weofficially support:2.23.24.04.1This package has no dependencies itself.In case you need olderpython/djangoversions support,
then consider using older versions ofdjango-split-settings.Installationpipinstalldjango-split-settingsUsageReplace your existingsettings.pywith a list of components that
make up your Django settings. Preferably create a settings package
that contains all the files.Here's a minimal example:fromsplit_settings.toolsimportoptional,includeinclude('components/base.py','components/database.py',optional('local_settings.py'))In the example, the filesbase.pyanddatabase.pyare included
in that order from the subdirectory calledcomponents/.local_settings.pyin the same directory is included if it exists.Note:The local context is passed on to each file, so each
following file can access and modify the settings declared in the
previous files.We also made an in-depthtutorial.Tips and tricksYou can use wildcards in file paths:include('components/my_app/*.py')Note that files are included in the order thatglobreturns them,
probably in the same order as whatls -Uwould list them. The
files are NOT in alphabetical order.You can modify common settings in environment settings simply importing them# local_settings.pyfromcomponents.baseimportINSTALLED_APPSINSTALLED_APPS+=('raven.contrib.django.raven_compat',)Do you want to contribute?Read theCONTRIBUTING.mdfile.Version historySeeCHANGELOG.mdfile.
Package: django-splitted-input
django_splitted_inputAboutThis is a django widget for multiple fixed size inputs for one form field. These could be used for those super fancy
verification code forms. The cursor is moved to the next input field using JS/jQuery.UsageInstalldjango_splitted_inputand add it to yourINSTALLED_APPS.pipinstalldjango-splitted-inputIn your settings.py:"django_splitted_input",InstalljQueryusing your preferred method (e.g.django-yarnpkg)Create a form with aCharField.UseSplittedInputas a widget and supply the sizes of all input fields.fromdjangoimportformsfromdjango_splitted_inputimportSplittedInputclassVerificationForm(forms.Form):auth_code=forms.CharField(label='Code',widget=SplittedInput(sizes=(3,3,3)))
Package: django-sponsors
Django App to easily manage Django projects sponsorsDocumentationThe full documentation is athttps://django-sponsors.readthedocs.org.InstallationInstall Django Sponsors:Using pip:pip install django-sponsorsAdd thesponsorsapplication toINSTALLED_APPSin your settings file:INSTALLED_APPS = (
    ...
    'sponsors',
    ...
)Sync database:``$ ./manage.py syncdb``  and
``$ ./manage.py migrate``Important:South 1.0 or greater is required to run migrations.Run the collectstatic management command:``$ /manage.py collectstatic``This will copy static sponsors.css into the directory given by the STATIC_ROOT setting.Load in your template the sponsors.css file like this:<link rel="stylesheet" href="{% static "sponsors/css/sponors.css" %}">This will copy static sponsors.css into the directory given by the STATIC_ROOT setting.[OPTIONAL] Add sponsors urls into your project’s urls.py file:(r'^sponsors/', include('sponsors.urls')),This will give url access to sponsors’ views, not many in the very firsts versions :-(UsageThen use it in a project:To show all sponsors in uncategorized way:{% show_sponsors %}To show only platinum sponsors with its default platinum styles (see sponsors.css):{% show_sponsors 'platinum' %}To show gold and silver sponsors with their default gold and silver styles (see sponsors.css):{% show_sponsors 'gold,silver' %}SettingsSPONSOR_EXPIRATES = FalseSPONSOR_EXPIRE_ON_MONTHS = 12SPONSOR_LOGO_WIDTH = 200SPONSOR_LOGO_HEIGHT = NoneFeaturesTemplate TagsModelsTestsTo run the tests on ‘sponsors’ application, simply type the following command:$ python manage.py test sponsorsTODOsadd more kind of representations (columns, with descriptions, titles, …)coverage 100%test logo custom sizestest logo sizes by catstest background colors by catsBecome a Sponsor ViewBecome a Sponsor FormCustom logo size and create thumbnail automaticallyContributingCheck the tips atCONTRIBUTING.Change logCheck the history changesCHANGELOG.LicenseMIT License. SeeLICENSE.History0.1.2 (2015-07-04)Renaming ‘type’ field to ‘category’0.1.1 (2015-05-28)First REAL release on PyPI :-)0.1.0 (2015-05-27)First release on PyPI.Basic Sponsor modelFirst version of templatetagSome tests on model, view and templatetagOptional default logo’s width and height in settingsBasic stylesAdmin customizedIncludes a ListView of Sponsors
Package: django-spread
django-spreadStartingThese instructions will allow you to install the library in your python project.Current featuresGet default payload.Create shipping.Get events.Get status.Pre-requisitosPython >= 3.7Django >= 3requests >= 2InstallationTo get the latest stable release from PyPi:pip install django-spreadorFrom a buildgit clone https://gitlab.com/linets/ecommerce/oms/integrations/django-spreadcd {{project}}python setup.py sdistand, install in your project djangopip install {{path}}/django-spread/dist/{{tar.gz file}}Settings in django projectDJANGO_SPREAD = {
    'SPREAD': {
        'BASE_URL': '<SPREAD_BASE_URL>',
        'ID': '<SPREAD_ID>',
        'SECRET': '<SPREAD_SECRET>',
    }
}UsageCreate instance to be sentimport json
from types import SimpleNamespace

dict_ = {
    'reference': '99999',
    'created_at': '12/12/21',
    'shipping_date': '12/12/21',
    'expiration_date': '26/12/21',
    'tracking_code': '6075620-1',
    'transport_guide_number': '1121632479536-01-1',
    'purchase_number': 'CLV0048146676851-1',
    'customer': {
        'first_name': 'Marcos',
        'last_name': 'Sac',
        'full_name': 'Marcos Sac',
        'phone': '932932932',
        'email': 'test@gmail.com',
        'rut': '16936195-9'
    },
    'address': {
        'street': 'ALEJANDRO VENEGAS CADIZ',
        'number': '513',
        'unit': 'DEPTO 6A',
        'full_address': 'ALEJANDRO VENEGAS CADIZ 513 DEPTO 6A'
    },
    'commune': {
        'name': 'Aisen',
        'code': '',
        'zone_code': '11201',
        'zone_post': 'WPA',
    },
    'location': {
        'code': 'MONTANDON',
        'name': 'MNN',
    },
    'region': {
        'name': 'Aysén del General Carlos Ibáñez del Campo',
        'code': '11',
        'iso_code': 'CL-XI',
    }
}

instance = json.loads(json.dumps(dict_), object_hook=lambda attr: SimpleNamespace(**attr))Get default payload:from spread.handler import SpreadHandler

handler = SpreadHandler()
default_data = handler.get_default_payload(<instance>)Create shipping:from spread.handler import SpreadHandler

handler = SpreadHandler()
default_data = handler.create_shipping(<default_data>)Get events:from spread.handler import SpreadHandler

handler = SpreadHandler()

raw_data = {
    'tracking_number': 999999,
    'status': 'entregado',
    'events': [{
        'city': 'Santiago'
        'state': 'RM',
        'description': 'Llego al almacén',
        'date': '12/12/2021'
    }]
}
response = handler.get_events(raw_data)

Output:
[{
    'city': 'Santiago'
    'state': 'RM',
    'description': 'Llego al almacén',
    'date': '12/12/2021'
}]Get status and if "is_delivered":from spread.handler import SpreadHandler

handler = SpreadHandler()

raw_data = {
    'tracking_number': 999999,
    'status': 'entregado',
    'events': [{
        'city': 'Santiago'
        'state': 'RM',
        'description': 'Llego al almacén',
        'date': '12/12/2021'
    }]
}
response = handler.get_status(raw_data)

Output:
('entregado', True)
Package: django-spreadsheet-reports
I was heavily inspired by http://code.google.com/p/django-reporting/. After playingwith django-reporting, I was wishing parts of it were implemented differently. And so,django-spreadsheet-reports was born.Although this project has been in development for a few years, it's documentation is very light.A few features provided by this are:* Ability to produce spreadsheet reports off of a user model by creating a reports.py in your appdirectories. The contents of the reports.py should look like:class UserStatsReport(django_spreadsheet_reports.Report):name = 'Simple User Report'slug = 'simple-user-report'model = UserStatsfilter_by = django_spreadsheet_reports.filters(django_spreadsheet_reports.DateFilter('user__date_joined'),django_spreadsheet_reports.Filter('user__date_joined', name='Days', multiple=True),)group_by = django_spreadsheet_reports.groupbys('user__date_joined',django_spreadsheet_reports.GroupBy('campaign__user__username',  name='Affiliate'),django_spreadsheet_reports.GroupBy('program__name',  name='Program'),django_spreadsheet_reports.GroupBy('referring_url',  name='Referring URL'),django_spreadsheet_reports.GroupBy('track__track',  name='Track'),django_spreadsheet_reports.GroupBy('tour__name',  name='Tour',additional_columns=[django_spreadsheet_reports.Column('tour__url', name='Tour URL'),django_spreadsheet_reports.Column('tour__program__name', name='Program'),]),)list_aggregates = django_spreadsheet_reports.columns(django_spreadsheet_reports.Column(Count('id'), name='Members'),* Exporting to CSV is built in* Sortable columnsRequirements: Python>=3.4, Django>=1.5Installation=============* pip install django-spreadsheet-reports* Add `django_spreadsheet_reports` to your installed apps* Add to your urls file: url(r'^reports/', include(django_spreadsheet_reports.site.urls)),* Create a reports.py in one of your app directories, and add a Report subclass in it.* Register your report subclass, by adding a line like this to the bottom of your reportsfile: django_spreadsheet_reports.site.register(UserStatsReport)
Package: django-spreadsheetresponsemixin
django-spreadsheetresponsemixinView mixin for django, that generates a csv or excel sheet.[![Build Status on Travis](https://travis-ci.org/aptivate/django-spreadsheetresponsemixin.svg?branch=master)](https://travis-ci.org/aptivate/django-spreadsheetresponsemixin)Installationpip install django-spreadsheetresponsemixinUsageAdd to your django view as a mixin:class ExcelExportView(SpreadsheetResponseMixin, ListView):
    def get(self, request):
        self.queryset = self.get_queryset()
        return self.render_excel_response()


class CsvExportView(SpreadsheetResponseMixin, ListView):
    def get(self, request):
        self.queryset = self.get_queryset()
        return self.render_csv_response()Note you must specify a Queryset, ValuesQueryset or ValuesListQueryset on the
class or pass it in when you call the render method.You can also specify the fields and the headers as tuples if you want to refine
the results and / or provide custom headers for your columns.Exported file will be named export.csv or export.xlsx by default, but you can
change this by either specifying export_filename attribute to name exported
file or export_filename_root to specify only the root part of it (and
let app take care of the appropriate extension).ChangelogNot available for 0.1.10 and earlier - sorry :s
Package: django-spring
Django SpringInstallingpipinstalldjango-spring--upgradeUsage# First start the server:springstart# Then run a manage.py command (eg. test)springtest--keepdb# Optionally, specify a settings module:DJANGO_SETTINGS_MODULE="base.settings"springtest--keepdbComparisonFor a large project I tested against, it reduced the test time from 27.8s to 14.5s! Most of the time savings are from app startup, so the largest difference will be felt for running small test suites for large projects.manage.py# time ./manage.py test --keepdb billing_service/tests/test_user.py
..........
----------------------------------------------------------------------
Ran 10 tests in 5.090s

OK
Preserving test database for alias 'default'...

real    0m27.773s
user    0m9.490s
sys     0m2.510sspring# time spring test --keepdb billing_service/tests/test_user.py
[APP] running command `test --keepdb billing_service/tests/test_user.py`
..........
----------------------------------------------------------------------
Ran 10 tests in 4.714s

OK
Preserving test database for alias 'default'...

real    0m14.457s
user    0m0.180s
sys     0m0.100sTweakable env varsDJANGO_SETTINGS_MODULE: The path to your settings module  (eg.base.settings)CODE_RELOADER_POLL_PERIOD: The number of seconds to wait between polling.
Setting this higher will improve performance when using the stat reloader.LOG_LEVEL: (DEBUG, INFO, WARN, ERROR, CRITICAL)
Package: django-sql
[![Build Status](https://travis-ci.org/luminousmen/django-sql.svg?branch=master)](https://travis-ci.org/luminousmen/django-sql)[![Coverage Status](https://coveralls.io/repos/github/luminousmen/django-sql/badge.svg?branch=master)](https://coveralls.io/github/luminousmen/django-sql?branch=master)[![PyPI version](https://badge.fury.io/py/django-sql.svg)](https://badge.fury.io/py/django-sql)[![Licence](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/luminousmen/django-sql/blob/master/LICENCE)Django-SQL====A simple app for executing SQL queries in Django admin panel.*! WARNINIG !*_Do not install this app if you afraid of consequences of giving access to database from admin panel._##### Requirements* Python3* Django 1.9##### Installation```pip install django-sql```Add to your `INSTALLED_APPS` in `settings.py`:```pythonINSTALLED_APPS = [...'sqlapp',]```Add to your `urls.py`:```pythonfrom sqlapp.sqlapp import execute_sqlurlpatterns = [url(r'^admin/sqlapp/(?:sql/)?$', execute_sql, name='sql'),url(r'^admin/', include(admin.site.urls), name='admin'),]```**Note:** The `sqlapp` URL pattern must come BEFORE the `admin` pattern as shown above.##### Contributors* [luminousmen](https://github.com/luminousmen)* [un-def](https://github.com/un-def)
Package: django-sql-comment
Django management command to generate SQL for applying your models’ and fields’verbose_nameandhelp_textas PostgreSQLCOMMENTstatements.CompatibilityPython 2.7–3.11.Django 1.11–4.2.QuickstartInstall Django SQL COMMENT:pip install django-sql-commentAdd it to yourINSTALLED_APPS:INSTALLED_APPS = (
    ...
    'django_sql_comment',
    ...
)Run./manage.py sqlcomment myappto look at SQL generated, or./manage.py sqlcomment myapp | ./manage.py dbshellto apply it to your database.If you’re brave enough to apply the comments automatically on every migration, you can take the risk to add to yourAppConfig:from django.db.models.signals import post_migrate
from django_sql_comment import sqlcomment_post_migrate
...
class MyAppConfig(AppConfig):
    def ready(self):
        post_migrate.connect(sqlcomment_post_migrate)
Package: django-sql-compiler
Django SQL CompilerA light-weight module to generate usable SQL from a Django QuerySet.Backend SupportCurrently,django-sql-compileronly supports connections made via thedjango.db.backends.postgresqlbackend.About Django SQL CompilerThe Django ORM is very useful for abstracting away SQL queries from the focus of the developer. This is very useful
for preventing SQL injection attacks and generating queries programmatically using applied logic in your Django app.However, very complex queries (such as those used in reporting, analytics, or data science projects) can be difficult
or impossible to create with the Django ORM alone. The ORM provides the.rawquery method and exposes the raw databaseconnectionobjects which can be used to execute arbitrary SQL against the database. In doing so, we lose the benefit
of the ORM with respect to dynamically adding components to the query (such as filters in aWHEREclause) in a way that
prevents injection attacks.The base DjangoQuerySetobject has aQueryobject available at the.queryproperty. Casting thisQueryobject as astrprints out what looks like a valid SQL query. However, this version of the query is not properly escaped or quoted, meaning
it's notactuallyvalid SQL unless there are no dynamic components (such as filters from user input) in theQuerySet.django-sql-compileraims to provide a way to generate clean, usable SQL from a givenQuerySet, which can be used in
tandem with a raw SQL query to give SQL users more flexibility in querying their Django-connected database while still
retaining the Django ORM for security and dynamic query generation purposes.UsageInstall the package:pip install django-sql-compilerAddsql_compilerto yourINSTALLED_APPS:INSTALLED_APPS=[...,'sql_compiler']Add theSQLCompilerManagerto your models:fromdjango.dbimportmodelsfromsql_compilerimportSQLCompilerManagerclassMyModel(models.Model):objects=SQLCompilerManager()field_one=models.IntegerField()field_two=models.CharField(max_length=200)field_three=models.DateTimeField()For a givenQuerySeton the model, you can access the executable query be accessing the.executable_queryproperty of theQuerySet.query_set=MyModel.objects.filter(field_one__lte=10)executable_query=query_set.executable_queryprint(executable_query)This query can then be used in another query as a Common Table Expression or Subquery:# Basic usagewrapper_query="""select * from ({}) a""".format(executable_query)new_queryset=MyModel.objects.raw(wrapper_query)While this is a very simple example, you can use this in more complicated queries:# inside a viewfiltered_query_set=MyModel.objects.filter(field_one__lte=request.data.get('field_one_filter',0),field_two__in=request.data.get('field_two_filter',[]))more_complex_query="""selectRANK() over (partition by a.field_one order by a.field_three desc) as rnk,a.field_one,a.field_twofrom({}) a""".format(filtered_query_set.executable_query)more_complex_results=MyModel.objects.raw(more_complex_query)Now, users who are more familiar with SQL rather than the Django ORM can use the ORM for security and conveniently
generating SQL queries and use SQL for the rest of their transformations.
Package: django-sqlconsole
Django SQL ConsoleSqlconsole is a django app that allows for the execution of sql queries from the admin section of a django site.
An appropriate use case is when you don't have access to the database especially in a production environment.SqlConsole is really meant to be used for database read queries eg:SELECT * FROM <some_table>

SELECT count(*) FROM <some_table>For queries that modify data eg:DELETE FROM <some_table> WHERE ID=<some_id>only a success or error message will be shownInstallpip install django-sqlconsoleAdd the app toINSTALLED_APPSINSTALLED_APPS = [
...
'sqlconsole'
]SqlConsole will be included in the admin section with a history of executed queries.Permissions will be required to execute queriessqlconsole.can_execute_queryScreenshot
Package: django-sql-dashboard
django-sql-dashboardDjango SQL Dashboard provides an authenticated interface for executing read-only SQL queries directly against your PostgreSQL database, bringing a useful subset ofDatasetteto Django.Applications include ad-hoc analysis and debugging, plus the creation of reporting dashboards that can be shared with team members or published online.See my blog formore about this project, includinga video demo.Features include:Safely run read-only one or more SQL queries against your database and view the results in your browserBookmark queries and share those links with other members of your teamCreatesaved dashboardsfrom your queries, with full control over who can view and edit themNamed parameterssuch asselect * from entries where id = %(id)swill be turned into form fields, allowing quick creation of interactive dashboardsProducebar charts,progress barsand more from SQL queries, with the ability to easily create newcustom dashboard widgetsusing the Django template systemWrite SQL queries that safely construct and rendermarkdownandHTMLExport the full results of a SQL query as a downloadable CSV or TSV file, using a combination of Django'sstreaming HTTP responsemechanism and PostgreSQLserver-side cursorsto efficiently stream large amounts of data without running out of resourcesCopy and paste the results of SQL queries directly into tools such as Google Sheets or ExcelUses Django's authentication system, so dashboard accounts can be granted using Django's Admin toolsDocumentationFull documentation is atdjango-sql-dashboard.datasette.ioScreenshotAlternativesdjango-sql-explorerprovides a related set of functionality that also works against database backends other than PostgreSQL