Skip to content

Instantly share code, notes, and snippets.

@fititnt
Last active March 29, 2021 10:23
Show Gist options
  • Save fititnt/3dd12c61170d290fe94cafb1f672a0b5 to your computer and use it in GitHub Desktop.
Save fititnt/3dd12c61170d290fe94cafb1f672a0b5 to your computer and use it in GitHub Desktop.
Jupyter notebooks testes from HXL-Data-Science-file-formats; see https://github.com/EticaAI/HXL-Data-Science-file-formats

Jupyter Notebook with examples of direct access to HDP files processing

See EticaAI/HXL-Data-Science-file-formats in special

Note: after some time these linkes may be broken. So check @EticaAI or @fititnt repositories.

To run these Jupyter notebooks

TODO: explain more

Notes

  • Files starting with zzz_ are mostly for testing and/or, even if eventually do not get obsolete, are not meant to be good reference of usage.
Display the source blob
Display the rendered blob
Raw
{
"metadata": {
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5-final"
},
"orig_nbformat": 2,
"kernelspec": {
"name": "python38564bit579b9a52561c42379acf4b07992b6d5f",
"display_name": "Python 3.8.5 64-bit",
"language": "python"
}
},
"nbformat": 4,
"nbformat_minor": 2,
"cells": [
{
"source": [
"# HDP Basics\n"
],
"cell_type": "markdown",
"metadata": {}
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"# Ignore these autoreload on your project; they may relevant only editing libraries\n",
"%load_ext autoreload\n",
"%autoreload 2"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"HXLm version: 0.8.4\nENV LANGUAGE (old): pt_BR:pt:en\nENV LANGUAGE (now): gn_BR:gn:pt_BR:pt:se_SE:se:sv:en\n"
]
}
],
"source": [
"## https://github.com/HXLStandard/libhxl-python\n",
"import hxl as HXL\n",
"\n",
"## https://github.com/EticaAI/HXL-Data-Science-file-formats/\n",
"import hxlm.core as HXLm\n",
"\n",
"print('HXLm version: ', HXLm.__version__)\n",
"\n",
"## We sometimes will change environment variables to simulate user computer\n",
"## You may need this when running outside of your current computer\n",
"## like free online servers that allow python or Jupyter notebooks\n",
"import os\n",
"\n",
"print('ENV LANGUAGE (old): ', os.getenv('LANGUAGE'))\n",
"\n",
"# Lets set language of this user witht his order of preference\n",
"# - Língua guarani, Brasil\n",
"# - Língua guarani\n",
"# - Língua portuguesa, Brasil\n",
"# - Língua portuguesa\n",
"# - Nordsamiska, Sverige [Northern Sami, Sweden region]\n",
"# - Nordsamiska [Northern Sami]\n",
"# - Svenska [Swedish, any region]\n",
"# - (TODO: add more variants)\n",
"# - English (most systems default to English at some point)\n",
"os.environ['LANGUAGE'] = 'gn_BR:gn:pt_BR:pt:se_SE:se:sv:en'\n",
"\n",
"\n",
"print('ENV LANGUAGE (now): ', os.getenv('LANGUAGE'))"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"HDATUM_UDHR file:///workspace/git/EticaAI/HXL-Data-Science-file-formats/hxlm/data/udhr/\nHDATUM_HXL /workspace/git/EticaAI/HXL-Data-Science-file-formats/hxlm/data/hxl/\n"
]
}
],
"source": [
"# Some built-in datasets\n",
"print('HDATUM_UDHR', HXLm.HDATUM_UDHR)\n",
"print('HDATUM_HXL', HXLm.HDATUM_HXL)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
" # TODO: maybe we should implement some way to render YAML. See this\n",
" # https://github.com/ipython/ipython/issues/11747"
]
}
]
}
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment