def create_table_from_json(<EOL>self,<EOL>json_source,<EOL>table_name="<STR_LIT>",<EOL>primary_key=None,<EOL>add_primary_key_column=False,<EOL>index_attrs=None,<EOL>):
import pytablereader as ptr<EOL>loader = ptr.JsonTableFileLoader(json_source)<EOL>if typepy.is_not_null_string(table_name):<EOL><INDENT>loader.table_name = table_name<EOL><DEDENT>try:<EOL><INDENT>for table_data in loader.load():<EOL><INDENT>self.__create_table_from_tabledata(<EOL>table_data, primary_key, add_primary_key_column, index_attrs<EOL>)<EOL><DEDENT>return<EOL><DEDENT>except (ptr.InvalidFilePathError, IOError):<EOL><INDENT>pass<EOL><DEDENT>loader = ptr.JsonTableTextLoader(json_source)<EOL>if typepy.is_not_null_string(table_name):<EOL><INDENT>loader.table_name = table_name<EOL><DEDENT>for table_data in loader.load():<EOL><INDENT>self.__create_table_from_tabledata(<EOL>table_data, primary_key, add_primary_key_column, index_attrs<EOL>)<EOL><DEDENT>
Create a table from a JSON file/text.

:param str json_source: Path to the JSON file or JSON text.
:param str table_name: Table name to create.
:param str primary_key: |primary_key|
:param tuple index_attrs: |index_attrs|

:Dependency Packages:
    - `pytablereader <https://github.com/thombashi/pytablereader>`__

:Examples:
    :ref:`example-create-table-from-json`

.. seealso::
    :py:meth:`.pytablereader.JsonTableFileLoader.load`
    :py:meth:`.pytablereader.JsonTableTextLoader.load`