Saravanan666/pypi-org huggingface dataset:
Package: django-googleauth
Simplified OAuth + OpenID Connect for authentication via Google.googleauth used to be REALLY simple, but then Google decided to get rid of their OpenID service. Boooo Google. googleauth has been migrated toOAuth 2.0 + OpenID Connect, which isn’t quite as great because it takes a bit more configuration to get going.googleauth was built to provide an easy way to add authentication against a Google Apps for Business domain, ideally for an individual organization. This package is not the best option if you are looking for a general social auth solution. Check outpython-social-authinstead.Getting things set up on GoogleLog in to theGoogle API Console.Open an existing project or create a new one if needed.Under theAPIS & AUTHmenu item, clickAPIs.Turn on the Google+ API.Under theAPIS & AUTHmenu item, clickCredentials.Click theCreate new Client IDbutton.SelectWeb applicationfor application type, add your domain as the JavaScript origin, and add the full domain and path to the OAuth callback (see below for how to find this URL). Click theCreate Client IDbutton to finish.You’re going to need the Client ID and Client secret values in Django settings, so keep this window open or copy them for later.Callback URLThe callback URL is constructed from your preferred URL scheme, the domain at which your site is hosted, and the path where you mount the googleauth URL config in Django.Let’s assume you are using HTTPS and have mounted the googleauth URL config at the root URL. Your callback URL would look something like:https://<your-domain>/callback/Okay, now let’s assume you are using HTTP and have mounted the googleauth URL config under/accounts/:http://<your-domain>/accounts/callback/Django SetupSettings and configurationThe following settings should be placed insettings.py.Add toINSTALLED_APPS:INSTALLED_APPS = (
    ...
    'googleauth',
    ...
)Add toAUTHENTICATION_BACKENDS:AUTHENTICATION_BACKENDS = (
    'googleauth.backends.GoogleAuthBackend',
    ...
)Required settings:# client ID from the Google Developer Console
GOOGLEAUTH_CLIENT_ID = ''

# client secret from the Google Developer Console
GOOGLEAUTH_CLIENT_SECRET = ''

# your app's domain, used to construct callback URLs
GOOGLEAUTH_CALLBACK_DOMAIN = ''Optional settings:# callback URL uses HTTPS (your side, not Google), default True
GOOGLEAUTH_USE_HTTPS = True

# restrict to the given Google Apps domain, default None
GOOGLEAUTH_APPS_DOMAIN = ''

# get user's name, default True (extra HTTP request)
GOOGLEAUTH_GET_PROFILE = True

# sets value of user.is_staff for new users, default False
GOOGLEAUTH_IS_STAFF = False

# list of default group names to assign to new users
GOOGLEAUTH_GROUPS = []URL routesAdd URL config:urlpatterns = patterns('',
    ...
    (r'^auth/', include('googleauth.urls')),
    ...
)googleauth doesn’t need to be mounted under/auth/, it can go anywhere. Place it where you see fit for your specific app.
Package: django-google-auth
django-google-auth==================A google auth authenticator backend for django and django rest framework.This backend will validate the user's access token against google in every request, so that when a user has it's email removed from the domain for example, it will lose access instantly.### Installation```pip install django-google-auth```Add google_auth to your INSTALLED_APPS```INSTALLED_APPS = (...'google_auth',)```Include auth urls to your urls.py```urlpatterns = patterns(...(r'^google_auth/', include('google_auth.urls')),)```Include google_auth.authentication.GoogleAuthBackend to AUTHENTICATION_BACKENDS```AUTHENTICATION_BACKENDS = (..."google_auth.authentication.GoogleAuthBackend",)```### SettingsThe settings of this app are:- GOOGLE_AUTH_CLIENT_IDthe client id of your google app- GOOGLE_AUTH_CLIENT_SECRETthe client secret of your google app- GOOGLE_AUTH_AUTHORIZED_DOMAINSthe email domains that are authorized to use your app (defaults to gmail.com)- GOOGLE_AUTH_SCOPEthe scope of the authorization (defaults to "email profile")- GOOGLE_AUTH_REDIRECT_URLthe redirect url after google authorization, must change it to some endpoint that contains some business logic of yours (defaults to "localhost:8000")all of them must be set.### Flow to authenticatee.g. (assuming that urls are mounted as in the example above)```$ curl localhost:8000/auth/code_urlhttps://accounts.google.com/o/oauth2/v2/auth?client_id=xxxx&redirect_uri=http%3A%2F%2Fwww.127.0.0.1.xip.io%3A8000%2Fauth%2Fcomplete%2F&scope=email+profile&access_type=offline&response_type=code```User access the url from a browser and complete the login @ google, GOOGLE_AUTH_REDIRECT_URL will be called, containing the code:e.g.```GOOGLE_AUTH_REDIRECT_URL/?code=xxxxxxxxx#```Code should then be exchanged by an app token (this will also create a Django User and register google auth and refresh token in the database for further use authenticating every request against google)```curl -X POST "localhost:5000/google_auth/authenticate/?code=xxxxxxxxx"{"token": "xxxxxxxxx-xxxxxxxxxxxxxx-xxxxxxxxxxxxxxx", "email": "me@felipejfc.com"}```### Authenticating requestsAfter completing the above flow, to authenticate an user's request, set an Authorization header```Authorization: token xxxxxxxxxx-xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxx```##### Rest FrameworkFor django rest framework, add google_auth.authentication.GoogleAuthAuthentication to REST_FRAMEWORK.DEFAULT_AUTHENTICATOR_CLASSES```'DEFAULT_AUTHENTICATION_CLASSES': (...google_auth.authentication.GoogleAuthAuthentication,),```
Package: django-google-auth2
=====django-google-auth=====django-google-auth project is demo application for codingsohoDetailed documentation is in the "docs" directory.Quick start-----------# googleauth1. 安装 django-google-auth2```pip3 install django-google-auth2```2. 添加 django_google_auth2 到app```INSTALLED_APPS = [...'django_google_auth2',]```3. 绑定google令牌```from django_google_auth2.google.bindgoogleauth.bindgoogleauth import bind_google_authbind_google_auth(user)```**函数参数：**|参数名|必选|类型|说明||:----    |:---|:----- |-----   ||user |是  |string | 用户名 Or 邮箱   |**返回参数说明**|参数名|类型|说明||:-----  |:-----|-----                           ||success |bool   | True/False ||data |string   | google令牌字符串(用于生成二维码) |4. 解绑google令牌```from django_google_auth2.google.deletegoogleauth.deletegoogleauth import delete_google_authdelete_google_auth(user)```**函数参数：**|参数名|必选|类型|说明||:----    |:---|:----- |-----   ||user |是  |string | 用户名 Or 邮箱   |**返回参数说明**|参数名|类型|说明||:-----  |:-----|-----||success |bool   | True/False ||data |string   | 删除成功 |5. 验证google令牌```from django_google_auth2.google.checkgoogleauth.checkgoogleauth import check_google_authcheck_google_auth(user,code)```**函数参数：**|参数名|必选|类型|说明||:----    |:---|:----- |-----   ||user |是  |string | 用户名 Or 邮箱   ||code |是  |string | 客户端动态码    |**返回参数说明**|参数名|类型|说明||:-----  |:-----|-----||success |bool   | True/False |6. 绑定google令牌Api接口urls.py```from django_google_auth2.google.bindgoogleauth.bindgoogleauthapi import bind_google_auth_apiurlpatterns = [...path('bing-google-auth-api/', bind_google_auth_api),]```**请求方式：**- POST**请求示例**```{"user":"cox"}```**函数参数：**|参数名|必选|类型|说明||:----    |:---|:----- |-----   ||user |是  |string | 用户名 Or 邮箱   |**返回**![20190402192923-image.png](https://raw.githubusercontent.com/Coxhuang/yosoro/master/20190402192923-image.png)7. 客户端(二选一)> 安卓AppGoogle令牌+扫码器(如果手机只安装Google令牌App扫码失败,请安装扫码器)链接：https://pan.baidu.com/s/1XeO7p4IvNuvzQOiZrq4wtw提取码：e70f> Chrome插件https://chrome.google.com/webstore/detail/authenticator/bhghoamapcdpbohphigoooaddinpkbai
Package: django-googleauth-ng
Simplified OAuth + OpenID Connect for authentication via Google.googleauth used to be REALLY simple, but then Google decided to get rid of their OpenID service. Boooo Google. googleauth has been migrated toOAuth 2.0 + OpenID Connect, which isn’t quite as great because it takes a bit more configuration to get going.googleauth was built to provide an easy way to add authentication against a Google Apps for Business domain, ideally for an individual organization. This package is not the best option if you are looking for a general social auth solution. Check outpython-social-authinstead.Getting things set up on GoogleLog in to theGoogle API Console.Open an existing project or create a new one if needed.Under theAPIS & AUTHmenu item, clickAPIs.Turn on the Google+ API.Under theAPIS & AUTHmenu item, clickCredentials.Click theCreate new Client IDbutton.SelectWeb applicationfor application type, add your domain as the JavaScript origin, and add the full domain and path to the OAuth callback (see below for how to find this URL). Click theCreate Client IDbutton to finish.You’re going to need the Client ID and Client secret values in Django settings, so keep this window open or copy them for later.Callback URLThe callback URL is constructed from your preferred URL scheme, the domain at which your site is hosted, and the path where you mount the googleauth URL config in Django.Let’s assume you are using HTTPS and have mounted the googleauth URL config at the root URL. Your callback URL would look something like:https://<your-domain>/callback/Okay, now let’s assume you are using HTTP and have mounted the googleauth URL config under/accounts/:http://<your-domain>/accounts/callback/Django SetupSettings and configurationThe following settings should be placed insettings.py.Add toINSTALLED_APPS:INSTALLED_APPS = (
    ...
    'googleauth',
    ...
)Add toAUTHENTICATION_BACKENDS:AUTHENTICATION_BACKENDS = (
    'googleauth.backends.GoogleAuthBackend',
    ...
)Required settings:# client ID from the Google Developer Console
GOOGLEAUTH_CLIENT_ID = ''

# client secret from the Google Developer Console
GOOGLEAUTH_CLIENT_SECRET = ''

# your app's domain, used to construct callback URLs
GOOGLEAUTH_CALLBACK_DOMAIN = ''Optional settings:# callback URL uses HTTPS (your side, not Google), default True
GOOGLEAUTH_USE_HTTPS = True

# restrict to the given Google Apps domain, default None
GOOGLEAUTH_APPS_DOMAIN = ''

# get user's name, default True (extra HTTP request)
GOOGLEAUTH_GET_PROFILE = True

# sets value of user.is_staff for new users, default False
GOOGLEAUTH_IS_STAFF = False

# list of default group names to assign to new users
GOOGLEAUTH_GROUPS = []URL routesAdd URL config:urlpatterns = patterns('',
    ...
    (r'^auth/', include('googleauth.urls')),
    ...
)googleauth doesn’t need to be mounted under/auth/, it can go anywhere. Place it where you see fit for your specific app.
Package: django-google-bazaar-payment
Google Play and Bazaar in-app purchaseThis Django app created to check the response token that is taken from Google Play or Bazaar is valid or not. and choice with the method you want to confirm your purchase with that.STEP 1Installpip install django-google-bazaar-paymentpip install requestsAdd "google_bazaar_payment" to your INSTALLED_APPS setting like this:INSTALLED_APPS=[...'google_bazaar_payment',]Runpython manage.py migrateto create the google_bazaar_payment modelsSTEP 2Google Play  Implementationyou must addGOOGLE_BUNDLE_IDto your project settings like this:GOOGLE_BUNDLE_ID="com.package.android"Go to Django admin panel and in the payment section add a new record with information that you got from this link:AuthorizationSet the field type in the record you created toGoogle Playinit token in record is the first token and initializer token that you took from the top link and this will use just one time .STEP 3For Bazaar UsersBazaar Implementationyou must addBAZAAR_BUNDLE_IDto your project settings like this:BAZAAR_BUNDLE_ID="com.package.android"Go to Django admin panel and in the payment section add a new record with information that you got from this link :AuthorizationSet the field type in the record you created toBazaarinit token in record is the first token and initializer token that you took from the top link and this will use just one time. .STEP 4 How to usefromgoogle_bazaar_payment.payment.google_bazaar_paymentimportGBPaymentresult=GBPayment.check_purchased_token(token="token that you received from server",product_id="product_id",type=0)# type = 0 google play# type = 1 Bazaarifresult:print("token is valid")else:print("token is not valid OR there is an error if you get error you will see it in logs")Copyright 2020 MiladNalbandi

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Package: django-googlecharts
This is a suite of template tags to assist in generating charts using Google’sChart API. There’s deliberately no Python-level API; trypygooglechartfor that.Currently the library is long on code, and short on testing and documentation.
It’s only been tested against Django 1.1 and Python 2.5.For example usage, seedocs/examples.html.ContributingThe source is on GitHub:http://github.com/jacobian/django-googlecharts. Feel
free to send me pull requests, or send patches to <jacob@jacobian.org>.
Package: django-google-cloud-storage
Google Cloud Storage file backend for DjangoIf you run your projects on Google’s appengine and you are using the django framework you might need this
file backend since there is no way to upload files, images, etc on appengine. Although solutions exist for
the amazon cloud storage i have not found a file backend for google cloud storage. This backend does work
with google cloud storage, although in early development. I have used it with regular file uploads and with
file manager solutions such as django-filer. The code as it is right now stores files for public use (i.e. a web site’s images)PrerequisitesYou need to have an appengine project. This will not work as a standalone solution for non appengine django projects, since there is no authentication mechanism with the google cloud storage implemented.### If you want to copy the files into your repository.You need to install the GCS client library fromhttps://developers.google.com/appengine/docs/python/googlecloudstorageclient/download.Just runpip install GoogleAppEngineCloudStorageClient -t <your_app_directory/lib>, or optionally, unzip the file and copy thesrc/cloudstoragefolder into your project directory.Installation` pip installdjango-google-cloud-storage`Or Just copy the google folder in your project directoryConfigurationOn your django settings.py file you need to add the following settingsGOOGLE_CLOUD_STORAGE_BUCKET = ‘/your_bucket_name’ # the name of the bucket you have created from the google cloud storage console
GOOGLE_CLOUD_STORAGE_URL = ‘http://storage.googleapis.com/bucket’ #whatever the ulr for accessing your cloud storgage bucket
GOOGLE_CLOUD_STORAGE_DEFAULT_CACHE_CONTROL = ‘public, max-age: 7200’ # default cache control headers for your filesAnd finally declare the file storage backend you will use on your settings.py fileDEFAULT_FILE_STORAGE = ‘django_google_cloud_storage.GoogleCloudStorage’CreditsChristos Kopanos (@ckopanos) - source code
Richard Caceres (@rchrd2) - packaging into python module
Package: django-googlecloud-storage
django-googlecloud-storageGoogle Cloud Storage file backend for DjangoBased on an django-google-cloud-storage but now made simpler because it uses the python
google-cloud package.If you run your projects on Google’s appengine and you are using the django framework you might need this
file backend since there is no way to upload files, images, etc on appengine. The other solution is using
django-storages and apache libcloud but that soon descended into a debugging rabbit hole.PrerequisitesThis version works with the google-cloud package from google. It is listed as a dependency.Installationpip install django-googlecloud-storageConfigurationOn your django settings.py file you need to add the following settings:GOOGLE_CLOUD_STORAGE_PROJECT = ‘<name-of-project>’
GOOGLE_CLOUD_STORAGE_BUCKET = ‘<name-of-bucket>’
DEFAULT_FILE_STORAGE = ‘django.googlecloud.storage.GoogleCloudStorage’
MEDIA_URL = “https://storage.googleapis.com/<name-of-bucket>/”CreditsIn historical order:Christos Kopanos (@ckopanos) - original work using an older version of the google client libs
Richard Caceres (@rchrd2) - packaged the original into python module
Suresh V(@sureshvv) - used the new google-cloud package and namespace packagesChangelog0.0.1 (2016-11-07)Initial version
Package: django-google-credentials
Stores Google OAuth credentials in Django ORM for easy API service access.Installation:Install or adddjango-google-credentialsto your Python path.Addgoogle_credentialsto yourINSTALLED_APPSsetting.Addgoogle_credentialsURL include to your project’surls.pyfile:url(r'^google-credentials/', include('google_credentials.urls')),Create your project on theGoogle API Console, specifying the redirect URL ashttp://your.domain.com/google-credentials/callback(or however you setup yoururls.pyas described above).Add the following settings to your project’ssettings.pyfile populated with values as retrieved from Google in the previous step, i.e.:GA_CLIENT_ID = '32749234234.apps.googleusercontent.com'
GA_CLIENT_SECRET = 'DKSFY87sd6fHJGdsf6'
GA_SCOPE = 'https://www.googleapis.com/auth/analytics.readonly'
GA_REDIRECT_URI = 'http://your.domain.com/google-credentials/callback'Runsyncdbto generate required models.UsageBefore you can start using a service you have to authorize it with your Google account. To do this openhttp://your.domain.com/google-credentials/authorizein your browser.Once authorized you can retrieve a service for further querying like so:from google_credentials import utils

service = utils.get_service()To purge previously generated credentials openhttp://your.domain.com/google-credentials/purgein your browser.
Package: django-google-dfp
Django Google DFP=======================Django Google DFP provides template tags for inserting [Google DFP](http://www.google.com/dfp) ad tags.Installation------------Run `pip install django-google-dfp`Add `google_dpf` to your `INSTALLED_APPS` setting:```pythonINSTALLED_APPS = (...'google_dfp',)```Template Tags-------------###ad_headerInserts the JavaScript for serving Google DFP ads.*This must go inside the head*###ad_tagInserts the code where the ad will display. It takes an ad unit as an argument. I needs to be in the format `[identifier]_[width]x[height]`.```html{% load dfp_tags %}<html><head><title>My Site</title>{% ad_header %}</head><body><h1>My Site</h1>{% ad_tag 'MYSITE_728x90' %}<p>My site's content.</p>{% ad_tag 'MYSITE_300x200' %}</body></html>```
Package: django-google-dork
StatusThis is highly experimental, unfinished, work in progress.If you’re looking for something you can use, they try again later…The reason I’m publishing packages and documentation publically is because this is part of my continuous integration system.As soon as the code is usable and has sufficient features, I will publish it as version 1.0.Anything with a version lower than 1.0 is not guarented to work as the documentation said, althrough I will published only version of the code that pass the build and the tests steps.Documentation[Read the docs &rarr;](https://django-google-dork.readthedocs.org)
Package: django-googledrive-storage
This is aDjango Storageimplementation that usesGoogle Driveas backend for storing data.Quick startInstallationpipinstalldjango-googledrive-storageSetupINSTALLED_APPS=(...,'django.contrib.staticfiles','gdstorage')Set the environment variableGOOGLE_DRIVE_STORAGE_JSON_KEY_FILE_CONTENTSor path file in thesettings.py:GOOGLE_DRIVE_STORAGE_JSON_KEY_FILE.Optional setGOOGLE_DRIVE_STORAGE_MEDIA_ROOTin thesettings.pyUsage examplefromgdstorage.storageimportGoogleDriveStorage# Define Google Drive Storagegd_storage=GoogleDriveStorage()...classMap(models.Model):id=models.AutoField(primary_key=True)map_name=models.CharField(max_length=200)map_data=models.FileField(upload_to='maps',storage=gd_storage)Documentation and Installation instructionsDocumentation and installation instructions can be found atRead The Docs.
Package: django-google-json-style-api
Django Google JSON Style APIImplementation of Google JSON Style Guide for DjangoInstallpip install django-google-json-style-apiExample# models.py

from django.db import models


class City(models.Model):
    city_name = models.TextField()

# schemas.py

from typing import List

from pydantic import BaseModel

from django_google_json_style_api.base import CamelModel
from django_google_json_style_api.responses import BaseResponseData, BaseSuccessResponse


class AddCityRequest(CamelModel):
    city_name: str


class AddCitiesRequest(BaseModel):
    cities: List[AddCityRequest]


class CityDataItem(CamelModel):
    id: int
    city_name: str


class CityResponseData(BaseResponseData[CityDataItem]):
    ...


class CityResponse(BaseSuccessResponse[CityResponseData]):
    __kind__ = "City"

# urls.py

from django.urls import path
from django.views.decorators import csrf

from . import views

urlpatterns = [
    path(
        "add/",
        csrf.csrf_exempt(views.AddCitiesView.as_view()),
        name="add-cities",
    ),
]


# views.py

from django_google_json_style_api.decorators import process_json_response

from django.utils.decorators import method_decorator
from django.views import View

from .models import City
from .schemas import AddCitiesRequest, CityResponse, CityDataItem


@method_decorator(process_json_response(api_version='1.1'), name="dispatch")
class AddCitiesView(View):
    def post(self, request):
        cities = AddCitiesRequest.parse_raw(request.body).cities
        response_items = []
        for add_city_request in cities:
            city = City.objects.create(**add_city_request.dict())
            city_data_item = CityDataItem(
                id=city.id,
                city_name=city.city_name
            )
            response_items.append(city_data_item)
        return CityResponse.make_from(
            request,
            total_items=City.objects.count(),
            items=response_items,
        )

# tests.py

from django.test import TestCase
from django.urls import reverse


class TestCities(TestCase):

    def test_add_cities(self):
        url = reverse('add-cities')
        data = {
            "cities": [
                {"cityName": "Tyumen"},
                {"cityName": "Moscow"},
            ]
        }
        response = self.client.post(url, data, content_type="application/json")
        response_json = response.json()
        self.assertDictEqual(
            response_json,
            {
                'apiVersion': '1.1',
                "data": {
                    'currentItemCount': 2,
                    "items": [
                        {
                            "id": 1,
                            "cityName": "Tyumen",
                        },
                        {
                            "id": 2,
                            "cityName": "Moscow",
                        },
                    ],
                    'itemsPerPage': 100,
                    'kind': 'City',
                    'startIndex': 0,
                    'totalItems': 2,
                },
            }
        )TODO:Docs, tests
Package: django-google-mailer
Django Google MailerDjango Google Mailer is a Django package which uses Gmail API to send emails to users as an administrator.Developingmake
. venv/bin/activate
make setup
make runTestingdjango-admin startproject mysite && cd mysite
python3 -m venv venv && . venv/bin/activate

pip install django
pip install ../django-google-mailer/dist/django-google-mailer-0.1.tar.gz

echo "urlpatterns += [path('gmailer/', include('gmailer.urls')),]" >> mysite/urls.py

python manage.py makemigrations && python manage.py migrate
python manage.py runserver localhost:8000