{ "cells": [ { "cell_type": "markdown", "metadata": { "pycharm": { "name": "#%% md\n" } }, "source": [ "## Hello, world!\n", "\n", "This notebook demonstrates the basics of loading objects using Clipppy." ] }, { "cell_type": "raw", "metadata": { "pycharm": { "name": "#%% raw\n" }, "raw_mimetype": "text/restructuredtext" }, "source": [ "\n", ".. default-role:: any\n", "\n", "Clipppy has three functions for loading YAML into Python objects: `load`,\n", "`loads`, and `load_config`. The former two are for loading arbitrary objects\n", "from a file (or filename) or a string of YAML. The latter is for loading a\n", "`Clipppy` object from a \"config\" file.\n" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true, "pycharm": { "name": "#%%\n" } }, "outputs": [], "source": [ "from clipppy import load_config, loads" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "pycharm": { "name": "#%%\n" } }, "outputs": [ { "data": { "text/plain": "'Hello, World!'" }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "loads('Hello, World!')" ] }, { "cell_type": "code", "execution_count": 3, "outputs": [ { "data": { "text/plain": "" }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import io\n", "load_config(io.StringIO('{}'))" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } } ], "metadata": { "celltoolbar": "Raw Cell Format", "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "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.9.7" }, "varInspector": { "cols": { "lenName": 16, "lenType": 16, "lenVar": 40 }, "kernels_config": { "python": { "delete_cmd_postfix": "", "delete_cmd_prefix": "del ", "library": "var_list.py", "varRefreshCmd": "print(var_dic_list())" }, "r": { "delete_cmd_postfix": ") ", "delete_cmd_prefix": "rm(", "library": "var_list.r", "varRefreshCmd": "cat(var_dic_list()) " } }, "types_to_exclude": [ "module", "function", "builtin_function_or_method", "instance", "_Feature" ], "window_display": false } }, "nbformat": 4, "nbformat_minor": 1 }