Saravanan666/pypi-org huggingface dataset:
Package: django-binder
# Django-Binder[![Build Status](https://travis-ci.org/CodeYellowBV/django-binder.svg?branch=master)](https://travis-ci.org/CodeYellowBV/django-binder)
[![codecov](https://codecov.io/gh/CodeYellowBV/django-binder/branch/master/graph/badge.svg)](https://codecov.io/gh/CodeYellowBV/django-binder)Code Yellow backend framework for SPA webapps with REST-like API.This framework is a work-in-progress. There is no complete documentation yet. We are using it for a couple of projects and fine-tuning it.## Running the testsThere are two ways to run the tests:
- Run directly./setup.py test(requires you to have python3 and postgres installed)
- Run with dockerdocker-compose run binder ./setup.py test## MySQL supportMySQL is supported, but only with the goal to replace it with
PostgreSQL.  This means it has a few limitations:wherefiltering onwithrelations is not supported.Only integer primary keys are supported.
Package: django-binhash
Work with hexadecimal, store in binary, using half of the data size.InstallationJust install viapip:pip install django-binhashAnd add to your apps onsettings.py:INSTALLED_APPS=[# Django apps'binhash',# Your apps]CompatibilityEnvironmentsTested under Python from 3.3 to 3.6 and alsoLegacy Python(2.7).Tested under Django 1.8 to 1.11, but it can possibly run in versions way
older, since the fields structure is stable for a long time.DatabasesAt the version0.1.0it was only tested on SQLite, but if should
work fine in all databases officially supported by Django.FormatsMD5MD5FieldSHA-1SHA1FieldSHA-2SHA224FieldSHA256FieldSHA384FieldSHA512FieldUsageJust import and set some fields:fromdjango.dbimportmodelsfrombinhashimport(MD5Field,SHA1Field,SHA256Field)classISOFile(models.Model):name=models.CharField('Name',max_length=30)url=models.URLField('URL')md5sum=MD5Field('MD5 Checksum')sha1sum=SHA1Field('SHA-1 Checksum')sha256sum=SHA256Field('SHA-256 Checksum')Than, proceed using them like CharFields:# Create normaly as if the fields were strings:ISOFile.objects.create(name='Ubuntu Server 17.04',md5sum='d02df11b4a7318b7250824f6d0bab9c0',sha1sum='bc5fb639724b5cd90eb739845f246e2c564b0dd8',sha256sum='632e64dde9a7da27fa96bea4d2cf78f0''51065c6becc0d0f728aabfc091396256')# Fetch by string is also supported:ubuntu=ISOFile.objects.get(md5sum='d02df11b4a7318b7250824f6d0bab9c0')# Everything works as expected on the application side:print(ubuntu.sha1sum)# Shows bc5fb639724b5cd90eb739845f246e2c564b0dd8print(type(ubuntu.sha1sum))# Shows <class 'str'>If you are feeling skeptical, check the database:$ ./manage.py dbshell
sqlite> .header on
sqlite> .mode column
sqlite> select hex(sha1sum) hex_sha1,
   ...>        length(hex(sha1sum)) size_if_this_was_varchar,
   ...>        length(sha1sum) actual_size
   ...> from downloads_isofile;
hex_sha1                                  size_if_this_was_varchar  actual_size
----------------------------------------  ------------------------  -----------
BC5FB639724B5CD90EB739845F246E2C564B0DD8  40                        20LicenseThis library is released under the3-Clause BSD License.tl;dr:“free to use as long as you credit me”.
Package: django-birdcage
When deploying large websites, operations teams will sometimes deploy new code across a subset of the entire collection of webservers. This approach is called a “Canary” deployment. Most users will continue to be served using the old code; only those users hitting a “Canary” machine will see the new code.Large websites will often use a Canary when the perceived risk of an upgrade is high. For example, upgrading the Django version from 1.8 LTS to 1.11 LTS on a complex site will generally be considered a risky upgrade; a Canary will be used to test that the upgrade is working as expected before switching all webservers over to the upgraded codebase.Unfortunately, while Django has goodbackwardscompatibility guarantees, Canary deployments requireforwardscompatibility as well. This is beacuse a user may have one request served on the new codebase, but subsequent updates served from the old codebase. If information (such as security tokens) aren’t both backwardsandforwards compatible between releases, some users will see errors as the move back and forth between old and new codebases.Birdcage is a project consisting of tools to help you manage Canary upgrades, by providedforwardscompatible shims for known problems in Django.What does Birdcage address?Django 1.10: Salted CSRF tokensDjango 1.10introduced a change to CSRF handlingto protect againstBREACHattacks. Django 1.10+ can interpret Django < 1.10 CSRF tokens; however, if a user is issued a Django 1.10+ CSRF token, it will be rejected as invalid by Django 1.8.To address this problem, Birdcage provides a version of Django 1.8’s CsrfViewMiddleware that can interpret Django 1.10’s CSRF tokens.In the settings for your Django 1.8 codebase, replacedjango.middleware.csrf.CsrfViewMiddlewarein yourMIDDLEWAREsetting withbirdcage.v1_11.csrf.CsrfViewMiddleware.In your Django 1.10+ codebase, continue to use the Django CsrfViewMiddleware.Why is it called Birdcage?Well you have to put your canariessomewhereto keep them safe… :-)
Package: django-birthday
django-birthday is a helper library to work with birthdays in models.Authored byJonas Obrist,  and some greatcontributors.Installationpipinstalldjango-birthdayUsagedjango-birthday provides abirthday.fields.BirthdayFieldmodel
field type which is a subclass ofdjango.db.models.DateFieldand
thus has the same characteristics as that. It also internally adds a
second field to your model holding the day of the year for that
birthday, this is used for the extra functionality exposed bybirthday.managers.BirthdayManagerwhich you should use as the
manager on your model.A model could look like this:fromdjango.dbimportmodelsfromdjango.confimportsettingsfrombirthdayimportBirthdayField,BirthdayManagerclassUserProfile(models.Model):user=models.ForeignKey(settings.AUTH_USER_MODEL)birthday=BirthdayField()objects=BirthdayManager()Get all user profiles within the next 30 days:UserProfile.objects.get_upcoming_birthdays()Get all user profiles which have their birthday today:UserProfile.objects.get_birthdays()Or order the user profiles according to their birthday:UserProfile.objects.order_by_birthday()For more details, see thedocumentationat Read The Docs.Licensedjango-birthdayis released under the BSD license.
Package: django-bisnavi
Introductiondjango-bisnavi allow you to…InstallationThere are a few different ways to install Bisnavi:Using pipIf you have pip install available on your system, just type:pip install django-bisnaviIf you’ve already got an old version of Bisnavi, and want to upgrade, use:pip install -U django-bisnaviInstalling from a directoryIf you’ve obtained a copy of Bisnavi using either Mercurial or a downloadable
archive, you’ll need to install the copy you have system-wide. Try running:python setup.py developIf that fails, you don’t havesetuptoolsor an equivalent installed;
either install them, or run:python setup.py installHow to use Bisnavi?If you have already installed Bisnavi, you must proceed with the
configuration of your project.ConfigurationFirst of all you must…How to test Bisnavi?Pleasetest Bisnavi before using it in your project:$ ./manage.py test bisnavi
Package: django-bitbucket-hook
Small Django APP for managing Bitbucket or Github webhooksTested on Python 2.7 and 3.4, with Django 1.7, 1.8 and 1.9. The minimum
version of Django that covers this APP is 1.7, there began the
maintenance ofJsonResponseHow to Installpip installdjango-bitbucket-hookAdddjango_bitbucket_hooktoINSTALLED_APPSin yoursettings.pyRun./manage.py migrateAddurl(r'^hook/',include('django_bitbucket_hook.urls'))In the admin panel you will find fields for HookFieldsName - The name of the hookUser - User created repository ( Example:https://github.com/Kras4ooo/django-bitbucket-hook/->Kras4ooo)Repo - The name of the repo ( Example:https://github.com/Kras4ooo/django-bitbucket-hook/->django-bitbucket-hook)Path - Full path to the script to be executed ( Example:/home/test/test-repo/execute-script.sh)Branch - Which branch to be monitored ( Example:dev,master,test,stage…etc )Go to set up your WebhookIf everything is okay you will get the following response in Webhook
({'success': True})Examples URLShttp[s]://domain/hook -> Gets the Hook that corresponds to the user
name, and repo namehttp[s]://domain/hook/name -> Gets the hook that fits the following
namehttp[s]://domain/hook/name/branch -> Gets the Hook which has the same
name and branch of the repository
Package: django-bitfield
Provides a BitField like class (using a BigIntegerField) for your Django models.RequirementsDjango >= 1.11 (a newer version with current security support is
highly recommended).PostgreSQL (see notes)Notes:SQLite does not support save operations using aBit(per the example under Usage).MySQL fails on most queries related to BitField’s.InstallationInstall it with pip (or easy_install):pip install django-bitfieldUsageFirst you’ll need to attach a BitField to your class. This acts as a BigIntegerField (BIGINT) in your database:from bitfield import BitField

class MyModel(models.Model):
    flags = BitField(flags=(
        'awesome_flag',
        'flaggy_foo',
        'baz_bar',
    ))Flags can also be defined with labels:class MyModel(models.Model):
    flags = BitField(flags=(
        ('awesome_flag', 'Awesome Flag!'),
        ('flaggy_foo', 'Flaggy Foo'),
        ('baz_bar', 'Baz (bar)'),
    ))Now you can use the field using very familiar Django operations:# Create the model
o = MyModel.objects.create(flags=0)

# Add awesome_flag (does not work in SQLite)
MyModel.objects.filter(pk=o.pk).update(flags=F('flags').bitor(MyModel.flags.awesome_flag))

# Set flags manually to [awesome_flag, flaggy_foo]
MyModel.objects.filter(pk=o.pk).update(flags=MyModel.flags.awesome_flag | MyModel.flags.flaggy_foo)

# Remove awesome_flag (does not work in SQLite)
MyModel.objects.filter(pk=o.pk).update(flags=F('flags').bitand(~MyModel.flags.awesome_flag))

# Find by awesome_flag
MyModel.objects.filter(flags=MyModel.flags.awesome_flag)

# Exclude by awesome_flag
MyModel.objects.filter(flags=~MyModel.flags.awesome_flag)

# Test awesome_flag
if o.flags.awesome_flag:
    print "Happy times!"

# List all flags on the field
for f in o.flags:
    print f

# Get a flag label
print o.flags.get_label('awesome_flag')Enjoy!AdminTo use the widget in the admin, you’ll need to import the classes and then update or create
a ModelAdmin with these formfield_overrides lines in your admin.py:from bitfield import BitField
from bitfield.forms import BitFieldCheckboxSelectMultiple

class MyModelAdmin(admin.ModelAdmin):
    formfield_overrides = {
            BitField: {'widget': BitFieldCheckboxSelectMultiple},
    }

admin.site.register(MyModel, MyModelAdmin)There is also aBitFieldListFilterlist filter (Django 1.4 or newer).
To use it setlist_filterModelAdmin option:list_filter = (
        ('flags', BitFieldListFilter,)
        )BitFieldListFilter is inbitfield.adminmodule:from bitfield.admin import BitFieldListFilterChangelog2.2.0 - 2022-07-11:Add support for Django 4.0.Drop support for Django versions older than 1.11.29.Drop support for Python 2.7.2.1.0 - 2021-05-25:Add support for Django 3.1, 3.2 (No changes needed).Add support for Python 3.8, 3.9.Fixed multiple bugs with use in the Django admin.Removed dead compatibility code.2.0.1 - 2020-01-25:Add support for Django 3.0.2.0.0 - 2020-01-24:Drop support for Django versions below 1.10.Use _meta.private_fields instead of deprecated _meta.virtual_fields in CompositeBitField.Add testing with python 3.6, 3.7 and Django 2.x to travis configuration.
Package: django-bitfield-4-0
Provides a BitField like class (using a BigIntegerField) for your Django models.(If you’re upgrading from a version before 1.2 the API has changed greatly and is backwards incompatible!)RequirementsDjango >= 1.10.8PostgreSQL (see notes)Notes:SQLite does not support save operations using aBit(per the example under Usage).MySQL fails on most queries related to BitField’s.InstallationInstall it with pip (or easy_install):pip install django-bitfieldUsageFirst you’ll need to attach a BitField to your class. This acts as a BigIntegerField (BIGINT) in your database:from bitfield import BitField

class MyModel(models.Model):
    flags = BitField(flags=(
        'awesome_flag',
        'flaggy_foo',
        'baz_bar',
    ))Flags can also be defined with labels:class MyModel(models.Model):
    flags = BitField(flags=(
        ('awesome_flag', 'Awesome Flag!'),
        ('flaggy_foo', 'Flaggy Foo'),
        ('baz_bar', 'Baz (bar)'),
    ))Now you can use the field using very familiar Django operations:# Create the model
o = MyModel.objects.create(flags=0)

# Add awesome_flag (does not work in SQLite)
MyModel.objects.filter(pk=o.pk).update(flags=F('flags').bitor(MyModel.flags.awesome_flag))

# Set flags manually to [awesome_flag, flaggy_foo]
MyModel.objects.filter(pk=o.pk).update(flags=MyModel.flags.awesome_flag | MyModel.flags.flaggy_foo)

# Remove awesome_flag (does not work in SQLite)
MyModel.objects.filter(pk=o.pk).update(flags=F('flags').bitand(~MyModel.flags.awesome_flag))

# Find by awesome_flag
MyModel.objects.filter(flags=MyModel.flags.awesome_flag)

# Exclude by awesome_flag
MyModel.objects.filter(flags=~MyModel.flags.awesome_flag)

# Test awesome_flag
if o.flags.awesome_flag:
    print "Happy times!"

# List all flags on the field
for f in o.flags:
    print f

# Get a flag label
print o.flags.get_label('awesome_flag')Enjoy!AdminTo use the widget in the admin, you’ll need to import the classes and then update or create
a ModelAdmin with these formfield_overrides lines in your admin.py:from bitfield import BitField
from bitfield.forms import BitFieldCheckboxSelectMultiple

class MyModelAdmin(admin.ModelAdmin):
    formfield_overrides = {
            BitField: {'widget': BitFieldCheckboxSelectMultiple},
    }

admin.site.register(MyModel, MyModelAdmin)There is also aBitFieldListFilterlist filter (Django 1.4 or newer).
To use it setlist_filterModelAdmin option:list_filter = (
        ('flags', BitFieldListFilter,)
        )BitFieldListFilter is inbitfield.adminmodule:from bitfield.admin import BitFieldListFilterChangelog2.1.0 - 2021-05-25:Add support for Django 3.1, 3.2 (No changes needed).Add support for Python 3.8, 3.9.Fixed multiple bugs with use in the Django admin.Removed dead compatibility code.2.0.1 - 2020-01-25:Add support for Django 3.0.2.0.0 - 2020-01-24:Drop support for Django versions below 1.10.Use _meta.private_fields instead of deprecated _meta.virtual_fields in CompositeBitField.Add testing with python 3.6, 3.7 and Django 2.x to travis configuration.
Package: django-bitfield-ivc
Provides a BitField like class (using a BigIntegerField) for your Django models.(If you’re upgrading from a version before 1.2 the API has changed greatly and is backwards incompatible!)RequirementsDjango >= 1.10.8PostgreSQL (see notes)Notes:SQLite does not support save operations using aBit(per the example under Usage).MySQL fails on most queries related to BitField’s.InstallationInstall it with pip (or easy_install):pip install django-bitfieldUsageFirst you’ll need to attach a BitField to your class. This acts as a BigIntegerField (BIGINT) in your database:from bitfield import BitField

class MyModel(models.Model):
    flags = BitField(flags=(
        'awesome_flag',
        'flaggy_foo',
        'baz_bar',
    ))Flags can also be defined with labels:class MyModel(models.Model):
    flags = BitField(flags=(
        ('awesome_flag', 'Awesome Flag!'),
        ('flaggy_foo', 'Flaggy Foo'),
        ('baz_bar', 'Baz (bar)'),
    ))Now you can use the field using very familiar Django operations:# Create the model
o = MyModel.objects.create(flags=0)

# Add awesome_flag (does not work in SQLite)
MyModel.objects.filter(pk=o.pk).update(flags=F('flags').bitor(MyModel.flags.awesome_flag))

# Set flags manually to [awesome_flag, flaggy_foo]
MyModel.objects.filter(pk=o.pk).update(flags=MyModel.flags.awesome_flag | MyModel.flags.flaggy_foo)

# Remove awesome_flag (does not work in SQLite)
MyModel.objects.filter(pk=o.pk).update(flags=F('flags').bitand(~MyModel.flags.awesome_flag))

# Find by awesome_flag
MyModel.objects.filter(flags=MyModel.flags.awesome_flag)

# Exclude by awesome_flag
MyModel.objects.filter(flags=~MyModel.flags.awesome_flag)

# Test awesome_flag
if o.flags.awesome_flag:
    print "Happy times!"

# List all flags on the field
for f in o.flags:
    print f

# Get a flag label
print o.flags.get_label('awesome_flag')Enjoy!AdminTo use the widget in the admin, you’ll need to import the classes and then update or create
a ModelAdmin with these formfield_overrides lines in your admin.py:from bitfield import BitField
from bitfield.forms import BitFieldCheckboxSelectMultiple

class MyModelAdmin(admin.ModelAdmin):
    formfield_overrides = {
            BitField: {'widget': BitFieldCheckboxSelectMultiple},
    }

admin.site.register(MyModel, MyModelAdmin)There is also aBitFieldListFilterlist filter (Django 1.4 or newer).
To use it setlist_filterModelAdmin option:list_filter = (
        ('flags', BitFieldListFilter,)
        )BitFieldListFilter is inbitfield.adminmodule:from bitfield.admin import BitFieldListFilterChangelog2.1.0 - 2020-05-25:Add support for Django 3.1, 3.2 (No changes needed).Add support for Python 3.8, 3.9.Fixed multiple bugs with use in the Django admin.Removed dead compatibility code.2.0.1 - 2020-01-25:Add support for Django 3.0.2.0.0 - 2020-01-24:Drop support for Django versions below 1.10.Use _meta.private_fields instead of deprecated _meta.virtual_fields in CompositeBitField.Add testing with python 3.6, 3.7 and Django 2.x to travis configuration.
Package: django-bitfield-manager
Automatic bitfield management for Django Models.QuickstartInstall bitfield_manager:pip install django-bitfield-managerAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'bitfield_manager',...)UsageFirst you’ll need a parent model with a status fieldfromdjango.dbimportmodelsfrombitfield_manager.modelsimportParentBitfieldModel,ChildBitfieldModelMixinclassParentExample(ParentBitfieldModel):status=models.BigIntegerField()def__str__(self):# __unicode__ on Python 2return"status:%i"%self.statusThen for all models you want django-bitfield-manager to manage add the BitfieldMeta with a list of parent models.
The list of parent models takes in a tuple. The first field is the source that will be modified. The
source should be a BigIntegerField or BitField (if using django-bitfield). The 2nd field
is the bitflag to use (i.e. 0 will be 1 << 0, 1 will be 1 << 1, etc.)classChildExample1(ChildBitfieldModelMixin,models.Model):parent=models.ForeignKey('ParentExample',null=True)classBitfieldMeta:parent_models=[('parent','status',0)]classChildExample2(ChildBitfieldModelMixin,models.Model):parent=models.ForeignKey('ParentExample',null=True)classBitfieldMeta:parent_models=[('parent.status',1)]Now when creating/deleting child models the parent status should update# create the modelp=ParentExample.objects.create(status=0)p2=ParentExample.objects.create(status=0)# add a child p.status is now 1c1=ChildExample1.objects.create(parent=p)# add the other child. p.status is now 3c2=ChildExample2.objects.create(parent=p)# deleting a child will refresh the status. p.status is now 2c1.delete()# updates or mass deletes will require manual refresh# p.status will be 2 and p2.status will be 0ChildExample2.objects.filter(parent=p).update(parent=p2)# trigger a manual refresh. p.status is now correct with a status of 0p.force_status_refresh()# if you know the related models modified you can specify them# p2.status is now 2p2.force_status_refresh(related_models=[ChildExample2])# force status refresh will work with models multiple levels deep. Specify the search_depth to search# more than 1 level deepp2.force_status_refresh(search_depth=2)FeaturesAllows for automatic bitfield management for Django Models.Will update the status when models are added or deletedSupports multi-level relationships (use dot syntax)Supports django-bitfieldRunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.3.0 (2017-01-31)Added exampleChanged the parent_models models tuple from (‘parent’, ‘child’, 0) to (‘parent.child’, 0)additional unit testsbug fixes0.2.0 (2017-01-27)Added django-bitfield supportNo longer uses signalsAdded mixin for child models (ChildBitfieldModelMixin)Added support for one-to-one and limited support for m2m fieldsAdded support for models multiple levels deep (using dot syntax)0.1.0 (2017-01-18)First release on PyPI.
Package: django-bitgo
django_bitgoDjango library for BitGoOverviewDjango BitGo is a powerful and flexible library for connecting your BitGo account and integrate it with your Django project.RequirementsPython (3.7, 3.8, 3.9, 3.10)Django (3.2, 4.0, 4.1)Wehighly recommendand only officially support the latest patch release of
each Python and Django series.InstallationInstall usingpip...pip install django-bitgoInstall usingpoetry...poetry add django-bitgoAdd'django_bitgo'to yourINSTALLED_APPSsetting.INSTALLED_APPS=[...'django_bitgo',]API ReferenceThewalletsmoduleThe top-level module for wallets.Refer to thedocumentationfor details on the use of this package.AddressExample of get an address object.address = Address()
    address.get_address(address_id=ADDRESS_ID, coin=COIN, wallet_id=WALLET_ID)
Package: django-bitid
A django app forbitIdauthentication.WARNING: ThebitIdspecification is a work in progress and it will probably change.InstallationIn your setting.py file, add the backend to AUTHENTICATION_BACKENDS.djbitid.backends.BitIdBackendYou can implement your own login passingbitid_uri,callback_uri,signatureandaddressto the backend or use the providedtemplates and forms.Views, Templates and FormsTo use the provided templates and forms adddjbitidto installed apps.Then add to your urlsurl(r'^bitid/',include('djbid.urls'))The provided templates  extend ‘base.html’Dependenciespybitidsouth: provides migrationspytz: for timezone aware date comparisonsNOTE: ThePyBitIDproject, as this project, is very early stage. Currently it has to be installed manually from:https://github.com/LaurentMT/pybitidSettingsOptional settings are:BITID_USE_TESTNETUse bitcoin testnet. Defaults to FalseBITID_CHALLENGE_EXPIRATION_DELAYChallenge expiration time in seconds. Defaults to 600 seconds.
Package: django-bitmask-field
BitmaskField implementation forDjangoORMRequirementsPython 2.7 or Python 3.4+Django 1.8+Examplefromdjango.dbimportmodelsfromdjango_bitmask_fieldimportBitmaskFieldclassMyModel(models.Model):bitmask=BitmaskField(choices=[(1,'bit0'),(2,'bit1'),(4,'bit2')],# available choicesdefault=1|4,# bit0 and bit2 are enabled by default)Installpipinstalldjango-bitmask-field
Package: django-bitoptions
django-bitoptionsThis project replaces several related BooleanFields with a single field and
a few eye candy features.installationpip install django-bitoptionsusagefromdjango.dbimportmodelsfrombitoptionsimportBitOptions,BitOptionsFieldTOPPINGS=BitOptions(('pepperoni','mushrooms','onions','sausage','bacon','black olives','green olives','green peppers','pineapple','spinach','tomatoes','broccoli','jalapeno peppers','anchovies','chicken','beef','ham','salami'))CHEESES=BitOptions(('feta','parmesan','provolone','goat','mozzarella'))classPizza(models.Model):toppings=BitOptionsField(options=TOPPINGS)cheeses=BitOptionsField(options=CHEESES)
Package: django-bittersweet
DocumentationThis is the limited subset of mydjango-sugarfork which I
regularly use enough to distribute on PyPI.Seehttps://django-bittersweet.readthedocs.org/LicenseExcept forbittersweet_json, all code is released into the public domain.
SeeLICENSEQuickstartSeehttps://django-bittersweet.readthedocs.org/en/latest/quickstart.htmlRunning TestsYou can run the tests against every supported version of Python / Django usingtox.If you’re developing new features, runpython setup.py test.