Saravanan666/pypi-org huggingface dataset:
Package: django-compass2
django-compass2is a re-usable Django application which provides an easy way of
compiling yourCompassorSassbased stylesheets to CSS. Its main
benefit is Django settings integration, so you don’t need lots ofcompass.rbconfiguration files lying around (especially with multiple deployments, et
cetera). Other than that, it’s simply a proxy to thecompasscommand-line
application.Installation and SetupYou’ll need to installCompass; this is a Ruby library, so use thegemutility (installed out-of-the-box on most systems):$ [sudo] gem install compass --preThen, just usepiporeasy_installto installdjango-compass2(the
dependencies will be handled automatically):$ pip install django-compass2 # OR
$ easy_install django-compass2Add'djcompass'to yourINSTALLED_APPSsetting.In yoursettings.pyfile, add the necessary settings. Take a look at the
configuration reference below for more information, but here’s a quick
example:COMPASS_INPUT = PROJECT_ROOT + 'media/sass'
COMPASS_OUTPUT = PROJECT_ROOT + 'media/css'
COMPASS_STYLE = 'compact'
COMPASS_REQUIRES = (
    'ninesixty',  # 960.gs Grid System
)You can now compile your Sass with the management command:$ python manage.py compassUsageThe command-line interface is very simple.
To see available options and commands try:$ python manage.py compass --helpBasically the syntax is as simple as:$ python manage.py compass <primary_command>Just compile your Sass into CSS:$ python manage.py compass
   exists media/css
unchanged media/sass/style.sassThe above command is more or less equivalent to invoking:compass --sass-dir media/sass --css-dir media/css --output-style compactMonitor your Sass continuously:$ python manage.py compass watch
>>> Compass is watching for changes. Press Ctrl-C to Stop.
>>> Change detected to: .../media/sass/style.sass
overwrite media/css/style.css
...Which is something like:compass --sass-dir media/sass --css-dir media/css --output-style compact --watchConfiguration ReferenceDjango SettingsThese should go in yoursettings.pyfile.Required settingsCOMPASS_INPUT: The directory where you keep your Sass/Scss stylesheets.COMPASS_OUTPUT: The directory to which Compass should output CSS.Note that neither of these should have trailing slashes. They may be absolute or
relative paths; if relative, they will be resolved against the current working
directory.Optional settingsCOMPASS_EXECUTABLE: Path for your compass binary. Defaults to “compass”COMPASS_STYLE: One of'nested','expanded','compact'or'compressed', specifying the style of the produced CSS output. The default
is'compact'.COMPASS_REQUIRES: A sequence of Ruby libraries torequirebefore running
Compass commands.COMPASS_IMAGE_DIR: The directory where images are stored (used for
Compass’s asset URL helpers).COMPASS_SCRIPT_DIR: The directory containing your JavaScript files (used
for Compass’s asset URL helpers).COMPASS_RELATIVE_URLS: Boolean specifying whether or not Compass’s asset
URL helpers should generate relative URLs.Command-line OptionsThese options may be passed at runtime to affect how Compass is run.-t,--trace: Print a full stacktrace on Compass errors.
Package: django-compiler
Django Compilerdjango-compileris a Django package that provides a custom management command to compile Python files within a directory while allowing you to exclude specific directories from the compilation process.FeaturesEasily compile Python files in your Django project.Exclude specific directories from compilation.Simple and user-friendly command-line interface.InstallationYou can installdjango-compilervia pip:pipinstalldjango-compileradddjango_compilerto yourINSTALLED_APPS:# settings.pyINSTALLED_APPS=[# ...'django_compiler',# ...]UsageAfter installing the package, you can use the providedcompilemanagement command to compile Python files within your Django project. Here's how to use it:pythonmanage.pycompileOptions--exclude-dirs: Specify one or more directories to exclude from the compilation. Use space-separated directory names. For example:pythonmanage.pycompile--exclude-dirsdir1dir2This command will compile Python files within your Django project while excluding the specified directories.ContributingIf you'd like to contribute to this project, please follow these guidelines:Fork the repository.Create a new branch for your feature or bug fix.Make your changes and ensure they are well-tested.Create a pull request to merge your changes into the main repository.LicenseMIT
Package: django-compiling-loader
A template loader that compiles Django templates into Python bytecode
for improved performance.This package exposes thecompiling_loader.Loadertemplate
loader. This loader will compile the template syntax tree generated by
Django into Python bytecode. If a tag can’t be generated, a fallback
will be compiled, which just evaluates the template nodes. The
fallback method means that this loader is compatible with the existing
loaders, even if you have a lot of custom tags.The compiler is modular and built around Python 3.4’ssingledispatchfunction, meaning that it can easily be extended to
support your own tags if you have expensive custom tags that would
benefit from compilation.The loader itself does not do any caching; it works together with
Django’s built-in cached loader to avoid recompilation.UsageInstall thedjango-compiling-loaderPython package and set theTEMPLATE_LOADERSsettings to the following value:TEMPLATE_LOADERS=(('django.template.loaders.cached.Loader',[('compiling_loader.Loader',['django.template.loaders.filesystem.Loader','django.template.loaders.app_directories.Loader',]),]),)If you have other loaders, put them inside thecompiling_loader.Loaderlist to ensure that the generated
templates get compiled.CompatibilityThe loader has been tested with Django 1.7, and requires Python
3.4. When it comes to rendering compatibility, this project contains a
fair number of test cases that compare the render output from the
standard Django template evaluation and this compiler. So far, no
incompatibilities have been found.PerformaceThetest_proj/run_benchmarks.pyscript renders a small inheritance
based template a large number of times, as well as a large both
inheritance and include based template a few times. Below are some
comparisons:TemplateDefaultCompiledSpeedupSmall0.21 ms0.10 ms2,1xLarge125 ms42 ms3,0x
Package: django-completion
autocompletion for django appssupports the following backends:solrdatabase (using LIKE)redis (pretty experimental)usage follows typical django registration-y pattern:from django.db import models

from completion import site


class Blog(models.Model):
    title = models.CharField(max_length=255)
    pub_date = models.DateTimeField()
    content = models.TextField()
    published = models.BooleanField(default=True)

    def get_absolute_url(self):
        return reverse('blog_detail', args=[self.pk])


class BlogProvider(AutocompleteProvider):
    def get_title(self, obj):
        return obj.title

    def get_pub_date(self, obj):
        return datetime.datetime(2010, 1, 1)

    def get_data(self, obj):
        return {'stored_title': obj.title, 'url': obj.get_absolute_url()}

    def get_queryset(self):
        return self.model._default_manager.filter(published=True)


site.register(Blog, BlogProvider)The Blog model is now ready for autocomplete, but the objects must be stored before they can be returned:>>> from completion import site
>>> site.store_providers()
>>> site.suggest('tes')
[
    {u'stored_title': u'testing python', u'url': u'/blogs/1/'},
    {u'stored_title': u'testing python code', u'url': u'/blogs/3/'},
    {u'stored_title': u'web testing python', u'url': u'/blogs/2/'},
    {u'stored_title': u'unit tests with python', u'url': u'/blogs/4/'},
]

>>> site.suggest('testing')
[
    {u'stored_title': u'testing python', u'url': u'/blogs/1/'},
    {u'stored_title': u'testing python code', u'url': u'/blogs/3/'},
    {u'stored_title': u'web testing python', u'url': u'/blogs/2/'},
]Objects can be added or removed at any time from the index:>>> site.store_object(some_blog_instance)
>>> site.remove_object(some_other_obj)If you have multiple types of objects in your autocomplete index, you can restrict
results to a certian type by passing in “models” to the suggest method:>>> site.suggest('python', models=[Blog, Photo])ConfiguringTheAUTOCOMPLETE_BACKENDsetting allows you to specify which backend to use for autocomplete.  The options are:completion.backends.db_backend.DatabaseAutocompletecompletion.backends.redis_backend.RedisAutocompletecompletion.backends.solr_backend.SolrAutocompleteConfiguring RedisMake sure that you haveRedisandredis-pyinstalled.Add something like the following to your settings file, where the connection string is <host name>:<port>:<database>AUTOCOMPLETE_REDIS_CONNECTION = 'localhost:6379:0'Configuring SolrMake sure that you haveSolrandpysolrinstalled.Add something like this to your settings file:AUTOCOMPLETE_SOLR_CONNECTION = 'http://localhost:8080/solr/autocomplete-core/'Additionally, if you end up using Solr (which I’d recommend!), you will need to ensure you have the correct field definitions in your solr schema.  A sample schema can be generated for you automatically, by running:django-admin.py autocomplete_schemaThis will drop a file namedschema.xmlin your current directory.Installationpython setup.py installORput thecompletionfolder on your python-path
Package: django-component
Modern components for django templatesDeclarative and composable components inspired by javascript frameworks.Supports Python3.6+and Django1.11,2.0+, and3.0+UsageDescribe your component:# myapp/templatetags/mycomponents.pyfromdjango_componentimportLibrary,Componentregister=Library()@register.componentclassCard(Component):template="myapp/card.html"classMedia:css={"all":["myapp/card.css"]}js=["myapp/card.js"]# myapp/templates/myapp/card.html<sectionclass="card"><header>{{ header }}</header><h1>{{ short_title }}</h1><div>{{ children }}</div></section>And use them in your templates{% load mycomponents %}
{% components_css %}

{% Card title="My card's title" %}
    This will be accessible as the `children` variable.
    It's just django template,<span>{{ variable }}</span>!

    {% arg header %}
        This<imgsrc="foo.jpg"/>will be in the header of the card
    {% endarg %}
{% /Card %}

{% components_js %}django-componentalso enable context processing per component, see the documentation (TODO) for the complete api.Why django-component?django-componentmake it easy to create reusable template components.
Django has some features to address this, but they all come with some limitations.django-componentunify these features (block,includes,inclusion_tag,simple_tag) under an unique api.
In additiondjango-componentaddress one of my greatest frustration with reusable components in django:tracking css and js dependenciesfor each component andinclude them only when they are effectively used.Installationpipinstalldjango-componentThen adddjango-componentto your INSTALLED_APPS,
it is also recommended to add django-component.templatetags as builtins templatetagsINSTALLED_APPS=[...,"django_component",...]TEMPLATES=[{'OPTIONS':{'builtins':['django_component.templatetags',]},}],
Package: django-composed-configuration
django-composed-configurationTurnkey Django settings for data management applications.InstallationAdd to your project's requirements:django-composed-configuration[dev,prod]In your project'ssettings.py:fromcomposed_configurationimport(ComposedConfiguration,ConfigMixin,DevelopmentBaseConfiguration,ProductionBaseConfiguration,)class_ProjectMixin(ConfigMixin):# Define additional project-specific settings or overrides herepass@staticmethoddefmutate_configuration(configuration:ComposedConfiguration)->None:# Perform any non-overriding mutation of existing settings here# The "configuration" variable contains the flattened settings# For example:#   configuration.INSTALLED_APPS += ['my_extra_app']passclassDevelopmentConfiguration(_ProjectMixin,DevelopmentBaseConfiguration):passclassProductionConfiguration(_ProjectMixin,ProductionBaseConfiguration):passAt runtime:continue to set theDJANGO_SETTINGS_MODULEenvironment variable (pointing tosettings.py)also setDJANGO_CONFIGURATION, with a value of
eitherDevelopmentConfigurationorProductionConfiguration
Package: django-compose-settings
Aims to compose your settings from python modules and python scripts in /etc.In yourmy_app/settings/__init__.pycall the loader:from django_compose_settings import modules_loader

locals().update(modules_loader(prefix='my_app', default='base,etc,post'))Inmy_app/settings/base.pydefine default values as usual, ex:import os

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

# ...Inmy_app/settings/etc.pycall the etc loader:from django_compose_settings import etc_loader

locals().update(etc_loader(prefix='my_app'))You can validate settings inmy_app/settings/post.pyas follow:import __settings__

assert hasattr(__settings__, 'BASE_DIR'), 'BASE_DIR required'Etc settingsHere is a sample tree of your/etc/my_app:/etc/my_app/
├── settings.d
│   ├── 00_prod1.py
│   └── 99_local.py
└── settings.pyEach.pyfile is a regularcomposablesettings file aspost.pyabove.MY_APP_SETTINGSYou can override your settings with a specific SETTINGS environment variable
for your app as follow:$ MY_APP_SETTINGS=base,post python

>>> import logging
>>> logging.basicConfig(
...     level=logging.INFO,
...     format='%(asctime)s %(levelname)-8s %(name)s  %(message)s'
... )

>>> import os
>>> import sys
>>> sys.path.append(os.path.join(os.path.abspath('tests'), 'fixtures'))

>>> from my_app import settings

2015-11-23 10:59:09,964 INFO     django_compose_settings  Loaded my_app.settings.base
2015-11-23 10:59:09,964 INFO     django_compose_settings  Loaded my_app.settings.post
Package: django-composite-auto-field
A simple Django Field for storing auto-incrementing field. It’s useful for storing such as orders code for much easier reading.InstallationUsageTestsRelease NotesContributingInstallationInstall django-composite-auto-field:pip install django-composite-auto-fieldUsageThis field uses Django’s Aggregate and Max functions to extract the latest code from the database and does a minimum of parsing to calculate the next code. This avoids having to store a counter in the database. Therefore, for correct operation, once the field arguments have been set, it is advisable not to modify them anymore, or to manually act on the codes already calculated and stored in the database.Import to your models:from django_composite_auto_field.fields import CompositeAutoFieldUsage:class Order(models.Model):
    code = CompositeAutoField(prefix='ORD', use_year=True, zeros=5)Arguments:prefix      # It's used to indicate prefix for the code, default is "CC"
use_year    # When it's True, last two numbers of current year will be used after prefix
zero        # Indicated number of zeros before the numberRun:python manage.py makemigrations
python manage.py migrateFor example. Using Arguments from above as shown, will result in codes:ORD2100001
ORD2100002
ORD2100003
...If the year is used, every year the counter will be automatically reset and the count will restart with 1.
If you pass a string to the field, it will be used instead of the generated value. Pay attention to the passed values, they will be used for the generation of subsequent values.TestsTo run tests:# clone this repository on your PC

# create the virtual environment
python -m venv venv

# activate the virtual environment
source venv\bin\activate

# install requirements
pip install -r .\requirements.txt

# run migrations
python manage.py migrate

# run tests
python manage.py testRelease Notes0.1.5fixed code generation with prefix length different from 20.1.4fixed setupfixed description file (README.rst)0.1.3added testsadded support for custom string as argumentadded support for Django 4.2 on python 3.8, 3.9, 3.10 and 3.11 - as per theofficial django docs0.1.2fixed year change0.1.1 - initial releaseprovides CompositeAutoField for storing auto-incrementing fieldsupports Django 3.1 on python 3.6, 3.7, 3.8 and 3.9 - as per theofficial django docsContributingIt’s an open source project, so any contributions are welcome!
Package: django-composite-field
CompositeField for Django ModelsThis is an implementation of a CompositeField for Django. Composite fields
can be used to group fields together and reuse their definitions.ExampleclassCoordField(CompositeField):x=models.FloatField()y=models.FloatField()classPlace(models.Model):name=models.CharField(max_length=10)coord=CoordField()p=Place(name='Foo',coord_x=42,coord_y=0)q=Place(name='Foo',coord=p.coord)q.coord.y=42How does it work?The content of composite fields are stored inside the model, so they do
not have to fiddle with any internals of the Django models. In the example
abovep.coordreturns a proxy object that maps the fieldsxandyto the model fieldscoord_xandcoord_y. The proxy object also
makes it possible to assign more than one property at once.Documentation can be found atRTFD.
Package: django-composite-foreignkey
allow to create a django foreignkey that don’t link with pk of other model, but with multi column matching local model columns or fixed values.some databases have a composite Primary Key, leading to impossiblity for a django foreign key to be used.today, Django don’t support Composite Primary Keysee ticketand ForeignKey don’t support multicolumn.
but fortunaly, the base class of ForeignKey support it well, so this lib just add a little wrapper around ForeignObject to make it more usefull.
the real add of this implementation is that is support the customisation of the link with Raw values.this implementation of CompositeForeignKey skip the complexity of Composite Primary Key by forcing the providing of the corresponding column of the other model, not forcefully a PrimaryKey.InstallationInstall using pip:pip installdjango-composite-foreignkeyAlternatively, you can install download or clone this repo and callpip install-e..Exampleyou have this modelclassCustomer(models.Model):company=models.IntegerField()customer_id=models.IntegerField()name=models.CharField(max_length=255)address=CompositeForeignKey(Address,on_delete=CASCADE,to_fields={"tiers_id":"customer_id","company":LocalFieldValue("company"),"type_tiers":RawFieldValue("C")})classMeta(object):unique_together=[("company","customer_id"),]classContact(models.Model):company_code=models.IntegerField()customer_code=models.IntegerField()surname=models.CharField(max_length=255)# virtual fieldcustomer=CompositeForeignKey(Customer,on_delete=CASCADE,related_name='contacts',to_fields={"customer_id":"customer_code","company":"company_code"})you can use Contact.customer like any ForeignKey, but behinde the scene, it will query the Customer Table using company and customer id’s.DocumentationThe full documentation is athttp://django-composite-foreignkey.readthedocs.org/en/latest/.RequirementsPython 2.7, 3.4, 3.5, 3.6, 3.7Django 1.11, 2.0, 2.1Contributions and pull requests for other Django and Python versions are welcome.Bugs and requestsIf you have found a bug or if you have a request for additional functionality, please use the issue tracker on GitHub.https://github.com/onysos/django-composite-foreignkey/issuesLicenseYou can use this under GPLv3.AuthorOriginal author & Development lead:Darius BERNARD.ThanksThanks to django for this amazing framework. And thanks to django-bootstrap3 to the structure of the apps.
Package: django-composite-foreignkey-2
### NoteThe original project appears to be abandoned.
My intent is to solve my immediate issues while learning a bit more about the underlying Django DB model and then continue to update this library.django-composite-foreignkeyallow to create a django foreignkey that don’t link with pk of other model, but with multi column matching local model columns or fixed values.some databases have a composite Primary Key, leading to impossiblity for a django foreign key to be used.today, Django don’t support Composite Primary Keysee ticketand ForeignKey don’t support multicolumn.
but fortunaly, the base class of ForeignKey support it well, so this lib just add a little wrapper around ForeignObject to make it more usefull.
the real add of this implementation is that is support the customisation of the link with Raw values.this implementation of CompositeForeignKey skip the complexity of Composite Primary Key by forcing the providing of the corresponding column of the other model, not forcefully a PrimaryKey.InstallationInstall using pip:pip installdjango-composite-foreignkeyAlternatively, you can install download or clone this repo and callpip install-e..Exampleyou have this modelclassCustomer(models.Model):company=models.IntegerField()customer_id=models.IntegerField()name=models.CharField(max_length=255)address=CompositeForeignKey(Address,on_delete=CASCADE,to_fields={"tiers_id":"customer_id","company":LocalFieldValue("company"),"type_tiers":RawFieldValue("C")})classMeta(object):unique_together=[("company","customer_id"),]classContact(models.Model):company_code=models.IntegerField()customer_code=models.IntegerField()surname=models.CharField(max_length=255)# virtual fieldcustomer=CompositeForeignKey(Customer,on_delete=CASCADE,related_name='contacts',to_fields={"customer_id":"customer_code","company":"company_code"})you can use Contact.customer like any ForeignKey, but behinde the scene, it will query the Customer Table using company and customer id’s.DocumentationThe full documentation is athttp://django-composite-foreignkey.readthedocs.org/en/latest/.RequirementsPython 2.7, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9Django 1.11, 2.0, 2.1, 2.2, 3.1, 3.2Contributions and pull requests for other Django and Python versions are welcome.Bugs and requestsIf you have found a bug or if you have a request for additional functionality, please use the issue tracker on GitHub.https://github.com/onysos/django-composite-foreignkey/issuesLicenseYou can use this under GPLv3.AuthorOriginal author & Development lead:Darius BERNARD.ThanksThanks to django for this amazing framework. And thanks to django-bootstrap3 to the structure of the apps.
Package: django-compositepk
A Django application that provides aCompositePKModel, allowing for basic
retrieval and saving of models with composite keys.It is limited to the above tasks, and any use of the model past this is not
guaranteed to work.Example usageA model with composite PK should look something like this:from composite_pk import composite

class Lot(composite.CompositePKModel):
    auction = models.ForeignKey(Auction, primary_key=True)
    lot_number = models.IntegerField(primary_key=True)
    objects = composite.CompositePKManager()So it must:subclass theCompositePKModel,have two or more fields which set theprimary_keyattribute to True,
anduse theCompositePKManageras the initial manager.