Saravanan666/pypi-org huggingface dataset:
Package: django-assignment
# Assignment One### Componenti del gruppo:Nome: Simone Pierro,matricola: 852285,e-mail:s.pierro2@campus.unimib.itNome: Andrea Pascuzzi,matricola: 903604,e-mail:a.pascuzzi2@campus.unimib.it### Descrizione del progetto:Si tratta di un progetto scritto in python utilizzando il framework Django Rest Framework.
Il codice sorgente è stato clonato dal seguente repository:https://github.com/vishavjeet1999/todo_project.git. Questo progetto prevede la creazione di elementi “ToDo” che vengono suddivisi in liste ToDo.
Nonostate la sua semplicità, è già provvisto di una parte statica (FE) e di una connessione verso un database. In questo caso il DBMS utilizzato in origine (sqlite) è stato sostituito con un DBMS PostgreSQL per poter sfruttare il PaaS fornito da Heroku per lo storing degli item ToDo.
Heroku rappresenta anche il PaaS su cui avviene il deploy dell’applicativo.
La pipeline è stata realizzata tenendo a mente la struttura DAG (Directed Acyclic Graph), anche se non è necessario specificare il tipo di struttura per un pallicazione così semplice, se in futuro si dovessero aggiungere dei requisiti e modificare la pipeline si può tenere conto di questo metodo che ne massimizza l’efficienza.
La pipeline è suddivisa nei seguenti stage:Build: questo stage pone le basi per gli stage successivi. Al suo interno vengono installati pacchetti, requirements e le dipendenze necessarie alla corretta esecuzione della pipeline. Viene anche creato il virtual enviroment di python ed in ultimo vengono esportate le impostazioni di django relative al progetto.Lint: lo stage Lint si occupa dell’analisi statica del codice, attraverso un programma chiamato Lint. Questa parte della pipeline si occupa di controllare e segnalare errori di programmazione, bugs ed errori relativi alla struttura del codice senza effettivamente eseguire il codice.Migrate: lo stage Migrate è legato al funzionamento del framework Django e prevede il processo di migrazione dello schema della base dati verso il Database vero e proprio.Test: all’interno di questo stage è presente il test di unità sulle istanze todo create durante il processo gestito dalla pipeline. Viene usato lo strumento “Coverage”, il quale permette sia di lanciare i test unità (e di integrazione quando implementati) sia di verificare l’effettiva copertura del codice da parte dei test menzionati.Deploy: questo stage prevede il deploy vero e proprio dell’applicativo. Come citato in precedenza il PaaS utilizzato è Heroku. Abbiamo preferito utilizzare una piattaforma che ci offrisse già alcune funzionalità come il bilanciamento del carico e l’assegnazione delle risorse. Inoltre Heroku offre la possibilità di abilitare un modulo legato al DBMS PostgreSQL, gestendo in maniera semi-automatica l’integrazione con l’applicativo Django.### Altre note
- i test di unità e d’integrazione non coprono tutti gli snippet di codice, si concentrano più sulla parte dimostrativa che quantitativa. Questo perchè si vuole riporre il focus sulla costruzione della pipeline.
- Heroku fa riferimento al branch main per implementare le change. Viene gestito all’interno della parte di deploy.
Package: django-assignment-pss
# Assignment One### Componenti del gruppo:Nome: Simone Pierro,matricola: 852285,e-mail:s.pierro2@campus.unimib.itNome: Andrea Pascuzzi,matricola: 903604,e-mail:a.pascuzzi2@campus.unimib.it### Descrizione del progetto:Si tratta di un progetto scritto in python utilizzando il framework Django Rest Framework.
Il codice sorgente è stato clonato dal seguente repository:https://github.com/vishavjeet1999/todo_project.git. Questo progetto prevede la creazione di elementi “ToDo” che vengono suddivisi in liste ToDo.
Nonostate la sua semplicità, è già provvisto di una parte statica (FE) e di una connessione verso un database. In questo caso il DBMS utilizzato in origine (sqlite) è stato sostituito con un DBMS PostgreSQL per poter sfruttare il PaaS fornito da Heroku per lo storing degli item ToDo.
Heroku rappresenta anche il PaaS su cui avviene il deploy dell’applicativo.
La pipeline è stata realizzata tenendo a mente la struttura DAG (Directed Acyclic Graph), anche se non è necessario specificare il tipo di struttura per un pallicazione così semplice, se in futuro si dovessero aggiungere dei requisiti e modificare la pipeline si può tenere conto di questo metodo che ne massimizza l’efficienza.
La pipeline è suddivisa nei seguenti stage:Build: questo stage pone le basi per gli stage successivi. Al suo interno vengono installati pacchetti, requirements e le dipendenze necessarie alla corretta esecuzione della pipeline. Viene anche creato il virtual enviroment di python ed in ultimo vengono esportate le impostazioni di django relative al progetto.Lint: lo stage Lint si occupa dell’analisi statica del codice, attraverso un programma chiamato Lint. Questa parte della pipeline si occupa di controllare e segnalare errori di programmazione, bugs ed errori relativi alla struttura del codice senza effettivamente eseguire il codice.Migrate: lo stage Migrate è legato al funzionamento del framework Django e prevede il processo di migrazione dello schema della base dati verso il Database vero e proprio.Test: all’interno di questo stage è presente il test di unità sulle istanze todo create durante il processo gestito dalla pipeline. Viene usato lo strumento “Coverage”, il quale permette sia di lanciare i test unità (e di integrazione quando implementati) sia di verificare l’effettiva copertura del codice da parte dei test menzionati.Deploy: questo stage prevede il deploy vero e proprio dell’applicativo. Come citato in precedenza il PaaS utilizzato è Heroku. Abbiamo preferito utilizzare una piattaforma che ci offrisse già alcune funzionalità come il bilanciamento del carico e l’assegnazione delle risorse. Inoltre Heroku offre la possibilità di abilitare un modulo legato al DBMS PostgreSQL, gestendo in maniera semi-automatica l’integrazione con l’applicativo Django.### Altre note
- i test di unità e d’integrazione non coprono tutti gli snippet di codice, si concentrano più sulla parte dimostrativa che quantitativa. Questo perchè si vuole riporre il focus sulla costruzione della pipeline.
- Heroku fa riferimento al branch main per implementare le change. Viene gestito all’interno della parte di deploy.
Package: django-assistant
django_assistant is a simple Django app to aid developers.
Detailed documentation is in the “docs” directory.Some highlights
1. find the location of a view, model, task
2. api documentation toolQuick startAdd “django_assistant” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'django_assistant',
]Include the polls URLconf in your project urls.py like this:url(r'^django_assistant/', include('django_assistant.urls')),Runpython manage.py migrateto create the polls models.Start the development server and visithttp://127.0.0.1:8000/django_assistant/and start wondering how you lived without it :)
Package: django-associations
What is Associations?Associations is a small app created to help Django developers.What does it do?It lists urls in an app along with the names of templates, views and urls associated with itWhy was it created?When working on a View, the common method of debugging or back tracing an issue is usually this:Look at the URL in the browser’s address barDecipher the app name from the URLOpen the app project tree in your IDE (if not already open)Open the app’s urls.py and locate the URLLook for the corresponding viewLocate the viewLocate the template name and subsequently the template itself.Associationson the other hand lists all of them on a single page, thereby decreasing the
some times frustrating trace back.Great, but what’s the catch?The catch is that right now it’s shown to be compatible with Class Based Views. It may or may not
work with traditional Function Based Views. Furthermore it has been tested on Django 1.4+ and Python 2.7.x.
There are plans to support Python 3. Django 1.3 won’t be supported due to change in URL structures.Like to help out?You can find the Github repository here:https://github.com/DarkSector/django-associationsLog issues or start developing. The documentation is currently being written.RequirementsCurrently works with Django 1.4 above and Python 2.7.x.
Currently the docs and tests are being written and aren’t completeQuick startAdd “associations” to your INSTALLED_APPS setting like this:INSTALLED_APPS = (
    ...
    'associations',
)Include the BASE_DIR in your project settings like this:BASE_DIR = os.path.dirname(os.path.dirname(__file__))If the ‘BASE_DIR’ is defined as some other variable, define BASE_DIR = <variable name>Include the Associations URLconf in your project urls.py like this:url(r'^associations/', include('associations.urls')),Start the development server and visithttp://127.0.0.1:8000/associations/and you’re ready to go.
Package: django-assume
django-assumeDjango Assume is a simple, reusable Django app that allows administrators to
log in to other user accounts without having to provide a password. This can
be useful for investigating and troubleshooting problems related to specific
user accounts.This app is intended for use with Django 1.3 and later.Suggestions and contributions are welcome. USE THIS APP AT YOUR OWN RISK!InstallationAddassumetosettings.INSTALLED_APPSand make sure that theapp_directoriestemplate loader is enabled in your project:INSTALLED_APPS = (
    # ...
    'assume',
)Add one of the custom authentication backends inassume.backendstosettings.AUTHENTICATION_BACKENDS. For example:AUTHENTICATION_BACKENDS = (
    'assume.backends.AssumableModelBackend',
    'django.contrib.auth.backends.ModelBackend',
)Includeassume.admin_urlsin your project’s URL patterns:urlpatterns += patterns('',
    (r'^admin/', include('assume.admin_urls')),
)You should now see an “Assume” button near the top of each Change User form
in admin.OptionsTo specify the next URL to be redirected to after a user has been
assumed, use the following setting:URL_AFTER_ASSUME = '/next/url/'Alternately, specify a custom URL pattern and pass anext_urlparameter to theassume_userview:urlpatterns += patterns('',
    url(r'^admin/auth/user/(\d+)/assume/$', 'assume.views.assume_user', {
        'next_url': '/demo/'
    }, name='assume_user'),
)By default, staff members cannot be assumed. This can be changed using
the following setting:CAN_ASSUME_STAFF = True
Package: django-asterisk
Descriptiondjango-asterisk is a reusable Django app for queuing and managing phone calls, inspired and based on django-mailer. It makes calls through the Management interface of an Asterisk server.SetupAdd the django_asterisk app in settings.INSTALLED_APPSSet the following variables in settings.py:AST_HOST = 'localhost'
AST_USER = 'django'
AST_PASS = 'mysecret'
AST_PRIO = 1
AST_TIMEOUT_ORIGINATE = 30 # sec
AST_TIMEOUT_HANGUP = 120 # secChange the default passwords!!Requirementspyst (http://pyst.sf.net/)a working Asterisk server (see docs/asterisk for a sample config)UsageSupposing you have an object called ‘user’ with the ‘phone_number’ attribute, you can create and queue a call like this:from django_asterisk.models import Call
channel = 'SIP/%s@mysipprovider' % user.phone_number
call = Call(channel=channel, extension=user.phone_number, context='django-out', caller_id='"Django Asterisk Test" <0123456789>', related_object=user)
call.save()You can later make the call from the admin, by selecting it and executing the “Make call” action.
Package: django-asutheme
This project provides base templates for use in Django apps that need to
conform to the ASUUniversity Web Design Standards.It relies on the assets created by theASU Web Standards Bootstrap projectprovided by
theGlobal Institute of Sustainability.Installation & UsageInstall using pip (or easy_install):pip install django-asuthemeAdd'asutheme'to yourINSTALLED_APPS:INSTALLED_APPS = (
    ...
    'django.contrib.admin',
    'asutheme',
)Add'asutheme.context_processors.container_style'to your list of context processors.
By default the containers are fixed, if you would like them to be fluid add to your settings file.ASU_THEME_FLUID = Trueto your settings file.You can now extend the base template and add to/override defined blocks:{% extend asutheme/base.html %}

{% block asu_site_title_main %}
    <a href="https://lib.asu.edu" title="Arizona State University - Libraries">ASU Libraries</a>
{% endblock %}

{% block navbar_content %}
    <li><a href="/media">Media</a></li>
{% endblock %}

{% block super_footer_brand %}
    <img src="/static/images/libraries_logo_footer.png" alt="ASU Libraries Logo">
    <address>
        ...
    </address>
{% endblock %}
Package: django-async
Django Async is an asynchronous execution queue for Django with proper
database transaction management.Building a database backed task queue is a fairly trivial thing, but
getting the database transactions exactly right is no simple matter.Usage and documentationAll documentation can be found athttp://www.kirit.com/Django%20AsyncDoing developmentThis project uses git flow. Don’t forget to do ``git flow init -d``To test just runtox. But if you want to go the old way then to
create virtual environments for running the tests you can executetest-projects/make-virtual-environments. To run the tests executeruntests.
Package: django-asyncapi
django-asyncapiGenerate and host your asyncapi specification using pydantic modelsUsageCreate specificationfromasyncapi_container.asyncapi.spec.v3.infoimportInfofromasyncapi_container.containers.v3.simple_specimportSimpleSpecV3fromasyncapi_container.custom_typesimportRoutingMapfrompydanticimportBaseModel,FieldclassCustomer(BaseModel):first_name:str=Field(...,title='First Name')last_name:str=Field(...,title='Last Name')email:str=Field(...,title='Email')country:str=Field(...,title='Country')zipcode:str=Field(...,title='Zipcode')city:str=Field(...,title='City')street:str=Field(...,title='Street')apartment:str=Field(...,title='Apartment')classOrderSchemaV1(BaseModel):product_id:int=Field(...,title='Product Id')quantity:int=Field(...,title='Quantity')customer:CustomerclassMySpecialServiceAsyncAPISpecV3(SimpleSpecV3):info:Info=Info(title="My special Service",version="1.0.0",description="Service for making orders")sends:RoutingMap={"shop.orders.v1":[OrderSchemaV1,]}receives:RoutingMap={}Adddjanog-asyncapito `INSTALLED_APPSINSTALLED_APPS=[...,"django_asyncapi",]Setup configuration insidesettings.pyDJANGO_ASYNCAPI={"ASYNCAPI_SPEC_CLASS":"bus.routing.MySpecialServiceAsyncAPISpecV3",}Adddjango-asyncapiurlsfromdjango.urlsimportpath,includeurlpatterns=[path('docs/',include('django_asyncapi.urls')),]Enjoy your result
Package: django-async-email
TODOEnviar todas as mensagens que levantem TemplateDoesNotExist para uma fila apropriadadjango-async-emailEMAILS_TEMPLATES={"welcome":{"subject":"welcome/subject.txt","body_html":"welcome/body.html","body_txt":"welcome/body.txt",}}# Customize the max_retries for one specific email category taskASYNC_EMAIL_TASKS={"async_email.tasks.welcome":{"max_retries":20}}# Customize the max_retries for all the tasks# Default is 20ASYNC_EMAIL_TASKS_MAX_RETRIES=10ASYNC_EMAIL_TASKS_MAX_RETRIES=10Important notespython setup.py sdist bdist_wheel && pip uninstall -y django_async_email && python -m pip install dist/django_async_email-0.1.0-py2.py3-none-any.whlDemo projectcddemo_project# Build and run the docker imagedocker-composebuild&&docker-composeup-ddemo_project# Run migrationsdocker-composeexecdemo_projectpythonmanage.pymigrate# Create the superuserdocker-composeexecdemo_projectpythonmanage.pycreatesuperuserceleryworker--app=demo_project.celery-linfo--pool=eventlet
Package: django-asyncmailer
Home-page: https://github.com/andyfangdz/django-asyncmailerAuthor: Dezhi “Andy” FangAuthor-email: andyfang.dz@gmail.comLicense: The MIT LicenseDescription-Content-Type: UNKNOWNDescription: Django AsyncMailer============.. image:: https://travis-ci.org/andyfangdz/django-asyncmailer.svg?branch=master:target: https://travis-ci.org/andyfangdz/django-asyncmailerAsync email solution w/ multiple SMTP credentials, load-balancing and blacklist.Installation------------To get the latest stable release from PyPi.. code-block:: bashpip install django-asyncmailerTo get the latest commit from GitHub.. code-block:: bashpip install -e git+git://github.com/andyfangdz/django-asyncmailer.git#egg=asyncmailerTODO: Describe further installation steps (edit / remove the examples below):Add ``asyncmailer`` to your ``INSTALLED_APPS``.. code-block:: pythonINSTALLED_APPS = (...,'asyncmailer',)Add the ``asyncmailer`` URLs to your ``urls.py``.. code-block:: pythonurlpatterns = [url(r'^asyncmailer/', include('asyncmailer.urls')),]Before your tags/filters are available in your templates, load them by using.. code-block:: html{% load asyncmailer_tags %}Don't forget to migrate your database.. code-block:: bash./manage.py migrate asyncmailerUsage-----TODO: Describe usage or point to docs. Also describe available settings andtemplatetags.Contribute----------If you want to contribute to this project, please perform the following steps.. code-block:: bash# Fork this repository# Clone your fork# Install virtualenvwrapper if you haven't:# sudo pip install virtualenvwrapper# Edit .bashrc/.zshrc according to:# http://virtualenvwrapper.readthedocs.io/en/latest/install.html#shell-startup-filemkvirtualenv -p python2.7 django-asyncmailermake develop# Make your feature branchgit co -b feature_branch master# You can initiate the database and preview the app in the browser# Django < 1.8:./manage.py syncdb --all./manage.py migrate --fake# Django >= 1.8:./manage.py migrate./manage.py runserver# Implement your feature and testsgit add . && git commitgit push -u origin feature_branch# Send us a pull request for your feature branchIn order to run the tests, simply execute ``tox``. This will install two newenvironments (for Django 1.8 and Django 1.9) and run the tests against bothenvironments.Keywords: django,async,emailPlatform: OS Independent
Package: django-async-orm
Disclaimer: Don't use this module in production it's still in active development.Django Async OrmDjango module that brings async to django ORM.Installingpython -m pip install django-async-ormthen adddjango_async_ormto yourINSTALLED_APPSlist:INSTALLED_APPS=[...,'django_async_orm']UsageDjango Async Orm will patch all your existing models to addasync_*prefixed methods.
To beexample:classMyModel(models.Model):name=models.CharField(max_length=250)you can use it as follow:asyncdefget_model():returnawaitMyModel.objects.async_get(name="something")you can also iterate over a query set withasync for:asyncdefall_models():all_result_set=awaitMyModel.objects.async_all()asyncforobjinall_result_set:print(obj)Some wrappers are also available for template rendering, form validation and login/logoutAsync loginfromdjango_async_orm.wrappersimportasync_loginasyncdefmy_async_view(request):awaitasync_login(request)...Form validationfromdjango_async_orm.wrappersimportasync_form_is_validasyncdefa_view(request):form=MyForm(request.POST)is_valid_form=awaitasync_form_is_valid(form)ifis_valid_form:...Django ORM support:This is an on going projects, not all model methods are ported.Manager:methodssupportedcommentsModel.objects.async_get✅Model.objects.async_create✅Model.objects.async_count✅Model.objects.async_none✅Model.objects.async_bulk_create✅Model.objects.async_bulk_update✅Model.objects.async_get_or_create✅Model.objects.async_update_or_create✅Model.objects.async_earliest✅Model.objects.async_latest✅Model.objects.async_first✅Model.objects.async_last✅Model.objects.async_in_bulk✅Model.objects.async_delete✅Model.objects.async_update✅Model.objects.async_exists✅Model.objects.async_explain✅Model.objects.async_raw✅Model.objects.async_all✅Model.objects.async_filter✅Model.objects.async_exclude✅Model.objects.async_complex_filter✅Model.objects.async_union✅Model.objects.async_intersection✅Model.objects.async_difference✅Model.objects.async_select_for_update✅Model.objects.async_prefetch_related✅Model.objects.async_annotate✅Model.objects.async_order_by✅Model.objects.async_distinct✅Model.objects.async_difference✅Model.objects.async_extra✅Model.objects.async_reverse✅Model.objects.async_defer✅Model.objects.async_only✅Model.objects.async_using✅Model.objects.async_resolve_expression✅Model.objects.async_ordered✅__aiter__✅__repr__✅__len__✅__getitem__✅Model.objects.async_iterator❌RawQuerySetNot supported ❌You can still callModel.object.async_raw()but you will be unable to access the results.Model:methodssupportedcommentsModel.async_save❌Model.async_update❌Model.async_delete❌...❌User Model / ManagermethodssupportedcommentsUserModel.is_authenticated✅UserModel.is_super_user✅UserModel.objects.async_create_user❌...❌Foreign object lazy loading:Not supported ❌Wrappers:methodssupportedcommentswrappers.async_render✅wrappers.async_login✅wrappers.async_logout✅
Package: django-async-reports
Let you build asynchronous report using any kind of engines like Django ORM or HTSQL.Report creationclass MyReport(HTSQLReport):encoding = “latin-1”
query = “/school”
delimiter = “;”
connexion = “sqlite:htsql_demo.sqlite”encodingCSV file encodingqueryHTSQL querydelimiterCSV delimiterconnexionHTSQL connexion. Can be defined sitewise with parameter HTSQL_CONNEXION
Package: django-async-sse
Django Async Server Sent Events HelpersHelpers to make Server Sent Events in Django easier and async.SSE ReferenceSee:https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_eventsInstallpip install django-async-sseSetupWrite an Event StreamSseStreamViewis a class-based view. Add an asyncstreammethod that usesyieldto send events. Otherwise known as an async iterator.Example SSE View:importasynciofromdjango_asseimportSseStreamView,JsonEventclassWeatherStream(SseStreamView):asyncdefstream(self,request,lat,lng):last_update=Nonewhile1:wp=awaitWeatherPoint.objects.filter(point=f"{lat},{lng}").afirst()ifwpandwp.created!=last_update:event=JsonEvent(event='weather',data=wp.weather_data['current'])last_update=wp.created# yield an event to send ityieldevent# always send a ping to keep connection from timing out# Note: needed for some deployments like HerokuyieldJsonEvent(event='ping',data=None)awaitasyncio.sleep(30)Connect View to a URLurlpatterns=[...re_path(r"weather/(-?\d{1,3}.\d{2}),(-?\d{1,3}.\d{2})/",WeatherStream.as_view()),]Run an ASGI serverpip install uvicorn[standard]
uvicorn myproject.asgi:application --loop uvloopIncluded HelpersEvent: Event where data are strings.JsonEvent: Event where data is encoded as JSON.SseStreamView: Class-based view to generate an async streaming response. Inherit from this class and add an asyncstreammethod that is an async iterator.
Package: django-async-stream
Django-Async-StreamDjango extension that allow using asynchronous generators in StreamingHttpResponseUsagedjango-async-stream providesAsyncStreamingHttpResponseclass, that you can use instead ofStreamingHttpResponseButfor this to work, you need to override one method in the ASGIHandler.asgi.py, one of the possible options# django default file contentimportosfromdjango.core.asgiimportget_asgi_applicationos.environ.setdefault('DJANGO_SETTINGS_MODULE','projectname.settings')application=get_asgi_application()#  PATCH BELOWimportdjango_async_streamdjango_async_stream.patch_application(application)views.pyimportasynciofromdjango_async_streamimportAsyncStreamingHttpResponseasyncdefmy_view(request):returnAsyncStreamingHttpResponse(_my_async_generator())asyncdef_my_async_generator():foriinrange(10):yieldiawaitasyncio.sleep(2)Installationpip install django-async-stream