XBlock


NameXBlock JSON
Version 5.1.0 PyPI version JSON
download
home_pagehttps://github.com/openedx/XBlock
SummaryXBlock Core Library
upload_time2024-08-19 15:40:56
maintainerNone
docs_urlNone
authoredX
requires_pythonNone
licenseApache 2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            XBlock
######


|pypi-badge| |ci-badge| |codecov-badge| |doc-badge| |pyversions-badge|
|license-badge| |status-badge|

Purpose
*******

XBlock is the Open edX component architecture for building courseware.

This repo contains the core code for implementing XBlocks. Open edX courseware
is built out of components that are combined hierarchically. These include
components like the video player, `LON-CAPA`_ problems, as well as compound
components like learning sequences. The API for these components is called
XBlocks.

.. _LON-CAPA: http://www.lon-capa.org/

How does this differ from existing industry standards like `Learning Tools
Interoperability`_ (LTI) and `SCORM`_? On a high level, XBlocks is a Python
language-level API, and it provides sensible defaults for things like storing
data. XBlocks could be wrapped up in LTI, and one could make an LTI XBlock. The
core reason to write an XBlock is that it is deployable. You can give us the
code to an XBlock, and we can embed it in our courseware. LTI would require you
to give us a virtual machine image which ran it.

.. _Learning Tools Interoperability: http://www.imsglobal.org/toolsinteroperability2.cfm
.. _SCORM: http://scorm.com/scorm-explained/

Getting Started
***************

Developing
==========

One Time Setup
--------------

First, clone the repository:

.. code-block:: bash

   git clone git@github.com:openedx/XBlock.git

Go to the XBlock directory, set up a virtual environment using ``virtualenvwrapper`` with
the same name as the repo and activate it:

.. code-block:: bash

   cd XBlock
   mkvirtualenv -p python3.11 XBlock

Every time you develop something in this repo
---------------------------------------------

.. code-block:: bash

  # Activate the virtualenv
  workon XBlock

  # Grab the latest code
  git checkout master
  git pull

  # Install/update the dev requirements
  make requirements

  # Run the tests and quality checks (to verify the status before you make any changes)
  make validate

  # Make a new branch for your changes
  git checkout -b <your_github_username>/<short_description>

  # Using your favorite editor, edit the code to make your change.
  vim ...

  # Run your new tests
  pytest ./path/to/new/tests

  # Run all the tests and quality checks
  make validate

  # Commit all your changes
  git commit ...
  git push

  # Open a PR and ask for review.

Deploying
---------

To package a new release:

#. Describe the release in `CHANGELOG.rst`_

#. Update the ``__version__`` number in `xblock/__init__.py`_

#. Use the github release mechanism to release a new version. This will tag and publish the package.

.. _CHANGELOG.rst: https://github.com/openedx/XBlock/blob/master/CHANGELOG.rst
.. _xblock/__init__.py: https://github.com/openedx/XBlock/blob/master/xblock/__init__.py

Using the XBlock-SDK
********************

The XBlock-SDK exists in a separate repository. The SDK contains useful tools for
developing your own XBlocks, such as a template XBlock generator, sample XBlocks
that demonstrate XBlock functionality.

You can find it in its own repository: https://github.com/openedx/xblock-sdk

Getting Help
************

Documentation
=============

The docs for the XBlock API is on Read The Docs: https://xblock.readthedocs.org .

Reading the code
----------------

There are distinct layers to this code.  In the docstrings, we've tried to make
clear which layer the code lives in, though sometimes the lines are blurred:

1.  **XBlock** The sample XBlock code.  This is the most important, it is the
    code that most third parties will be writing, and demonstrates the XBlock
    interfaces.

2.  **Runtime** The runtime code that we think will be common to all runtimes.
    This is the behind-the-scenes code edX will write to make XBlocks work.
    This layer may not be real code here, but we'll need to write real code to
    perform these functions.


Making your own XBlock
----------------------

Making an XBlock can be as simple as creating a Python class with a few
specific methods.

Instructions for constructing a new XBlock along with examples can be found in
the `XBlock SDK`_.

.. _XBlock SDK: https://github.com/openedx/xblock-sdk

More Help
=========

If you're having trouble, we have discussion forums at
https://discuss.openedx.org where you can connect with others in the
community.

Our real-time conversations are on Slack. You can request a `Slack
invitation`_, then join our `community Slack workspace`_.

For anything non-trivial, the best path is to open an issue in this
repository with as many details about the issue you are facing as you
can provide.

https://github.com/openedx/XBlock/issues

For more information about these options, see the `Getting Help`_ page.

.. _Slack invitation: https://openedx.org/slack
.. _community Slack workspace: https://openedx.slack.com/
.. _Getting Help: https://openedx.org/getting-help

License
*******

The code in this repository is licensed the Apache 2.0 license unless otherwise
noted.

Please see `LICENSE.txt`_ for details.

.. _LICENSE.txt: https://github.com/openedx/XBlock/blob/master/LICENSE.txt

Contributing
************

Contributions are very welcome!

Please read `How To Contribute <https://openedx.org/r/how-to-contribute>`_ for details.

This project is currently accepting all types of contributions, bug fixes,
security fixes, maintenance work, or new features.  However, please make sure
to have a discussion about your new feature idea with the maintainers prior to
beginning development to maximize the chances of your change being accepted.
You can start a conversation by creating a new issue on this repo summarizing
your idea.

The Open edX Code of Conduct
****************************

All community members are expected to follow the `Open edX Code of Conduct`_.

.. _Open edX Code of Conduct: https://openedx.org/code-of-conduct/

People
******

The assigned maintainers for this component and other project details may be
found in `Backstage`_. Backstage pulls this data from the ``catalog-info.yaml``
file in this repo.

.. _Backstage: https://backstage.openedx.org/catalog/default/component/xblock

Reporting Security Issues
*************************

Please do not report security issues in public. Please email security@openedx.org

.. |pypi-badge| image:: https://img.shields.io/pypi/v/XBlock.svg
    :target: https://pypi.python.org/pypi/XBlock/
    :alt: PyPI

.. |ci-badge| image:: https://github.com/openedx/XBlock/workflows/Python%20CI/badge.svg?branch=master
    :target: https://github.com/openedx/XBlock/actions
    :alt: CI

.. |codecov-badge| image:: https://codecov.io/github/openedx/XBlock/coverage.svg?branch=master
    :target: https://codecov.io/github/openedx/XBlock?branch=master
    :alt: Codecov

.. |doc-badge| image:: https://readthedocs.org/projects/XBlock/badge/?version=latest
    :target: https://edx.readthedocs.io/projects/xblock/en/latest/
    :alt: Documentation

.. |pyversions-badge| image:: https://img.shields.io/pypi/pyversions/XBlock.svg
    :target: https://edx.readthedocs.io/projects/xblock/en/latest/
    :alt: Supported Python versions

.. |license-badge| image:: https://img.shields.io/github/license/openedx/XBlock.svg
    :target: https://github.com/openedx/XBlock/blob/master/LICENSE.txt
    :alt: License

.. |status-badge| image:: https://img.shields.io/badge/Status-Maintained-brightgreen
    :alt: Repo is maintained.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/openedx/XBlock",
    "name": "XBlock",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "edX",
    "author_email": "oscm@edx.org",
    "download_url": "https://files.pythonhosted.org/packages/69/a8/ab5af20d659d3ec7ba72f24330c46e5194eae58411d3d9e7bb7a156a552f/XBlock-5.1.0.tar.gz",
    "platform": null,
    "description": "XBlock\n######\n\n\n|pypi-badge| |ci-badge| |codecov-badge| |doc-badge| |pyversions-badge|\n|license-badge| |status-badge|\n\nPurpose\n*******\n\nXBlock is the Open edX component architecture for building courseware.\n\nThis repo contains the core code for implementing XBlocks. Open edX courseware\nis built out of components that are combined hierarchically. These include\ncomponents like the video player, `LON-CAPA`_ problems, as well as compound\ncomponents like learning sequences. The API for these components is called\nXBlocks.\n\n.. _LON-CAPA: http://www.lon-capa.org/\n\nHow does this differ from existing industry standards like `Learning Tools\nInteroperability`_ (LTI) and `SCORM`_? On a high level, XBlocks is a Python\nlanguage-level API, and it provides sensible defaults for things like storing\ndata. XBlocks could be wrapped up in LTI, and one could make an LTI XBlock. The\ncore reason to write an XBlock is that it is deployable. You can give us the\ncode to an XBlock, and we can embed it in our courseware. LTI would require you\nto give us a virtual machine image which ran it.\n\n.. _Learning Tools Interoperability: http://www.imsglobal.org/toolsinteroperability2.cfm\n.. _SCORM: http://scorm.com/scorm-explained/\n\nGetting Started\n***************\n\nDeveloping\n==========\n\nOne Time Setup\n--------------\n\nFirst, clone the repository:\n\n.. code-block:: bash\n\n   git clone git@github.com:openedx/XBlock.git\n\nGo to the XBlock directory, set up a virtual environment using ``virtualenvwrapper`` with\nthe same name as the repo and activate it:\n\n.. code-block:: bash\n\n   cd XBlock\n   mkvirtualenv -p python3.11 XBlock\n\nEvery time you develop something in this repo\n---------------------------------------------\n\n.. code-block:: bash\n\n  # Activate the virtualenv\n  workon XBlock\n\n  # Grab the latest code\n  git checkout master\n  git pull\n\n  # Install/update the dev requirements\n  make requirements\n\n  # Run the tests and quality checks (to verify the status before you make any changes)\n  make validate\n\n  # Make a new branch for your changes\n  git checkout -b <your_github_username>/<short_description>\n\n  # Using your favorite editor, edit the code to make your change.\n  vim ...\n\n  # Run your new tests\n  pytest ./path/to/new/tests\n\n  # Run all the tests and quality checks\n  make validate\n\n  # Commit all your changes\n  git commit ...\n  git push\n\n  # Open a PR and ask for review.\n\nDeploying\n---------\n\nTo package a new release:\n\n#. Describe the release in `CHANGELOG.rst`_\n\n#. Update the ``__version__`` number in `xblock/__init__.py`_\n\n#. Use the github release mechanism to release a new version. This will tag and publish the package.\n\n.. _CHANGELOG.rst: https://github.com/openedx/XBlock/blob/master/CHANGELOG.rst\n.. _xblock/__init__.py: https://github.com/openedx/XBlock/blob/master/xblock/__init__.py\n\nUsing the XBlock-SDK\n********************\n\nThe XBlock-SDK exists in a separate repository. The SDK contains useful tools for\ndeveloping your own XBlocks, such as a template XBlock generator, sample XBlocks\nthat demonstrate XBlock functionality.\n\nYou can find it in its own repository: https://github.com/openedx/xblock-sdk\n\nGetting Help\n************\n\nDocumentation\n=============\n\nThe docs for the XBlock API is on Read The Docs: https://xblock.readthedocs.org .\n\nReading the code\n----------------\n\nThere are distinct layers to this code.  In the docstrings, we've tried to make\nclear which layer the code lives in, though sometimes the lines are blurred:\n\n1.  **XBlock** The sample XBlock code.  This is the most important, it is the\n    code that most third parties will be writing, and demonstrates the XBlock\n    interfaces.\n\n2.  **Runtime** The runtime code that we think will be common to all runtimes.\n    This is the behind-the-scenes code edX will write to make XBlocks work.\n    This layer may not be real code here, but we'll need to write real code to\n    perform these functions.\n\n\nMaking your own XBlock\n----------------------\n\nMaking an XBlock can be as simple as creating a Python class with a few\nspecific methods.\n\nInstructions for constructing a new XBlock along with examples can be found in\nthe `XBlock SDK`_.\n\n.. _XBlock SDK: https://github.com/openedx/xblock-sdk\n\nMore Help\n=========\n\nIf you're having trouble, we have discussion forums at\nhttps://discuss.openedx.org where you can connect with others in the\ncommunity.\n\nOur real-time conversations are on Slack. You can request a `Slack\ninvitation`_, then join our `community Slack workspace`_.\n\nFor anything non-trivial, the best path is to open an issue in this\nrepository with as many details about the issue you are facing as you\ncan provide.\n\nhttps://github.com/openedx/XBlock/issues\n\nFor more information about these options, see the `Getting Help`_ page.\n\n.. _Slack invitation: https://openedx.org/slack\n.. _community Slack workspace: https://openedx.slack.com/\n.. _Getting Help: https://openedx.org/getting-help\n\nLicense\n*******\n\nThe code in this repository is licensed the Apache 2.0 license unless otherwise\nnoted.\n\nPlease see `LICENSE.txt`_ for details.\n\n.. _LICENSE.txt: https://github.com/openedx/XBlock/blob/master/LICENSE.txt\n\nContributing\n************\n\nContributions are very welcome!\n\nPlease read `How To Contribute <https://openedx.org/r/how-to-contribute>`_ for details.\n\nThis project is currently accepting all types of contributions, bug fixes,\nsecurity fixes, maintenance work, or new features.  However, please make sure\nto have a discussion about your new feature idea with the maintainers prior to\nbeginning development to maximize the chances of your change being accepted.\nYou can start a conversation by creating a new issue on this repo summarizing\nyour idea.\n\nThe Open edX Code of Conduct\n****************************\n\nAll community members are expected to follow the `Open edX Code of Conduct`_.\n\n.. _Open edX Code of Conduct: https://openedx.org/code-of-conduct/\n\nPeople\n******\n\nThe assigned maintainers for this component and other project details may be\nfound in `Backstage`_. Backstage pulls this data from the ``catalog-info.yaml``\nfile in this repo.\n\n.. _Backstage: https://backstage.openedx.org/catalog/default/component/xblock\n\nReporting Security Issues\n*************************\n\nPlease do not report security issues in public. Please email security@openedx.org\n\n.. |pypi-badge| image:: https://img.shields.io/pypi/v/XBlock.svg\n    :target: https://pypi.python.org/pypi/XBlock/\n    :alt: PyPI\n\n.. |ci-badge| image:: https://github.com/openedx/XBlock/workflows/Python%20CI/badge.svg?branch=master\n    :target: https://github.com/openedx/XBlock/actions\n    :alt: CI\n\n.. |codecov-badge| image:: https://codecov.io/github/openedx/XBlock/coverage.svg?branch=master\n    :target: https://codecov.io/github/openedx/XBlock?branch=master\n    :alt: Codecov\n\n.. |doc-badge| image:: https://readthedocs.org/projects/XBlock/badge/?version=latest\n    :target: https://edx.readthedocs.io/projects/xblock/en/latest/\n    :alt: Documentation\n\n.. |pyversions-badge| image:: https://img.shields.io/pypi/pyversions/XBlock.svg\n    :target: https://edx.readthedocs.io/projects/xblock/en/latest/\n    :alt: Supported Python versions\n\n.. |license-badge| image:: https://img.shields.io/github/license/openedx/XBlock.svg\n    :target: https://github.com/openedx/XBlock/blob/master/LICENSE.txt\n    :alt: License\n\n.. |status-badge| image:: https://img.shields.io/badge/Status-Maintained-brightgreen\n    :alt: Repo is maintained.\n",
    "bugtrack_url": null,
    "license": "Apache 2.0",
    "summary": "XBlock Core Library",
    "version": "5.1.0",
    "project_urls": {
        "Homepage": "https://github.com/openedx/XBlock"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0bd3e3b3ec39abaa09bfd300a530d2b487a23a1ce41501360615b7e90b9ade1d",
                "md5": "c4a801705f188a66758c0bf656ac3f8a",
                "sha256": "c068e9981fb7763eefa3d90e57a09181c9c65261982f5cb4d7dabe78fc77d2f2"
            },
            "downloads": -1,
            "filename": "XBlock-5.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c4a801705f188a66758c0bf656ac3f8a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 140751,
            "upload_time": "2024-08-19T15:40:54",
            "upload_time_iso_8601": "2024-08-19T15:40:54.271944Z",
            "url": "https://files.pythonhosted.org/packages/0b/d3/e3b3ec39abaa09bfd300a530d2b487a23a1ce41501360615b7e90b9ade1d/XBlock-5.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "69a8ab5af20d659d3ec7ba72f24330c46e5194eae58411d3d9e7bb7a156a552f",
                "md5": "0022ebaa765e484f6efadd7633a36645",
                "sha256": "776c85b646653221c6f5985603b5fc7eb416c46425cd8e6f15137803ef2c61e9"
            },
            "downloads": -1,
            "filename": "XBlock-5.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "0022ebaa765e484f6efadd7633a36645",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 119387,
            "upload_time": "2024-08-19T15:40:56",
            "upload_time_iso_8601": "2024-08-19T15:40:56.204119Z",
            "url": "https://files.pythonhosted.org/packages/69/a8/ab5af20d659d3ec7ba72f24330c46e5194eae58411d3d9e7bb7a156a552f/XBlock-5.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-19 15:40:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "openedx",
    "github_project": "XBlock",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "tox": true,
    "lcname": "xblock"
}
        
edX
Elapsed time: 0.26668s