Saravanan666/pypi-org huggingface dataset:
Package: django-strawberry
Additional fields for(ever) Django.PrerequisitesDjango 1.11, 2.0, 2.1, 2.2 and 3.0.Python 2.7, 3.6, 3.7 and 3.8.DocumentationDocumentation is available onRead the Docs.Main features and highlightsMD5Field.InstallationInstall latest stable version from PyPI:pipinstalldjango-strawberryor latest stable version from GitHub:pipinstallhttps://github.com/barseghyanartur/django-strawberry/archive/stable.tar.gzor latest stable version from BitBucket:pipinstallhttps://bitbucket.org/barseghyanartur/django-strawberry/get/stable.tar.gzUsageMD5 fieldIn case you want to have an MD5 field populated from another field of the same
model.Example 1myapp/models.pyfromdjango.dbimportmodelsfromstrawberry.fieldsimportMD5FieldclassMyModel(models.Model):title=models.CharField(max_length=255)title_hash=MD5Field(populate_from='title',null=True,blank=True)def__str__(self):returnself.titlemyapp/example.pyfrommyapp.modelsimportMyModelmymodel=MyModel.objects.create(title="Lorem7")print(mymodel.title_hash)'d48a712e77902d0558a3721d9a4740c9'Example 2Thepopulate_fromargument can also be a callable, that would expect
the model instance as an argument. Thus, example identical to the first one
would be:myapp/models.pyfromdjango.dbimportmodelsfromstrawberry.fieldsimportMD5Fielddefstrip_title(instance):returninstance.title.strip()classMyModel(models.Model):title=models.CharField(max_length=255)title_hash=MD5Field(populate_from=strip_title,null=True,blank=True,)def__str__(self):returnself.titlemyapp/example.pyfrommyapp.modelsimportMyModelmymodel=MyModel.objects.create(title=" Lorem7 ")print(mymodel.title_hash)'d48a712e77902d0558a3721d9a4740c9'TestingProject is covered with tests.To test with all supported Python/Django versions type:toxTo test against specific environment, type:tox-epy38-django30To test just your working environment type:./runtests.pyTo run a single test in your working environment type:./runtests.pysrc/strawberry/tests/test_fields.pyOr:./manage.pyteststrawberry.tests.test_fieldsIt’s assumed that you have all the requirements installed. If not, first
install the test requirements:pipinstall-rexamples/requirements/test.txtWriting documentationKeep the following hierarchy.=====
title
=====

header
======

sub-header
----------

sub-sub-header
~~~~~~~~~~~~~~

sub-sub-sub-header
^^^^^^^^^^^^^^^^^^

sub-sub-sub-sub-header
++++++++++++++++++++++

sub-sub-sub-sub-sub-header
**************************LicenseGPL-2.0-only OR LGPL-2.1-or-laterSupportFor any issues contact me at the e-mail given in theAuthorsection.AuthorArtur Barseghyan <artur.barseghyan@gmail.com>
Package: django-strict-fields
django-strict-fieldsThis library is meant to help enforce stricter rules around using some of the basic model fields that Django provides. View the docshereto get started.Compatibilitydjango-strict-fieldsis compatible with Python 3.8 - 3.12 and Django 3.2 - 5.0.DocumentationView the django-strict-fields docs hereInstallationInstalldjango-strict-fieldswith:pip3 install django-strict-fieldsAfter this, addstrict_fieldsto theINSTALLED_APPSsetting of your Django project.Contributing GuideFor information on setting up django-strict-fields for development and contributing changes, viewCONTRIBUTING.md.Primary Authors@tomage: Tómas Árni Jónasson
Package: django-string-externalization
django_string_externalizationThis is a tool for django apps to externalize their strings into yaml files. Messages for multiple languages are co-located in the same file. This is ideal for bilingual apps.page_title:en:"MyApp"fr:"MonApp"You can define translations accross multiple files.UsageFirst, you'll want to create a yaml file with your strings. File names must end with.text.yaml.# mytext.text.yamlpage_title:en:"MyApp"fr:"MonApp"# variableswelcome_message:en:Welcome %(firstname)s %(lastname)sfr:Bienvenue %(firstname)s %(lastname)sthe_current_year_is:en:The current year is %(current_year)sfr:L'année en cours est %(current_year)sThen, you'll want to create aTextMakerCreatorobject:TextMakerCreator(global_keys, text_files).Global keys are an optional concept that let you define variables available to all of your text entries.global_keys={"en":{"current_year":"2019-20"},"fr":{"current_year":"2019-2020"},}tm=TextMakerCreator(global_keys,["my_app/mytext.text.yaml"]).get_tm_func()tm("page_title")=="My App"tm("welcome_message",extra_keys={"firstname":"Alex","lastname":"Leduc"})=="Welcome Alex Leduc"tm("the_current_year_is")=="The current year is 2019-20"You can create many text-maker functions, with indepedent or overlapping text files. This is useful if you want isolated possibly name-clashing text entries.WatchingIf you're using django's dev-server, you can useWatchingTextMakerCreatorinstead, and it will reload text entries when the yaml files change.If you use the watching feature, you'll need watchdog installed. This library supports version 2Sanitization and markdownHTML is sanitized by default, using this whitelist of tags,ALLOWED_TAGS=["a","b","em","i","li","ol","p","strong","ul","br","div"]You can disable sanitization by passingsanitize_output=Falseto thetmfunction. Inputs (extra_args) will still be sanitized, unless you also passsanitize_input=False.You can provide custom sanization and markdown logic by overriding the TextMaker's classrender_markdownandsanitizemethods.Unless you override these methods, you must install themistune(version 2) andbleach(version 3) packagesPitfalls and gotchastm()returns lazy objects which resolve and behave like strings, this can trip up some packages likeopenpyxlwhen it tries to write these objects to cells. You can force the lazy object to resolve by performing string operations, e.g.tm("title")+"". Simply callingstr(tm("title"))will not work.If you want to use the%character in a string, you'll need to escape it with itself%%
Package: django-stringfield
A field intended for strings that typically has a length less than 500
characters.  django-stringfield tries to not to enforce length on database level
if possible but different databases have different limitations. Currently
implemented as:PostgreSQLcharacter varyingMySQLVARCHAR (65528)[1]OracleVARCHAR2 (4000)SQLite & Other backendsTEXTInstallationpip install django-stringfieldUsageYou use this just like the normaldjango.db.models.CharFieldexcept that the
key word argumentmax_lengthworks a little differently:It is optional and defaults to 500It only enforces max length on the default formfieldnoton the database.Example:# models.py
from stringfield import StringField

class MyModel(models.Model):
    name = StringField()[1]MySQL >= 5.0.3 should be able to handle a maximum length of 65535 but
that does not work in my empirical testing using mysql 5.1.41 where 65528
is the maximum consideringNULLandNOT NULL.
Package: django-string-renderer
django-string-rendererA thin wrapper around the Django templating system to render any string as a template. It provides an easy way to render any user inputted string as a regular django template.RequirementsThis wrapper uses no models and requires no other settings than adjangoengine in theTEMPLATESsetting where the app is used.This package uses type annotations andmypyto check those annotations.This package is only tested against Python >= 3.6 and Django >= 3.2.InstallationBinary Package from PyPiIn order to use this app in a Django project, the simplest way is to install it fromPyPi:pipinstalldjango-string-rendererFrom the Source CodeIn order to modify or test this app you may want to install it from the source code.Clone theGitHub repositoryand then run:pipinstall-rrequirements.txt-rrequirements-dev.txtUsageStart by addingstringrendererto yourINSTALLED_APPSsetting like this:INSTALLED_APPS=(...,'stringrenderer',)Then use theStringTemplateRendererclass to build a Django template instance from a string et render the string with the context of your choice:importstringrenderertemplate_string="Hello {{ recipient.first_name }} {{ recipient.last_name }}!"renderer=StringTemplateRenderer(template_string)rendered_content=renderer.render_template(context=dict(recipient=recipient_1),request=request)rendered_content=renderer.render_template(context=dict(recipient=recipient_2),request=None)When the first rendering request occurs on a givenStringTemplateRendererinstance, aTemplateobject is built from the string passed to__init__(), and cached for the next rendering operations with other contexts.You may check the template syntax of a string like this:importstringrenderertemplate_string="Hello {{ recipient.first_name }} {{ recipient.last_name }}!"is_valid,syntax_error=check_template_syntax(template_string)TestingGet the source code fromGitHub, follow theinstallation instructionsabove, and run the following command:pythonruntests.pyThis will run the test suite with the locally installed version of Python and Django.Projects Using this AppThis app is used in the following projects:MyGym Web: a web platform for managing sports clubs. django-string-renderer is used to render the messages and emails addressed to the members.
Package: django-stripe-payments
======================django-stripe-payments======================a payments Django app for Stripe.. image:: https://img.shields.io/travis/pinax/django-stripe-payments.svg:target: https://travis-ci.org/pinax/django-stripe-payments.. image:: https://img.shields.io/coveralls/pinax/django-stripe-payments.svg:target: https://coveralls.io/r/pinax/django-stripe-payments.. image:: https://img.shields.io/pypi/dm/django-stripe-payments.svg:target:  https://pypi.python.org/pypi/django-stripe-payments/.. image:: https://img.shields.io/pypi/v/django-stripe-payments.svg:target:  https://pypi.python.org/pypi/django-stripe-payments/.. image:: https://img.shields.io/badge/license-MIT-blue.svg:target:  https://pypi.python.org/pypi/django-stripe-payments/This app allows you to process one off charges as well as signup users forrecurring subscriptions managed by Stripe.Documentation can be found at http://django-stripe-payments.readthedocs.orgSome suggested integration steps:1. Overload the templates provided to use your inheritance tree (for bases etc) and block names.2. Point your stripe account at the webhook address in the payments urls.3. Add the static media snippet from here (or else nothing will actually talk to stripe):* http://django-stripe-payments.readthedocs.org/en/latest/installation.html#configuration-modifications-to-settings-py4. Set up SSL if you have not already.5. Define some plans (see docs).6. Run syncdb to generate the necessary tables, then init_plans and init_customers.Development-----------To run test suite::$ pip install detox$ detox
Package: django-strong-passwords
django-strong-passwords is a Django application that provides a form field and
validators that check the strength of a password. It is a fork of django-passwords which
adds support for modern versions of Django and Python.Installationpip install django-strong-passwordsCompatibilitydjango-strong-passwords is tested with Django 3.2+ and Python 3.7+.Settingsdjango-strong-passwords adds 6 optional settingsOptional:Specifies minimum length for passwords:PASSWORD_MIN_LENGTH=6# Defaults to 6Specifies maximum length for passwords:PASSWORD_MAX_LENGTH=120# Defaults to NoneSpecifies the location of a dictionary (file with one word per line):PASSWORD_DICTIONARY="/usr/share/dict/words"# Defaults to NoneSpecifies how close a fuzzy match has to be to be considered a match:PASSWORD_MATCH_THRESHOLD=0.9# Defaults to 0.9, should be 0.0 - 1.0 where 1.0 means exactly the same.Specifies a list of common sequences to attempt to match a password against:PASSWORD_COMMON_SEQUENCES=[]# Should be a list of strings, see passwords/validators.py for defaultSpecifies number of characters within various sets that a password must contain:PASSWORD_COMPLEXITY={# You can omit any or all of these for no limit for that particular set"UPPER":1,# Uppercase"LOWER":1,# Lowercase"LETTERS":1,# Either uppercase or lowercase letters"DIGITS":1,# Digits"SPECIAL":1,# Not alphanumeric, space or punctuation character"WORDS":1# Words (alphanumeric sequences separated by a whitespace or punctuation character)}UsageTo use the formfield simply import it and use it:fromdjangoimportformsfrompasswords.fieldsimportPasswordFieldclassExampleForm(forms.Form):password=PasswordField(label="Password")You can make use of the validators on your own fields:fromdjangoimportformsfrompasswords.validatorsimportdictionary_wordsfield=forms.CharField(validators=[dictionary_words])You can also create custom validator instances to specify your own
field-specific configurations, rather than using the global
configurations:fromdjangoimportformsfrompasswords.validatorsimport(DictionaryValidator,LengthValidator,ComplexityValidator)field=forms.CharField(validators=[DictionaryValidator(words=['banned_word'],threshold=0.9),LengthValidator(min_length=8),ComplexityValidator(complexities=dict(UPPER=1,LOWER=1,DIGITS=1)),])Django’spassword validation APIis slightly different than the form
validation API and has wrappers in theauth_password_validatorsmodule:AUTH_PASSWORD_VALIDATORS=[…,{"NAME":"passwords.auth_password_validators.ComplexityValidator"}]
Package: django-structlog-duration
django-structlog-durationIf you usedjango-structlog, this is a little extension that will populate therequest_finishedlog with the duration of the request (request_duration).InstallationInstall the package.pipinstalldjango-structlog-durationConfigure the middleware.MIDDLEWARE=["django_structlog_duration.StartTimer",# ..."django_structlog.middlewares.RequestMiddleware","django_structlog_duration.StopTimer",]
Package: django-structured-data
Django Structured DataTemplate tags to assist in adding structured metadata to views and models.InstallAdd "structured_data" to yourINSTALLED_APPS:INSTALLED_APPS=[...'structured_data',]UseIn modelsDefine astructured_dataproperty on your models. This is written in a standard JSON-LD format. Included
below is a complicated example.@propertydefstructured_data(self):url=SITE_URL+self.get_absolute_url()data={'@type':'BlogPosting','headline':self.title,'author':{'@type':'Person','name':self.author},'datePublished':self.created.strftime('%Y-%m-%d'),'dateModified':self.modified.strftime('%Y-%m-%d'),'url':url,'mainEntityOfPage':{'@type':'WebPage','@id':url},}ifself.image:data['image']=SITE_URL+self.image.urlreturndataIn templatesUse thejson_ld_fortemplate tag to render your structured data as JSON-LD.{% load jsonld %}
{% json_ld_for post %}A second template tag,og_for, is also included. This attempts to translate your JSON-LD
data to Open Graph tags that can be read by Facebook, Twitter, Telegram
and more.{% load opengraph %}
{% og_for post %}A third template tag,meta_for, will render thedescriptionfield from
your JSON-LD data as a standard HTML meta description tag.{% load meta %}
{% meta_for post %}LicenseThis software is released under the MIT license.Copyright (c) 2019-2024 Luke Rogers

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Package: django-sts
# State Transition System (STS) for Django[State Transition Systems][1] have less constraints than Finite StateAutomata, and can be utilized for various use cases.The core components include:- State- Event- Transition- System**Events** cause a **transition** from some **state** to a new state withina given **system**.The API supports defining _immediate_ transitions and _long-running_transitions. Now, for a riveting example..```pythonsystem = System(name='Example 1')system.save()# Immediate transition.. event => statesystem.transition('Door Opened', event='Open Door')# 'Long-running' transitions.. event happenssystem.start_transition('Close Door Slowly')# Time passes..time.sleep(2)# The resulting state..system.end_transition('Door Closed')```To remove the boilerplate from the above example, use the `transition`context manager instead:```pythonfrom sts.contextmanagers import transitionwith transition('Example 1', 'Door Closed', event='Close Door Slowly'):time.sleep(2)```A model object can be associated directly with a `System` using Django'sContentTypes framework generic foreign keys.```pythondoor = Door.objects.get(name='Door #1')system = System(content_object=door)# ...````System` objects have a few extra conveniences:```python# number of transitionslen(system) == system.length# iteration starting with the first transitionfor trans in system:...# indexing and slicessystem[:3]  # first 3 transitionssystem[-3:] # last 3 transitionssystem[:-3] # all except the last 3 transitionssystem[1:3] # arbitrary slicesystem[2]   # specific transition```This enables bringing in django-sts to an existing model to begin trackingstates of objects.It even comes with an abstract `STSModel` that augments a model with the abovemethods for seamless integration (it does not add any model fields):```pythonclass Door(STSModel):name = models.CharField(max_length=20)door = Door()door.save()door.transition('Door Closed', event='Close Door')```The library leaves it up to the application to implement the constraints of afinite state automata/machine.[1]: http://en.wikipedia.org/wiki/State_transition_system
Package: django-stubs-ext
Extensions and monkey-patching for django-stubsThis package contains extensions and monkey-patching functions for thedjango-stubspackage. Certain features of django-stubs (i.e. generic django classes that don't define the__class_getitem__method) require runtime monkey-patching, which can't be done with type stubs. These extensions were split into a separate package so library consumers don't needmypyas a runtime dependency (#526).Installationpipinstalldjango-stubs-extUsageIn your Django application, use the following code:importdjango_stubs_extdjango_stubs_ext.monkeypatch()This only needs to be called once, so the call tomonkeypatchshould be placed in your top-level settings.
Real-life examplecan be found here.Version compatibilitySince django-stubs supports multiple Django versions, this package takes care to only monkey-patch the features needed by your django version, and decides which features to patch at runtime. This is completely safe, as (currently) we only add a__class_getitem__method that does nothing:@classmethoddef__class_getitem__(cls,*args,**kwargs):returnclsTo get helpFor help with django-stubs, please view the main repository athttps://github.com/typeddjango/django-stubsWe have a Gitter chat here:https://gitter.im/mypy-django/LobbyIf you think you have a more generic typing issue, please refer tohttps://github.com/python/mypyand their Gitter.ContributingThe django-stubs-ext package is part of thedjango-stubsmonorepo. If you would like to contribute, please view the django-stubscontribution guide.You can always also reach out in gitter to discuss your contributions!
Package: django-stubs-ext-adb
Extensions and monkey-patching for django-stubsThis package contains extensions and monkey-patching functions for thedjango-stubspackage. Certain features of django-stubs (i.e. generic django classes that don't define the__class_getitem__method) require runtime monkey-patching, which can't be done with type stubs. These extensions were split into a separate package so library consumers don't needmypyas a runtime dependency (#526).Installationpipinstalldjango-stubs-extUsageIn your Django application, use the following code:importdjango_stubs_extdjango_stubs_ext.monkeypatch()This only needs to be called once, so the call tomonkeypatchshould be placed in your top-level settings.
Real-life examplecan be found here.Version compatibilitySince django-stubs supports multiple Django versions, this package takes care to only monkey-patch the features needed by your django version, and decides which features to patch at runtime. This is completely safe, as (currently) we only add a__class_getitem__method that does nothing:@classmethoddef__class_getitem__(cls,*args,**kwargs):returnclsTo get helpFor help with django-stubs, please view the main repository athttps://github.com/typeddjango/django-stubsWe have a Gitter chat here:https://gitter.im/mypy-django/LobbyIf you think you have a more generic typing issue, please refer tohttps://github.com/python/mypyand their Gitter.ContributingThe django-stubs-ext package is part of thedjango-stubsmonorepo. If you would like to contribute, please view the django-stubscontribution guide.You can always also reach out in gitter to discuss your contributions!
Package: django-stubs-patch
django-stubs-patchA pmypy django-stubs patch work for python3.6Github repository:https://github.com/mrlyc/django-stubs-patch/Documentationhttps://mrlyc.github.io/django-stubs-patch/Getting started with your projectFirst, create a repository on GitHub with the same name as this project, and then run the following commands:gitinit-bmain
gitadd.
gitcommit-m"init commit"gitremoteaddorigingit@github.com:mrlyc/django-stubs-patch.git
gitpush-uoriginmainFinally, install the environment and the pre-commit hooks withmakeinstallYou are now ready to start development on your project! The CI/CD
pipeline will be triggered when you open a pull request, merge to main,
or when you create a new release.To finalize the set-up for publishing to PyPi or Artifactory, seehere.
For activating the automatic documentation with MkDocs, seehere.
To enable the code coverage reports, seehere.Releasing a new versionCreate an API Token onPypi.Add the API Token to your projects secrets with the namePYPI_TOKENby visitingthis page.Create anew releaseon Github.
Create a new tag in the form*.*.*.For more details, seehere.Repository initiated withfpgmaas/cookiecutter-poetry.
Package: django-studiogdo
StudioGdoStudioGdo is a MVC extension framework. It allows to use simply ORM Model in HTML Templates using path notation.This module is just for now the Java/Django interface and will be completed to be self contained once all source will be rewritten in Python.To get more informations on project (documentation and milestones) please contact:gdoumenc@studiogdo.com,eklein@123imprim.comSettingsSTUDIOGDO_FACET =“django”  # to use the django template renderer
“java”    # to use the java template rendererSTUDIOGDO_HOST = “url_to_you_studiogdo_server”STUDIOGDO_SERVLET = “servlet/prefix”TEMPLATE_CONTEXT_PROCESSORS = (…, ‘studiogdo.context_processors.include_studiogdo_address’, …)MIDDLEWARE_CLASSES = (…, ‘studiogdo.middleware.APICookies’, …)