<commit_before>Django User Clipboard
=====================

This app returns to user JSONs from uploaded file/image.

This app is connected with django user model.

This app needs :code:`django-imagekit`

SetUp
-----

Install the app:
::

    pip install git+https://github.com/IndustriaTech/django-user-clipboard.git

You should have these in installed apps:
::

    INSTALLED_APPS = (
        ....

        'imagekit',
    	'user_clipboard',
    )

Add the urls in your main :code:`urls.py` file:
::

    url(r'^clipboard/', include('user_clipboard.urls')),

You can configure defaut values with theese settings:
::

	CLIPBOARD_IMAGE_WIDTH = 100
	CLIPBOARD_IMAGE_HEIGHT = 100
	CLIPBOARD_THUMBNAIL_QUALITY = 80

And finally you can run the migrations:
::

    python manage.py migrate<commit_msg>Update documentation about cleaning expired files<commit_after>Django User Clipboard
=====================

This app returns to user JSONs from uploaded file/image.

This app is connected with django user model.

This app needs :code:`django-imagekit`

SetUp
-----

Install the app:
::

    pip install git+https://github.com/IndustriaTech/django-user-clipboard.git

You should have these in installed apps:
::

    INSTALLED_APPS = (
        ....

        'imagekit',
    	'user_clipboard',
    )

Add the urls in your main :code:`urls.py` file:
::

    url(r'^clipboard/', include('user_clipboard.urls')),

You can configure defaut values with theese settings:
::

	CLIPBOARD_IMAGE_WIDTH = 100
	CLIPBOARD_IMAGE_HEIGHT = 100
	CLIPBOARD_THUMBNAIL_QUALITY = 80

And finally you can run the migrations:
::

    python manage.py migrate

In order to clear old objects from the storage you need to periodically clear the storage.
You can achieve that by executing:
::

    python manage.py clear_clipboard

By default all files older than one hour are deleted. You can configure the time by setting:
::

    CLIPBOARD_EXPIRATION_TIME = 60 * 60

Programatically you can delete these in your python code by calling:
::

    Clipboard.objects.expired().delete()

You need to configre cron or celery or something else to clear the storage periodically.
{'fraction_non_alphanumeric': 0.10088743577767398, 'fraction_numerical': 0.009341429238673517, 'mean_word_length': 3.728476821192053, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, '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': '161878', 'n_tokens_mistral': 697, 'n_tokens_neox': 639, 'n_words': 226}