<commit_before>Django Google Credentials
=========================

Stores Google OAuth credentials in DJango ORM for easy API service access.

Installation:
-------------
#. Install or add `django-google-credentials` to your Python path.

#. Add `google_credentials` to your ``INSTALLED_APPS`` setting.

#. Add `google_credentials` URL include to your project's `urls.py` file::
    
    url(r'^google-credentials/', include('google_credentials.urls')),

#. Create your project on the `Google API Console <https://code.google.com/apis/console>`_, specifying the redirect URL as `http://your.domain.com/google-credentials/callback` (or however you setup your `urls.py` as described above).

#. Add the following settings to your project's `settings.py` file 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'

#. Run `syncdb` to generate required models.

Usage
-----
    
Before you can start using a service you have to authorize it with your Google account. To do this open `http://your.domain.com/google-credentials/callback <http://your.domain.com/google-credentials/authorize>`_ in your browser. Once authorized you can retrive a service for further querying like so::

    from google_credentials import utils

    service = utils.get_service()

To purge previously generated credentials open `http://your.domain.com/google-credentials/purge <http://your.domain.com/google-credentials/purge>`_ in your browser.

<commit_msg>copy update<commit_after>Django Google Credentials
=========================

Stores Google OAuth credentials in DJango ORM for easy API service access.

Installation:
-------------
#. Install or add ``django-google-credentials`` to your Python path.

#. Add ``google_credentials`` to your ``INSTALLED_APPS`` setting.

#. Add ``google_credentials`` URL include to your project's ``urls.py`` file::
    
    url(r'^google-credentials/', include('google_credentials.urls')),

#. Create your project on the `Google API Console <https://code.google.com/apis/console>`_, specifying the redirect URL as `http://your.domain.com/google-credentials/callback` (or however you setup your ``urls.py`` as described above).

#. Add the following settings to your project's ``settings.py`` file populated with values as retrieved from Google in the previous step, i.e.::
   
    GA_CLIENT_ID = '32749234234.apps.googleusercontent.com'
    GA_CLIENT_SECRET = '<KEY>'
    GA_SCOPE = 'https://www.googleapis.com/auth/analytics.readonly'
    GA_REDIRECT_URI = 'http://your.domain.com/google-credentials/callback'

#. Run ``syncdb`` to generate required models.

Usage
-----
    
Before you can start using a service you have to authorize it with your Google account. To do this open `http://your.domain.com/google-credentials/callback <http://your.domain.com/google-credentials/authorize>`_ in your browser. Once authorized you can retrive a service for further querying like so::

    from google_credentials import utils

    service = utils.get_service()

To purge previously generated credentials open `http://your.domain.com/google-credentials/purge <http://your.domain.com/google-credentials/purge>`_ in your browser.


{'fraction_non_alphanumeric': 0.13009082918253737, 'fraction_numerical': 0.007617931438617052, 'mean_word_length': 4.252307692307692, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3244118', 'n_tokens_mistral': 1022, 'n_tokens_neox': 968, 'n_words': 311}