Saravanan666/pypi-org huggingface dataset:
Package: django-collect-offline-files
django-collect-offline-filesTransferdjango_collect_offlinetransactions as files using SFTP over an SSH connection.Data flows from client to server where a server is either a node server or the central server.see alsodjango_collect_offline.UsageOn the client:pythonmanage.pyexport_transactionsOn the server or receiving host:pythonmanage.pyincoming_observerpythonmanage.pydeserialize_observerFileQueueObserversTwo FileQueueObservers do the work using usewatchdogobservers;IncomingTransactionsFileQueueObserverandDeserializeTransactionsFileQueueObserver. They are called using management commands:pythonmanage.pyincoming_observerandpythonmanage.pydeserialize_observerIncomingTransactionsFileQueueObserverThe client exports data to JSON and sends to the server. UsingTransactionExporter, data is exported into a JSON file fromdjango_collect_offline.models.OutgoingTransactionon the client and sent to the server usingTransactionFileSender.Once a file is sent to the server, theIncomingTransactionsFileQueueObserverdetects it and adds the filename to the queue (IncomingTransactionsFileQueue).DeserializeTransactionsFileQueueProcessed files in the queueIncomingTransactionsFileQueueare moved to the pending folder watched byDeserializeTransactionsFileQueueObserver.and added to the its queue,DeserializeTransactionsFileQueue.Processing queue items / filenamesEach queue has a processor, (seeprocess_queue). The processor calls thenext_taskmethod for each item in the queue in FIFO order infinitely or until it gets aNoneitem.
Package: django-collectstatic-bower
Django static file finder that automatically runs bower install and collects components when running Django’s collectstaticRespects .bowerrc directory config when collecting filesTested on python 2.7 and 3.5InstallPip install packagepip installdjango-collectstatic-bowerAdd toSTATICFILE_FINDERS:STATICFILE_FINDERS = (
  ...
  'django_collectstatic_bower.staticfiles.finders.BowerComponentFinder',
)That’s it, just collectstatic files like normal./manage.py collectstatic
Package: django-colloquial
Django-colloquial is an application designed to manage media files and
their associated webvtt transcripts, using a custom tag format to
cross-link tagged phrases (“colloquialisms”) in the text. Features:Parse existing transcripts for tagged colloquialismsAutomatically tag known colloquialisms in untagged transcriptsFilter related transcripts by common colloquialismsRequirements & InstallationCurrently requires python 2.7 and django 1.10. Wider support coming
soon. To install:pip install django-colloquialThen add to yourINSTALLED_APPS:INSTALLED_APPS=(...'colloquial.colloquialisms','colloquial.transcripts',)COLLOQUIAL_TYPESdefines the different types of colloqiualisms
supported and whether or not they may automatically tag:COLLOQUIAL_TYPES = (
    ('idiom', 'Idiom', True),
    ('proper_name', 'Proper Name', False),
)Transcript formatTranscripts should be in thewebvttformat. Colloquialisms should be tagged using the format<c.TYPE>colloquialismtext</c>whereTYPEcomes from theCOLLOQUIAL_TYPESsetting. For example:1
00:00:00.092 --> 00:00:10.681
<v Rukuwai> Ko <c.tangata>Hohepa Tipene</c> te kaikorero e whai ake nei.
He kaumatua no roto o <c.iwihapu>Te Rārawa</c>. I tupu ake i te reo o
te kainga.Running testsUse tox (https://pypi.python.org/pypi/tox):> pip install tox
> cd path-to/django-colloquial
> tox
Package: django-color-captcha
Quick StartAddcolor_captchato INSTALLED_APPSINSTALLED_APPS = [
    ...
    'color_captcha',
    ...
]Runcollectstaticmanage command> python manage.py collectstaticAddcolor_captcha.cssfile to your template<link rel="stylesheet" href="{{ STATIC_URL }}color_captcha/css/color_captcha.css" type="text/css"/>AddColorCaptchaFieldinto your formfrom django import forms
from color_captcha.fields import ColorCaptchaField


class MyForm(forms.Form)
    ...
    captcha = ColorCaptchaField(label='Choose a color')
    ...ConfigurationFeel free to configure your captcha with the following options.CAPTCHA_COLORSDefault:[
    ('white', 'white'),
    ('blue', 'blue'),
    ('red', 'red'),
]An iterable of two-string-value tuples. The first value in tuple is a HEX color code (e.g.#FFF) or css color constant (e.g.white). The second value is a color name for user who has to solve the captcha.CAPTCHA_ERROR_MESSAGESDefault:{
    'wrong': 'Wrong answer',
    'required': 'This field is required',
    'internal': 'Internal error',
}A dictionary with error messages for captcha field. You can override any of them.
Package: django-colorful
An extension to the Django web framework that provides a database and form
field to accept and store colors in the RGB format.Installation>>> pip install django-colorfulMake sure'colorful'is in yourINSTALLED_APPS:INSTALLED_APPS.append('colorful')UsageIn order to use a color field you just have to add it to your model definition:from django.db import models
from colorful.fields import RGBColorField

class Tag(models.Model):
    color = RGBColorField()TheRGBColorFieldclass also accepts acolorkeyword argument which can
be set to a list of colors that should be visible as preset color palette:color = RGBColorField(colors=['#FF0000', '#00FF00', '#0000FF'])TheColorFieldWidgetshould take care of providing a JavaScript based shim
on browsers that don’t support the HTML5 color input.NoteTo enable HTML5 color input withDjango Grappelliensure thatGRAPPELLI_CLEAN_INPUT_TYPESis set toFalsein your settings file.
Package: django-colorful-scybear
An extension to the Django web framework that provides a database and form
field to accept and store colors in the RGB format.Installation>>> pip install django-colorfulMake sure'colorful'is in yourINSTALLED_APPS:INSTALLED_APPS.append('colorful')UsageIn order to use a color field you just have to add it to your model definition:from django.db import models
from colorful.fields import RGBColorField

class Tag(models.Model):
    color = RGBColorField()TheRGBColorFieldclass also accepts acolorkeyword argument which can
be set to a list of colors that should be visible as preset color palette:color = RGBColorField(colors=['#FF0000', '#00FF00', '#0000FF'])TheColorFieldWidgetshould take care of providing a JavaScript based shim
on browsers that don’t support the HTML5 color input.NoteTo enable HTML5 color input withDjango Grappelliensure thatGRAPPELLI_CLEAN_INPUT_TYPESis set toFalsein your settings file.
Package: django-colorinput
Color fields for forms and models using HTML5’s native input element of type color.QuickstartInstalldjango-colorinputand add it to yourINSTALLED_APPS:INSTALLED_APPS=(…'colorinput.apps.ColorInputConfig',…)Now you can useColorFieldin your models:fromdjango.dbimportmodelsfromcolorinput.modelsimportColorFieldclassMyModel(models.Model):…color=ColorField(default="d0d0d0")…In forms, the color field will be displayed using HTML5’s native color type
input element. In your own templates, you could use the value stored in the
field like this:<spanstyle="color: #{{ object.color }}">… or however you want, really. Just keep in mind that the value is stored as
RGB in triple HEX formatwithoutthe leading “#” (hash symbol).
Package: django-columns
Django template filter for splitting a list into columns.DocumentationThe full documentation is athttps://django-columns.readthedocs.org.QuickstartInstall the package. At the command line:$ pip install django-columnsAddcolumnstoINSTALLED_APPS.Split a list into 2 lists, to fill 2 columns:{% load columns %}

<div class="row">
    {% for col in mylist|columns:3 %}
        <div class="col-md-4">
            {% for item in col %}
                <div class="item">{{ item }}</div>
            {% endfor %}
        </div><!-- /col-md-4 -->
    {% endfor %}
</div><!-- /row -->History0.1.0 (2014-05-12)First release on PyPI.
Package: django-command
django-commandDjango-command is a command line tool that allows you to run commonly used commands in development
Django projects.Installationpipinstalldjango-commandLaunchThere are several ways to run commands:In the terminal, type django-command, after which a list of available commands for execution will appear, check
through
space which commands to execute. The marked commands will be executed in the order they were selected.(venv)PS.\>django-command[?]Select1ormorecommands:>[]create_local[1]Creatinglocales(ru,en)[]update_local[2]Updatingandcompilinglocales[]collect_static[3]AssemblingstaticfilesintheSTATIC_ROOTfolder[]make_migrations[4]Creatingmigrations[]make_migrations_app[5]Creatingthefirstmigrationfortheapplication[]make_empty_migrations_app[6]Createablankmigrationfortheapplication.Usedtoadddefaultdatatothedatabasetable[]migrate[7]Applyingmigrations[--db_labeldefault][]create_superuser[8]Creatingauserwithsuperuserrights[]create_app[9]Creatinganapplication[]run_server[10]Runningaprojectonaport(default"8000")[--port8000][]install_requirements[11]Installalldependenciesforaprojectfromafile(default"requirements.txt")[]print_requirements[12]Automaticallygeneratesallthenecessarydependenciesfortheproject,andalsoallowsyoutosavethislisttoafile(default"requirements.txt")[--save_in_filerequirements.txt]Commands can be executed by their name or number.django-commandmake_migrationsmigrate# or with argumentdjango-commandmake_migrationsmigrate-dbdefault# ordjango-command47List of commands and arguments(venv)PS.\>django-command-h
usage:django-command[-h][-dbDB_LABEL][-sSAVE_IN_FILE][-pPORT][-v]commands[commands...]CLItoolthatallowsyoutoruncommonlyusedcommandswhendevelopingDjangoprojects.positionalarguments:commandscommandstorun:create_local,update_local,collect_static,make_migrations,make_migrations_app,make_empty_migrations_app,migrate,create_superuser,create_app,run_server,install_requirements,print_requirementsoptionalarguments:-h,--helpshowthishelpmessageandexit-dbDB_LABEL,--db_labelDB_LABELdatabaselabelfor"migrate"command-sSAVE_IN_FILE,--save_in_fileSAVE_IN_FILEsavetofilefor"print_requirements"command-pPORT,--portPORTportfor"run_server"command-v,--versionshowprogram'sversionnumberandexit
Package: django-commander
Django CommanderRun Djangomanage.pycommands from the web.
This is mainly useful in situations where you can't easily SSH into your host.
For example, if you useazf-wsgito run Django on Azure Functions.ConfigurationAddcommanderto yourINSTALLED_APPS.AddCOMMANDER_KEYto your settings. This should be a reasonably secure key, which you'll use in lieu of real authentication 😱from commander import commander_urlsand addpath('commander/', commander_urls),to your URLconf.Navigate tohttp://yourserver/yourapp/commander/?key={COMMANDER_KEY}.Do whatever config you need to do.ChangeCOMMANDER_KEYexplicitly toNoneto disable management 😌ContributingContributions welcome. Be kind to one another.To develop locally, first make a virtualenv.
Then cd intodev/andpip install -e ../src.
Thenpip install djangoand off you go.
Package: django-command-interface
A reusable Django app that allows to list manage.py commands and lauch them
with one click.InstallationTo get the latest stable release from PyPipipinstalldjango-command-interfaceTo get the latest commit from GitHubpipinstall-egit+git://github.com/bitmazk/django-command-interface.git#egg=command_interfaceTODO: Describe further installation steps (edit / remove the examples below):Addcommand_interfaceto yourINSTALLED_APPSINSTALLED_APPS=(...,'command_interface',)Add thecommand_interfaceURLs to yoururls.pyurlpatterns=patterns('',...url(r'^command-interface/',include('command_interface.urls')),)This app uses the Django messages framework, so you need to adddjango.contrib.messages.middleware.MessageMiddlewareto yourMIDDLEWARE_CLASSESsetting.You HAVE to haveDJANGO_PROJECT_ROOTin your settings pointing towards the
directory of yourmanage.pyfile.UsageJust visit the command interface main panel at view namecommand_interface_mainand see listed all the commands, that you can
execute just by clicking “Run command”.That’s it.Passing arguments to the commands is still WIP.SettingsCOMMAND_INTERFACE_DISPLAYED_APPSYou can limit the displayed apps by settingCOMMAND_INTERFACE_DISPLAYED_APPS. The syntax is the same as it is in theINSTALLED_APPSsetting. It defaults to showing absolutely all apps.# would list all commands of the awesome_appCOMMAND_INTERFACE_DISPLAYED_APPS=['awesome_app']COMMAND_INTERFACE_DISPLAYED_COMMANDSFurther you can also provide a list of commands, that should explicitly be
displayed. Defaults to all as well.# would on its own only show the mycommand commandCOMMAND_INTERFACE_DISPLAYED_COMMANDS=['mycommand']The settings don’t exclude each other. So displaying any full app and just one
or two specific commands from somewhere else is no problem at all.COMMAND_INTERFACE_LOGFILE_PATHFor logging, you can specify a logfile path, where logfiles for each command
can be created. The logfiles will always be prefixed withcommand_interface_log-...code-block:: pythonCOMMAND_INTERFACE_LOGFILE_PATH = ‘/home/myname/tmp/logs/’This value defaults toNone, which means, that no logs are created.The log of the last run is then displayed on the command interface main view
under each respective command.ContributeIf you want to contribute to this project, please perform the following steps# Fork this repository
# Clone your forkmkvirtualenv-ppython2.7django-command-interfacemakedevelopgitco-bfeature_branchmaster# Implement your feature and testsgitadd.&&gitcommitgitpush-uoriginfeature_branch# Send us a pull request for your feature branch
Package: django-commandlog
Django CommandLog adds the feature of logging the django management commands into the database so it’s available in the admin interface.We’ve been using this to check the result of scheduled management commands directly through the admin interface. It works by copying the stream ofstdoutandstderr.The decorator also adds some helper methods, see below.Quick startAdd “django_commandlog” to yourINSTALLED_APPSsettings like this:INSTALLED_APPS=[...'django_commandlog',]Runpython manage.py migrateto add the tables ofdjango_commandlogto your database.3. To log an admin command, add the@command_logdecorator above the class
(see example below). Thus, it currently supports only custom management
commands. If you wish to add this to default django manage commands you’ll
have to create a child class with the decorator. Pull/Merge requests
are welcome with a fix for this.@command_logclassSampleCommand(BaseCommand):defhandle(self,*args,**options):...ConfigurationThere are currently no configuration values.Helper methodsWhen your class is decorated with@command_log, you have access to additional methods.CommandLog includes counters for basic CRUD operations (Create, Read, Update, Delete) which can be used
through helper methods provided:add_log_created(10)add_log_read(30)add_log_updated(20)add_log_deleted(30)add_log_errors(14)There are two fields used to track the commands or runs: reference and user.
Reference is any number you want to track in your manage commands.You can also add a user to the tracking by using theadd_log_user(user)method.usercan be a string which will be kept as-is or you can use asettings.AUTH_USER_MODELobject.add_log_reference("C1235342321")add_log_user("user:ldap:username")# oradd_log_user(user_instance)Requirementspython 2.7, 3.4, 3.5django 1.10Tested onDjango1.10.3
Package: django-command-log
# Django Management Command LogApp to enable simple auditing of Django management commands### Version supportThis project now support Django 3.2+, and Python 3.8+.See git tags and PyPI classifiers for support.## BackgroundThis app wraps the standard Django management command base class to record therunning of a command. It logs the name of the command, start and end time, andthe output (if any). If the command fails with a Python exception, the errormessage is added to the record, and the exception itself is logged using`logging.exception`.![Screenshot of admin listview](https://github.com/yunojuno/django-management-command-log/blob/master/screenshots/list-view.png)![Screenshot of admin detailview](https://github.com/yunojuno/django-management-command-log/blob/master/screenshots/detail-view.png)See the `test_command` and `test_transaction_command` for examples.## TODO* Documentation.* Convert output field to JSON
Package: django-commands2
django-commandsTable of ContentsInstallationUsageLicenseInstallationpip install django-commands2add django_commands to INSTALLED_APPS, and loggingINSTALLED_APPS=[...'django_commands',]LOGGING={"loggers":{"django_commands":{...yourcustomlevel,handlesconfig...}}}UsageAutoLogCommandsany exception will be logged in the autologcommand<yourapp/management/commands/command_name.py>
from django_commands import AutoLogCommand


class Command(AutoLogCommand):

    def handle(self):
        <write your code, any exception will be logged>MultiTimesCommandMultiTimesCommand will run multi times according toINTERVALandMAX_TIMES. You can easily use this command to realize a crontab job every 1 second.classCommand(MultiTimesCommand):INTERVAL=1# default 1MAX_TIMES=60# default 60defhandle(self):<thishandlefunctionwillrun60times>This command does not consider the running time of your code. It will just run 60 times, and during each execute, wait 1 secondDurationCommand(AutoLogCommand):DurationCommand will run your commands over and over again until the running time exceed the configurationimportdatetimeclassCommmand(DurationCommand):INTERVAL=1DURATION=datetime.timedelta(minutes=1)defhandle(self,*args,**kwargs):<yourcode>UniqueCommandUniqueCommand can assert that only one command instance is runningHow it works?
Every time the command executes:it will create a django_commands.models.CommandLog instanceit will check if there is another Command Instance pending with the same UNIQUE_NAMEimport time
from django_commands.commands import UniqueCommand

class Command(UniqueCommand):
    def handle(self):
        print("I'm running. In the next 5 seconds, you cannot execute this command. It will exist directly")
        time.sleep(5)
        print("I'm running")
        raise Exception("even error occurs, this task will be set finished")Licensedjango-commandsis distributed under the terms of the ONLY USE NO PRIVATE CHANGE LICENSE license.Anyone can usepip install django-commandsto use this project by any meaning as long as you keep the source code unchanged.You are not allowed to change the source code without publishing your change.Here publishing means you:
fork this project from github and keep your change available to public on the github
Package: django-command-server
django-command-serverDjango management.command is running a long live task, we make it a linux daemon server, so that you can start, stop, restart the task.Installpip install django-command-serverUsageapp/management/commands/helloserver.pyimport djclick as click
from django_command_server import DjangoCommandServer

class HelloServer(DjangoCommandServer):
    def main(self):
        while True:
            print("hello")

@click.group()
def main():
    pass

hello_server = HelloServer()
hello_server.setup(main)Notes:django_command_server is not a django application, do do NOT include it in django's INSTALLED_APPS.DjangoCommandServer setup takes a djclick.group(), so create an instance and pass it to setup.Implement your own server main.Releasev0.1.0 2020/11/09First release.v0.1.1 2020/11/09Add deps in requirements.txt.v0.1.2 2023/09/18Doc update.
Package: django-commands-ui
Django Commands UIThis project offers a solution to list and execute all existing management commands in your Django project.RequirementsThis project requires Python 3.10 or greater.ConfigurationTo install and configure it these steps should be followed:Install the dependency from PyPi.pip install django-commands-uiAddcommands_uias an installed app in your Django project.If you haven't already done so, you will need to add celery to your django project. You can follow the steps in theFirst steps with Djangoguide if you haven't used celery before.Add the root location of your management commands to your installed apps. For example, if your management commands are in thecommandsfolder in your project root, you would addyour-project-name.commandsto your installed apps.Add these required settings:# Celery app name.
 COMMANDS_UI_CELERY_APP = ""

 # Working celery queue name for delayed jobs.
 COMMANDS_UI_DELAYED_JOBS_QUEUE = ""

 # Working celery queue name for standard jobs.
 COMMANDS_UI_JOBS_QUEUE = ""

 # Tuple of compiled regexes to extract the runnable commands from.
 # By default, all commands from all installed apps are extracted.
 COMMANDS_UI_JOB_APPS = (re.compile(r".*"),)

 # Primary database identifyer, not the replica one.
 DATABASE_PRIMARY = getattr(settings, "DATABASE_PRIMARY", "default")

 # Define if the current environment is a cron environment.
 CRON_ENVIRONMENT = getattr(settings, "CRON_ENVIRONMENT", False)Include package URLs to your base urls file like this:path("jobs/", include("commands_ui.urls")),Create tables:python manage.py migrate commands_uiIt is recommended to overridebase.htmlso the appearance is customizable, as alldjango-commands-uitemplates extend from it.DocumentationImplementing a management command jobThe only needed thing for implementing a working management command job indjango-commands-uiis extending the existing JobBasedCommand.
This class adds some default arguments (such as--job-id).Example on how to use this class:from typing import Any
from commands_ui import management_commands
from django.core.management.base import CommandParser

# Extend the JobBasedCommand class
class Command(management_commands.JobBasedCommand):
   def handle(self, *args: Any, **options: Any) -> None:
      # Any time `self.print` is used, the message will be added to both standard output and
      # Job output.
      self.print("Starting")
      for i in range(0, 20):
         self.print(i)
      self.print("Finishing")Command GroupingYou can group types of commands by adding ainterface_nameclass attribute to your management command class. This will group all commands with the sameinterface_nametogether in the UI.
For example you can group cronjobs together by addinginterface_name = "cron"to all your cronjobs.from typing import Any
from commands_ui import management_commands
from django.core.management.base import CommandParser

# Extend the JobBasedCommand class
class Command(management_commands.JobBasedCommand):
    interface_name = "cron"
   def handle(self, *args: Any, **options: Any) -> None:
      ...
Package: django-comment
## Django Comment``django-comment`` is a simple Django app to add comments for your django model.This project is inspired by [django-taggit](https://github.com/alex/django-taggit) and directly derived from [django-vote](https://github.com/shanbay/django-vote)[![Build Status](https://travis-ci.org/shanbay/django-comment.svg)](https://travis-ci.org/shanbay/django-comment)[![Codecov](https://codecov.io/gh/shanbay/django-comment/coverage.svg?branch=master)](https://codecov.io/gh/shanbay/django-comment?branch=master)[![PyPI version](https://badge.fury.io/py/django-comment.svg)](https://badge.fury.io/py/django-comment)### Quick start#### Add `'comment'` to your `INSTALLED_APPS` setting like this```pythonINSTALLED_APPS = (...'comment',)```#### Add `CommentModel` to the model you want to comment```pythonfrom comment.models import CommentModelclass ArticleReview(CommentModel):...```#### Run migrate```shellmanage.py makemigrationsmanage.py migrate```#### Use comment API```pythonreview = ArticleReview.objects.get(pk=1)# Add comment for an objectreview.comments.create(user_id, content)# Removes a comment from the objectreview.comments.get(pk=comment_id).delete()# Check if the user commented the objectreview.comments.filter(user_id=user_id).exists()# Returns the number of comments for the objectreview.comments.count()# Returns all comments by userreview.comments.filter(user_id=user_id)# Use comment_objects like a native managerReview.comment_objects.filter(user_id=user_id).limit(10)# Override auto_time and auto_time_add in model fieldsfrom comment.utils import override_autotimewith override_autotime():com = review.comments.create(user_id, content, created_at=your_timestamp)print(com.created_at) # your timestamp```