eox-tagging


Nameeox-tagging JSON
Version 9.0.0 PyPI version JSON
download
home_pageNone
Summaryeox-tagging
upload_time2024-12-27 18:25:19
maintainerNone
docs_urlNone
authoreduNEXT
requires_pythonNone
licenseAGPL
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ===========
EOX Tagging
===========
|Maintainance Badge| |Test Badge| |PyPI Badge|

.. |Maintainance Badge| image:: https://img.shields.io/badge/Status-Maintained-brightgreen
   :alt: Maintainance Status
.. |Test Badge| image:: https://img.shields.io/github/actions/workflow/status/edunext/eox-tagging/.github%2Fworkflows%2Ftests.yml?label=Test
   :alt: GitHub Actions Workflow Test Status
.. |PyPI Badge| image:: https://img.shields.io/pypi/v/eox-tagging?label=PyPI
   :alt: PyPI - Version

Eox-tagging is an `openedx plugin`_, part of the Edunext Open edX Extensions (aka EOX), that adds the capability
to tag `edx-platform`_ objects. These tags can be used to categorize, include extra information, and so on.

Installation
============

#. Add this plugin in your Tutor ``config.yml`` with the ``OPENEDX_EXTRA_PIP_REQUIREMENTS`` setting.

   .. code-block:: yaml
      
      OPENEDX_EXTRA_PIP_REQUIREMENTS:
         - eox-tagging=={{version}}
         
#. Save the configuration with ``tutor config save``.
#. Build the image and launch your platform with ``tutor local launch``.

Compatibility Notes
--------------------

+------------------+---------------+
| Open edX Release | Version       |
+==================+===============+
| Ironwood         | < 0.9 < 3.0   |
+------------------+---------------+
| Juniper          | >= 0.9 < 3.0  |
+------------------+---------------+
| Koa              | >= 2.2 < 5.0  |
+------------------+---------------+
| Lilac            | >= 2.2 < 5.0  |
+------------------+---------------+
| Maple            | >= 4.0 < 6.0  |
+------------------+---------------+
| Nutmeg           | >= 5.0 < 6.0  |
+------------------+---------------+
| Olive            | >= 5.0 < 6.0  |
+------------------+---------------+
| Palm             | >= 6.0 < 8.0  |
+------------------+---------------+
| Quince           | >= 7.0 < 9.0  |
+------------------+---------------+
| Redwood          | >= 7.2.0      |
+------------------+---------------+
| Sumac            | >= 9.0.0      |
+------------------+---------------+

The plugin is configured for the latest release (Sumac). The following changes in the plugin settings should be applied to be used for previous releases.
Those settings can be changed in `eox_tagging/settings/common.py`` or, for example, in the instance configurations.


🚨 If the release you are looking for is not listed, please note:

- If the Open edX release is compatible with the current eox-tagging version (see `Compatibility Notes <https://github.com/eduNEXT/eox-tagging?tab=readme-ov-file#compatibility-notes>`_), the default configuration is sufficient.
- If incompatible, you can refer to the README from the relevant version tag for configuration details (e.g., `v5.1.0 README <https://github.com/eduNEXT/eox-tagging/blob/v5.1.0/README.rst>`_).

Usage
======

See the `How to section <https://github.com/eduNEXT/eox-tagging/tree/master/docs/how_to>`_ for detailed guidance on model, configurations and API usage.

Important notes:
----------------

* All the comparisons with string objects are case insensitive.
* If a tag owner is not defined, then it is assumed to be the site.

Examples
--------

**Example 1:**

.. code-block:: JSON

        {
            "validate_tag_value": {
                "in": [
                    "example_tag_value",
                    "example_tag_value_1"
                ]
            },
            "validate_access": {
                "equals": "PRIVATE"
            },
            "validate_target_object": "OpaqueKeyProxyModel",
            "owner_object": "User",
            "tag_type": "tag_by_example"
        }

This means that:

* Tag value must be in the array
* The field access must be equal to `private`
* The target type must be equal to `CourseOverview`
* The owner type must be equal to `User`
* Tag_type must be equal to `tag_by_example`

**Example 2:**

.. code-block:: JSON

        {
            "validate_tag_value": {
                "exist": true
            },
            "validate_access": "Public",
            "validate_target_object": "User",
            "tag_type": "tag_by_edunext"
        }

This means that:

* The tag value must exist, it can take any value.
* The field access must be equal to `public`.
* The target type must be equal to `User`.
* Tag type must be equal to tag_by_edunext.

**Example 3:**

.. code-block:: JSON

        {
            "validate_tag_value": "tag_value",
            "validate_access": {
                "in": [
                    "Private",
                    "Public"
                ]
            },
            "validate_target_object": "CourseEnrollment",
            "tag_type": "tag_by_edunext",
            "validate_activation_date": {
                "exist": true,
                "in": [
                    "Dec 04 2020 10:30:40",
                    "Oct 19 2020 10:30:40"
                ]
            }
        }

This means that:

* The tag value must be equal to tag_value.
* The field access can be `private` or `public`.
* The target type must be equal to `CourseEnrollment`
* Tag type must be equal to tag_by_edunext.
* The tag activation date must exist between the values defined in the array. This means, value_1 <= activation_date <= value_2.
  The array must be sorted or a validation error will be raised.

Tagging REST API
================

Get a list of tags
------------------

**Request**

``curl -H 'Accept: application/json' -H "Authorization: Bearer AUTHENTICATION_TOKEN" http://BASE_URL_SITE/eox-tagging/api/v1/tags/``

**Response**

.. code-block:: JSON

        {
            "count": 2,
            "next": null,
            "previous": null,
            "results": [
                {
                    "meta": {
                        "created_at": "2020-07-10T13:25:54.057846Z",
                        "target_id": 2,
                        "target_type": "User",
                        "inactivated_at": null,
                        "owner_type": "User",
                        "owner_id": 7
                    },
                    "key": "55a20579-ce8e-4f0b-830e-78fe79adac46",
                    "tag_value": "tag_value",
                    "tag_type": "tag_by_edunext",
                    "access": "PUBLIC",
                    "activation_date": "2020-12-04T15:20:30Z",
                    "expiration_date": null,
                    "status": "ACTIVE"
                },
                {
                    "meta": {
                        "created_at": "2020-07-10T13:33:44.277374Z",
                        "target_id": 2,
                        "target_type": "User",
                        "inactivated_at": null,
                        "owner_type": "Site",
                        "owner_id": 1
                    },
                    "key": "2bec10f5-a9e0-4e42-9c24-f9643bb13537",
                    "tag_value": "tag_value",
                    "tag_type": "tag_by_edunext",
                    "access": "PUBLIC",
                    "activation_date": "2020-12-04T15:20:30Z",
                    "expiration_date": null,
                    "status": "ACTIVE"
                },
            ]
        }

Create tag
----------

**Request**

``curl -H 'Accept: application/json' -H "Authorization: Bearer AUTHENTICATION_TOKEN" --data TAG_DATA http://BASE_URL_SITE/eox-tagging/api/v1/tags/``

Where TAG_DATA:

.. code-block:: JSON

        {
            "tag_type": "tag_by_edunext",
            "tag_value": "tag_value",
            "target_type": "user",
            "target_id": "edx",
            "access": "public",
            "owner_type": "user",
            "activation_date": "2020-12-04 10:20:30"
        }


**Response**:

``Status 201 Created``

.. code-block:: JSON

        {
            "meta": {
                "created_at": "2020-07-10T13:25:54.057846Z",
                "target_id": 2,
                "target_type": "User",
                "inactivated_at": null,
                "owner_type": "User",
                "owner_id": 7
            },
            "key": "55a20579-ce8e-4f0b-830e-78fe79adac46",
            "tag_value": "tag_value",
            "tag_type": "tag_by_edunext",
            "access": "PUBLIC",
            "activation_date": "2020-12-04T10:20:30-05:00",
            "expiration_date": null,
            "status": "ACTIVE"
        }

Delete tag
----------

**Request**

``curl -X DELETE  http://BASE_URL_SITE/eox-tagging/api/v1/tags/EXISTING_KEY_TAG/``

**Response**

``Status 204 No Content``


Filters example usage:
----------------------

``/eox_tagging/api/v1/tags/?target_type=MODEL_TYPE``

``/eox_tagging/api/v1/tags/?course_id=COURSE_ID``

``/eox_tagging/api/v1/tags/?username=USERNAME``

``/eox_tagging/api/v1/tags/?access=ACCESS_TYPE``

``/eox_tagging/api/v1/tags/?enrollments=COURSE_ID``

Auditing Django views
=====================

The majority of views in eox-tagging use an auditing decorator, defined in our custom library called `eox-audit-model`_,
that helps save relevant information about non-idempotent operations. By default, this functionality is turned off, to enable it, install eox-audit-model. 

Check your auditing records in *Django sysadmin > DJANGO EDUNEXT AUDIT MODEL*.

For more information, check the eox-audit-model documentation.

.. _openedx plugin: https://github.com/openedx/edx-platform/tree/master/openedx/core/djangoapps/plugins
.. _edx-platform: https://github.com/openedx/edx-platform/
.. _eox-audit-model: https://github.com/eduNEXT/eox-audit-model/

How to Contribute
=================

Contributions are welcome! See our `CONTRIBUTING`_ file for more
information – it also contains guidelines for how to maintain high code
quality, which will make your contribution more likely to be accepted.

.. _CONTRIBUTING: https://github.com/eduNEXT/eox-tagging/blob/master/CONTRIBUTING.rst


License
=======

This project is licensed under the AGPL-3.0 License. See the LICENSE file for details.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "eox-tagging",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "eduNEXT",
    "author_email": "contact@edunext.co",
    "download_url": "https://files.pythonhosted.org/packages/30/9f/72857a19c9ef51d2f4d5a40345af5c106deacc1067ae99dd84db28293a1d/eox_tagging-9.0.0.tar.gz",
    "platform": null,
    "description": "===========\nEOX Tagging\n===========\n|Maintainance Badge| |Test Badge| |PyPI Badge|\n\n.. |Maintainance Badge| image:: https://img.shields.io/badge/Status-Maintained-brightgreen\n   :alt: Maintainance Status\n.. |Test Badge| image:: https://img.shields.io/github/actions/workflow/status/edunext/eox-tagging/.github%2Fworkflows%2Ftests.yml?label=Test\n   :alt: GitHub Actions Workflow Test Status\n.. |PyPI Badge| image:: https://img.shields.io/pypi/v/eox-tagging?label=PyPI\n   :alt: PyPI - Version\n\nEox-tagging is an `openedx plugin`_, part of the Edunext Open edX Extensions (aka EOX), that adds the capability\nto tag `edx-platform`_ objects. These tags can be used to categorize, include extra information, and so on.\n\nInstallation\n============\n\n#. Add this plugin in your Tutor ``config.yml`` with the ``OPENEDX_EXTRA_PIP_REQUIREMENTS`` setting.\n\n   .. code-block:: yaml\n      \n      OPENEDX_EXTRA_PIP_REQUIREMENTS:\n         - eox-tagging=={{version}}\n         \n#. Save the configuration with ``tutor config save``.\n#. Build the image and launch your platform with ``tutor local launch``.\n\nCompatibility Notes\n--------------------\n\n+------------------+---------------+\n| Open edX Release | Version       |\n+==================+===============+\n| Ironwood         | < 0.9 < 3.0   |\n+------------------+---------------+\n| Juniper          | >= 0.9 < 3.0  |\n+------------------+---------------+\n| Koa              | >= 2.2 < 5.0  |\n+------------------+---------------+\n| Lilac            | >= 2.2 < 5.0  |\n+------------------+---------------+\n| Maple            | >= 4.0 < 6.0  |\n+------------------+---------------+\n| Nutmeg           | >= 5.0 < 6.0  |\n+------------------+---------------+\n| Olive            | >= 5.0 < 6.0  |\n+------------------+---------------+\n| Palm             | >= 6.0 < 8.0  |\n+------------------+---------------+\n| Quince           | >= 7.0 < 9.0  |\n+------------------+---------------+\n| Redwood          | >= 7.2.0      |\n+------------------+---------------+\n| Sumac            | >= 9.0.0      |\n+------------------+---------------+\n\nThe plugin is configured for the latest release (Sumac). The following changes in the plugin settings should be applied to be used for previous releases.\nThose settings can be changed in `eox_tagging/settings/common.py`` or, for example, in the instance configurations.\n\n\n\ud83d\udea8 If the release you are looking for is not listed, please note:\n\n- If the Open edX release is compatible with the current eox-tagging version (see `Compatibility Notes <https://github.com/eduNEXT/eox-tagging?tab=readme-ov-file#compatibility-notes>`_), the default configuration is sufficient.\n- If incompatible, you can refer to the README from the relevant version tag for configuration details (e.g., `v5.1.0 README <https://github.com/eduNEXT/eox-tagging/blob/v5.1.0/README.rst>`_).\n\nUsage\n======\n\nSee the `How to section <https://github.com/eduNEXT/eox-tagging/tree/master/docs/how_to>`_ for detailed guidance on model, configurations and API usage.\n\nImportant notes:\n----------------\n\n* All the comparisons with string objects are case insensitive.\n* If a tag owner is not defined, then it is assumed to be the site.\n\nExamples\n--------\n\n**Example 1:**\n\n.. code-block:: JSON\n\n        {\n            \"validate_tag_value\": {\n                \"in\": [\n                    \"example_tag_value\",\n                    \"example_tag_value_1\"\n                ]\n            },\n            \"validate_access\": {\n                \"equals\": \"PRIVATE\"\n            },\n            \"validate_target_object\": \"OpaqueKeyProxyModel\",\n            \"owner_object\": \"User\",\n            \"tag_type\": \"tag_by_example\"\n        }\n\nThis means that:\n\n* Tag value must be in the array\n* The field access must be equal to `private`\n* The target type must be equal to `CourseOverview`\n* The owner type must be equal to `User`\n* Tag_type must be equal to `tag_by_example`\n\n**Example 2:**\n\n.. code-block:: JSON\n\n        {\n            \"validate_tag_value\": {\n                \"exist\": true\n            },\n            \"validate_access\": \"Public\",\n            \"validate_target_object\": \"User\",\n            \"tag_type\": \"tag_by_edunext\"\n        }\n\nThis means that:\n\n* The tag value must exist, it can take any value.\n* The field access must be equal to `public`.\n* The target type must be equal to `User`.\n* Tag type must be equal to tag_by_edunext.\n\n**Example 3:**\n\n.. code-block:: JSON\n\n        {\n            \"validate_tag_value\": \"tag_value\",\n            \"validate_access\": {\n                \"in\": [\n                    \"Private\",\n                    \"Public\"\n                ]\n            },\n            \"validate_target_object\": \"CourseEnrollment\",\n            \"tag_type\": \"tag_by_edunext\",\n            \"validate_activation_date\": {\n                \"exist\": true,\n                \"in\": [\n                    \"Dec 04 2020 10:30:40\",\n                    \"Oct 19 2020 10:30:40\"\n                ]\n            }\n        }\n\nThis means that:\n\n* The tag value must be equal to tag_value.\n* The field access can be `private` or `public`.\n* The target type must be equal to `CourseEnrollment`\n* Tag type must be equal to tag_by_edunext.\n* The tag activation date must exist between the values defined in the array. This means, value_1 <= activation_date <= value_2.\n  The array must be sorted or a validation error will be raised.\n\nTagging REST API\n================\n\nGet a list of tags\n------------------\n\n**Request**\n\n``curl -H 'Accept: application/json' -H \"Authorization: Bearer AUTHENTICATION_TOKEN\" http://BASE_URL_SITE/eox-tagging/api/v1/tags/``\n\n**Response**\n\n.. code-block:: JSON\n\n        {\n            \"count\": 2,\n            \"next\": null,\n            \"previous\": null,\n            \"results\": [\n                {\n                    \"meta\": {\n                        \"created_at\": \"2020-07-10T13:25:54.057846Z\",\n                        \"target_id\": 2,\n                        \"target_type\": \"User\",\n                        \"inactivated_at\": null,\n                        \"owner_type\": \"User\",\n                        \"owner_id\": 7\n                    },\n                    \"key\": \"55a20579-ce8e-4f0b-830e-78fe79adac46\",\n                    \"tag_value\": \"tag_value\",\n                    \"tag_type\": \"tag_by_edunext\",\n                    \"access\": \"PUBLIC\",\n                    \"activation_date\": \"2020-12-04T15:20:30Z\",\n                    \"expiration_date\": null,\n                    \"status\": \"ACTIVE\"\n                },\n                {\n                    \"meta\": {\n                        \"created_at\": \"2020-07-10T13:33:44.277374Z\",\n                        \"target_id\": 2,\n                        \"target_type\": \"User\",\n                        \"inactivated_at\": null,\n                        \"owner_type\": \"Site\",\n                        \"owner_id\": 1\n                    },\n                    \"key\": \"2bec10f5-a9e0-4e42-9c24-f9643bb13537\",\n                    \"tag_value\": \"tag_value\",\n                    \"tag_type\": \"tag_by_edunext\",\n                    \"access\": \"PUBLIC\",\n                    \"activation_date\": \"2020-12-04T15:20:30Z\",\n                    \"expiration_date\": null,\n                    \"status\": \"ACTIVE\"\n                },\n            ]\n        }\n\nCreate tag\n----------\n\n**Request**\n\n``curl -H 'Accept: application/json' -H \"Authorization: Bearer AUTHENTICATION_TOKEN\" --data TAG_DATA http://BASE_URL_SITE/eox-tagging/api/v1/tags/``\n\nWhere TAG_DATA:\n\n.. code-block:: JSON\n\n        {\n            \"tag_type\": \"tag_by_edunext\",\n            \"tag_value\": \"tag_value\",\n            \"target_type\": \"user\",\n            \"target_id\": \"edx\",\n            \"access\": \"public\",\n            \"owner_type\": \"user\",\n            \"activation_date\": \"2020-12-04 10:20:30\"\n        }\n\n\n**Response**:\n\n``Status 201 Created``\n\n.. code-block:: JSON\n\n        {\n            \"meta\": {\n                \"created_at\": \"2020-07-10T13:25:54.057846Z\",\n                \"target_id\": 2,\n                \"target_type\": \"User\",\n                \"inactivated_at\": null,\n                \"owner_type\": \"User\",\n                \"owner_id\": 7\n            },\n            \"key\": \"55a20579-ce8e-4f0b-830e-78fe79adac46\",\n            \"tag_value\": \"tag_value\",\n            \"tag_type\": \"tag_by_edunext\",\n            \"access\": \"PUBLIC\",\n            \"activation_date\": \"2020-12-04T10:20:30-05:00\",\n            \"expiration_date\": null,\n            \"status\": \"ACTIVE\"\n        }\n\nDelete tag\n----------\n\n**Request**\n\n``curl -X DELETE  http://BASE_URL_SITE/eox-tagging/api/v1/tags/EXISTING_KEY_TAG/``\n\n**Response**\n\n``Status 204 No Content``\n\n\nFilters example usage:\n----------------------\n\n``/eox_tagging/api/v1/tags/?target_type=MODEL_TYPE``\n\n``/eox_tagging/api/v1/tags/?course_id=COURSE_ID``\n\n``/eox_tagging/api/v1/tags/?username=USERNAME``\n\n``/eox_tagging/api/v1/tags/?access=ACCESS_TYPE``\n\n``/eox_tagging/api/v1/tags/?enrollments=COURSE_ID``\n\nAuditing Django views\n=====================\n\nThe majority of views in eox-tagging use an auditing decorator, defined in our custom library called `eox-audit-model`_,\nthat helps save relevant information about non-idempotent operations. By default, this functionality is turned off, to enable it, install eox-audit-model. \n\nCheck your auditing records in *Django sysadmin > DJANGO EDUNEXT AUDIT MODEL*.\n\nFor more information, check the eox-audit-model documentation.\n\n.. _openedx plugin: https://github.com/openedx/edx-platform/tree/master/openedx/core/djangoapps/plugins\n.. _edx-platform: https://github.com/openedx/edx-platform/\n.. _eox-audit-model: https://github.com/eduNEXT/eox-audit-model/\n\nHow to Contribute\n=================\n\nContributions are welcome! See our `CONTRIBUTING`_ file for more\ninformation \u2013 it also contains guidelines for how to maintain high code\nquality, which will make your contribution more likely to be accepted.\n\n.. _CONTRIBUTING: https://github.com/eduNEXT/eox-tagging/blob/master/CONTRIBUTING.rst\n\n\nLicense\n=======\n\nThis project is licensed under the AGPL-3.0 License. See the LICENSE file for details.\n",
    "bugtrack_url": null,
    "license": "AGPL",
    "summary": "eox-tagging",
    "version": "9.0.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e708fb0653942159f1af9a64767415ad3917c3e2bb2524885f692c41da88854d",
                "md5": "43fc0402d4f18820b99c6000628d3174",
                "sha256": "f257cc42e590e86321587418e851747544a8d450e08469b3c21219e58daf5571"
            },
            "downloads": -1,
            "filename": "eox_tagging-9.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "43fc0402d4f18820b99c6000628d3174",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 62880,
            "upload_time": "2024-12-27T18:25:17",
            "upload_time_iso_8601": "2024-12-27T18:25:17.867681Z",
            "url": "https://files.pythonhosted.org/packages/e7/08/fb0653942159f1af9a64767415ad3917c3e2bb2524885f692c41da88854d/eox_tagging-9.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "309f72857a19c9ef51d2f4d5a40345af5c106deacc1067ae99dd84db28293a1d",
                "md5": "3de3db9bfc25a33700f3d7eee3237b8e",
                "sha256": "feae6da7297df0ac6e68d918864e998db66a058754cfcc0c67e245530e5572d3"
            },
            "downloads": -1,
            "filename": "eox_tagging-9.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "3de3db9bfc25a33700f3d7eee3237b8e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 52999,
            "upload_time": "2024-12-27T18:25:19",
            "upload_time_iso_8601": "2024-12-27T18:25:19.989972Z",
            "url": "https://files.pythonhosted.org/packages/30/9f/72857a19c9ef51d2f4d5a40345af5c106deacc1067ae99dd84db28293a1d/eox_tagging-9.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-27 18:25:19",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "eox-tagging"
}
        
Elapsed time: 0.46327s