Repository: Zipfian-Science/rickled (language: python)

Issue:
Jh rename



Discussion / hints:

Fix patch:
diff --git a/README.md b/README.md
index 67f3ecd..44b7982 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# Pickle Rick
+# Rickle
 ```
                                       ....                                      
                                 &((((((((((((((%,                               
@@ -42,12 +42,7 @@
                       &(//##(//(//((//((((((((((#                               
                        *///(//////////(((((///#                                 
                          *#//////////(///(#/                                     
-.---.  _       .-.   .-.          .---.  _       .-.   
-: .; ::_;      : :.-.: :          : .; ::_;      : :.-.
-:  _.'.-. .--. : `'.': :   .--.   :   .'.-. .--. : `'.'
-: :   : :'  ..': . `.: :_ ' '_.'  : :.`.: :'  ..': . `.
-:_;   :_;`.__.':_;:_;`.__;`.__.'  :_;:_;:_;`.__.':_;:_;
-                                        
+
 by Zipfian Science                               
 ```
 Python tools for creating pickles in a different way.
@@ -55,7 +50,7 @@ Python tools for creating pickles in a different way.
 ## Sauce layout
 
 ```
-pickle_rick
+rickle
    |
    |- 
 ```
diff --git a/deploy.py b/deploy.py
index b91ec1e..afb6b48 100644
--- a/deploy.py
+++ b/deploy.py
@@ -9,7 +9,7 @@
 import glob
 from pathlib import Path
 
-_project_name = 'pickle_rick'
+_project_name = 'rickle'
 _git_files_for_add = [
     "./docs/source/*.rst",
     f"./{_project_name}/__init__.py",
diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst
index 08c2827..7434ced 100644
--- a/docs/source/changelog.rst
+++ b/docs/source/changelog.rst
@@ -11,6 +11,13 @@ Changelog
 History
 ==========================
 
+Version 0.2.0 (2021-12-06)
+--------------------------
+
+* Renamed project to ``Rickle`` to avoid any possible lawsuits from money hungry media execs.
+* Pickle Rick was a great name, possibly even considered a parody which is protected under copyright law.
+* But rather safe than sued..
+
 Version 0.1.14 (2021-10-28)
 --------------------------
 
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 16badb7..affe4b4 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -23,7 +23,7 @@
 
 # -- Project information -----------------------------------------------------
 
-project = 'Pickle Rick'
+project = 'Rickle'
 copyright = '2021, Zipfian Science'
 author = 'Zipfian Science'
 
diff --git a/docs/source/index.rst b/docs/source/index.rst
index 100f440..461d4b8 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -3,18 +3,18 @@
    You can adapt this file completely to your liking, but it should at least
    contain the root `toctree` directive.
 
-Pickle Rick
+Rickle
 **************************
 .. toctree::
    :maxdepth: 2
    :numbered:
    :caption: Contents:
 
-   pickle_rick
+   rickle
 
 Starting
 =====================
-Pickle Rick is a lightweight tool for loading and writing very small Python objects to YAML or JSON representations.
+Rickle is a lightweight tool for loading and writing very small Python objects to YAML or JSON representations.
 This is especially useful for creating YAML config files and serialising them as Python objects.
 Works great in interactive Python environments like notebooks.
 
@@ -22,7 +22,7 @@ To install:
 
 .. code-block:: bash
 
-   pip install pickle-rick
+   pip install rickle
 
 Create a YAML file, call it "config.yaml":
 
@@ -80,9 +80,9 @@ Then import the tools:
 
 .. code-block:: python
 
-   >> from pickle_rick import PickleRick
+   >> from rickle import Rickle
 
-   >> config = PickleRick('./config.yaml', deep=True, load_lambda=True)
+   >> config = Rickle('./config.yaml', deep=True, load_lambda=True)
 
    >> config.BASIC.dictionary
    {'one' : 1, 'two' : 2}
@@ -94,14 +94,15 @@ Then import the tools:
 About
 =====================
 
-Pickle Rick is quick to use tool mainly meant to easily encapsulate config YAML files in other Zipfian Science tools.
+Rickle is quick to use tool mainly meant to easily encapsulate config YAML files in other Zipfian Science tools.
 
 Changes and history
 ---------------------
 
 See :ref:`changelog-page` for version history.
 
-Version 0.1.14 (2021-10-28):
+Version 0.2.0 (2021-12-06):
 
-* Added new ``add_html_page`` to load HTML text.
-* Added new ``add_csv_file`` to load CSV files as either a list of lists, or list of PickleRicks.
+* Renamed project to ``Rickle`` to avoid any possible lawsuits from money hungry media execs.
+* Pickle Rick was a great name, possibly even considered a parody which is protected under copyright law.
+* But rather safe than sued..
diff --git a/docs/source/pickle_rick.rst b/docs/source/rickle.rst
similarity index 83%
rename from docs/source/pickle_rick.rst
rename to docs/source/rickle.rst
index 8e9d25b..0a23748 100644
--- a/docs/source/pickle_rick.rst
+++ b/docs/source/rickle.rst
@@ -3,22 +3,22 @@
    You can adapt this file completely to your liking, but it should at least
    contain the root `toctree` directive.
 
-Pickle Ricking
+Rickle Picking
 **************************
 .. contents:: Table of Contents
 
 Simple classes for encapsulating Python objects, with functions to write these simple objects to YAML or JSON.
 
-Basic Rick
+Basic Rickle
 ========================
-.. autoclass:: pickle_rick.__init__.BasicRick
+.. autoclass:: rickle.__init__.BaseRickle
    :members:
 
-Pickle Rick
+Rickle Pick
 ========================
 
 An extended version of BasicRick that allows extra easy loading, including Python functions, lambdas, and OS environmental variables.
 Contains all the same methods in BasicRick.
 
-.. autoclass:: pickle_rick.__init__.PickleRick
+.. autoclass:: rickle.__init__.Rickle
    :members:
\ No newline at end of file
diff --git a/pip_description.md b/pip_description.md
index 0359759..7c4a2d0 100644
--- a/pip_description.md
+++ b/pip_description.md
@@ -1,4 +1,4 @@
-# Pickle Rick
+# Rickle
 ```
                                       ....                                      
                                 &((((((((((((((%,                               
@@ -42,33 +42,28 @@
                       &(//##(//(//((//((((((((((#                               
                        *///(//////////(((((///#                                 
                          *#//////////(///(#/                                    
-.---.  _       .-.   .-.          .---.  _       .-.   
-: .; ::_;      : :.-.: :          : .; ::_;      : :.-.
-:  _.'.-. .--. : `'.': :   .--.   :   .'.-. .--. : `'.'
-: :   : :'  ..': . `.: :_ ' '_.'  : :.`.: :'  ..': . `.
-:_;   :_;`.__.':_;:_;`.__;`.__.'  :_;:_;:_;`.__.':_;:_;
                                         
 by Zipfian Science                               
 ```
 Python tools for creating a different type of pickling by [Zipfian Science](https://zipfian.science/).
 
-Pickle Rick is a lightweight tool for loading and writing very small Python objects to YAML or JSON representations.
+Rickle is a lightweight tool for loading and writing very small Python objects to YAML or JSON representations.
 This is especially useful for creating YAML config files and serialising them as Python objects.
 Works great in interactive Python environments like notebooks.
 
-For documentation, see [docs](http://docs.zipfian.science/pickle-rick/index.html).
+For documentation, see [docs](http://docs.zipfian.science/rickle/index.html).
 
-Source on [GitHub](https://github.com/Zipfian-Science/pickle-rick).
+Source on [GitHub](https://github.com/Zipfian-Science/rickle).
 ## Install
 
 ```shell script
-$ pip install pickle-rick
+$ pip install rickle
 ```
 
 ## And use
 
 ```python
-from pickle_rick import PickleRick
+from rickle import Rickle
 ```
 
 Using an example YAML file:
@@ -123,12 +118,12 @@ BASIC:
           print(i)
 ```
 
-Then use Rick:
+Then use Rickle:
 
 ```python
->> from pickle_rick import PickleRick
+>> from rickle import Rickle
 
->> config = PickleRick('./config.yaml', deep=True, load_lambda=True)
+>> config = Rickle('./config.yaml', deep=True, load_lambda=True)
 
 >> config.BASIC.callable_lambda()
 'hell world!'
diff --git a/pickle_rick/__init__.py b/rickle/__init__.py
similarity index 97%
rename from pickle_rick/__init__.py
rename to rickle/__init__.py
index 6fae758..0d44190 100644
--- a/pickle_rick/__init__.py
+++ b/rickle/__init__.py
@@ -1,4 +1,4 @@
-__version__ = '0.1.15'
+__version__ = '0.2.0'
 import os
 import json
 import copy
@@ -8,7 +8,7 @@
 import requests
 import base64
 
-class BasicRick:
+class BaseRickle:
     """
         A base class that creates internal structures from embedded structures.
 
@@ -22,13 +22,13 @@ class BasicRick:
     def _iternalize(self, dictionary : dict, deep : bool, **init_args):
         for k, v in dictionary.items():
             if isinstance(v, dict):
-                self.__dict__.update({k:BasicRick(v, deep, **init_args)})
+                self.__dict__.update({k:BaseRickle(v, deep, **init_args)})
                 continue
             if isinstance(v, list) and deep:
                 new_list = list()
                 for i in v:
                     if isinstance(i, dict):
-                        new_list.append(BasicRick(i, deep, **init_args))
+                        new_list.append(BaseRickle(i, deep, **init_args))
                     else:
                         new_list.append(i)
                 self.__dict__.update({k: new_list})
@@ -124,7 +124,7 @@ def _recursive_search(self, dictionary, key):
         if key in dictionary:
             return dictionary[key]
         for k, v in dictionary.items():
-            if isinstance(v, BasicRick):
+            if isinstance(v, BaseRickle):
                 try:
                     value = self._recursive_search(v.__dict__, key)
                     return value
@@ -208,12 +208,12 @@ def dict(self, serialised : bool = False):
         for key, value in self.__dict__.items():
             if str(key).__contains__(self.__class__.__name__) or str(key).endswith('__meta_info'):
                 continue
-            if isinstance(value, BasicRick) or isinstance(value, PickleRick):
+            if isinstance(value, BaseRickle) or isinstance(value, Rickle):
                 d[key] = value.dict(serialised=serialised)
             elif isinstance(value, list):
                 new_list = list()
                 for element in value:
-                    if isinstance(element, BasicRick):
+                    if isinstance(element, BaseRickle):
                         new_list.append(element.dict(serialised=serialised))
                     else:
                         new_list.append(element)
@@ -315,7 +315,7 @@ def add_attr(self, name, value):
         """
         self.__dict__.update({name: value})
 
-class PickleRick(BasicRick):
+class Rickle(BaseRickle):
     """
         An extended version of the BasicRick that can load OS environ variables and Python Lambda functions.
 
@@ -395,13 +395,13 @@ def _iternalize(self, dictionary : dict, deep : bool, **init_args):
                     else:
                         self.__dict__.update({k: v})
                     continue
-                self.__dict__.update({k:PickleRick(v, deep, **init_args)})
+                self.__dict__.update({k:Rickle(v, deep, **init_args)})
                 continue
             if isinstance(v, list) and deep:
                 new_list = list()
                 for i in v:
                     if isinstance(i, dict):
-                        new_list.append(PickleRick(i, deep, **init_args))
+                        new_list.append(Rickle(i, deep, **init_args))
                     else:
                         new_list.append(i)
                 self.__dict__.update({k: new_list})
@@ -436,12 +436,12 @@ def dict(self, serialised : bool = False):
                 d[key] = self.__meta_info[key]
             elif key in self.__meta_info.keys() and self.__meta_info[key]['type'] in ['function', 'lambda']:
                 d[key] = self.__meta_info[key]
-            elif isinstance(value, BasicRick):
+            elif isinstance(value, BaseRickle):
                 d[key] = value.dict(serialised=serialised)
             elif isinstance(value, list):
                 new_list = list()
                 for element in value:
-                    if isinstance(element, BasicRick):
+                    if isinstance(element, BaseRickle):
                         new_list.append(element.dict(serialised=serialised))
                     else:
                         new_list.append(element)
@@ -636,7 +636,7 @@ def add_from_file(self, name,
             args = copy.copy(self.__init_args)
             args['load_lambda'] = load_lambda
             args['deep'] = deep
-            self.__dict__.update({name: PickleRick(file_path, **args)})
+            self.__dict__.update({name: Rickle(file_path, **args)})
         else:
             if is_binary:
                 with open(file_path, 'rb') as fn:
@@ -722,7 +722,7 @@ def add_api_json_call(self, name,
             args = copy.copy(self.__init_args)
             args['load_lambda'] = load_lambda
             args['deep'] = deep
-            self.__dict__.update({name: PickleRick(json_dict, **args)})
+            self.__dict__.update({name: Rickle(json_dict, **args)})
         else:
             raise ValueError(f'Unexpected HTTP status code in response {r.status_code}')
         self.__meta_info[name] = {'type': 'api_json',
diff --git a/setup.py b/setup.py
index f31a1b7..55713a8 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@
 import os
 import json
 from datetime import datetime
-from pickle_rick import __version__ as ver
+from rickle import __version__ as ver
 
 here = os.path.abspath(os.path.dirname(__file__))
 
@@ -21,7 +21,7 @@
         long_description = f.read()
         long_description = long_description.format(pypi_metdata_release_date=datetime.today().strftime('%Y-%m-%d'), pypi_metdata_version_number=version_name)
 else:
-    long_description = "It's Pickle Rick!"
+    long_description = "It's Rickle Pick!"
 
 if os.path.isfile(os.path.join(here, 'requirements.txt')):
     with open(os.path.join(here, 'requirements.txt'), encoding='utf-8') as f:
@@ -34,7 +34,7 @@
 
 
 setup(
-    name="pickle_rick",
+    name="rickle",
     version=version_name,
     description='Tools for pickling Python objects in completely different way',
     long_description_content_type='text/markdown',
@@ -49,7 +49,7 @@
     packages=find_packages(".", exclude=("tests", "dist", "deploy", "egg-info")),
     include_package_data=True,
     install_requires=pipreq,
-    package_dir={'.': 'pickle_rick'},
+    package_dir={'.': 'rickle'},
     package_data={
         "": ["*.yaml",],
     },
diff --git a/version.json b/version.json
index 0ece33f..406ae26 100644
--- a/version.json
+++ b/version.json
@@ -1,1 +1,1 @@
-{"major": 0, "minor": 1, "patch": 15}
\ No newline at end of file
+{"major": 0, "minor": 2, "patch": 0}
\ No newline at end of file


Test patch:
diff --git a/tests/unittest/__init__.py b/tests/unittest/__init__.py
index 09503ca..0624526 100644
--- a/tests/unittest/__init__.py
+++ b/tests/unittest/__init__.py
@@ -1,27 +1,27 @@
 import unittest
 import os
-from pickle_rick import BasicRick, PickleRick
+from rickle import BaseRickle, Rickle
 
 class TestPickles(unittest.TestCase):
 
     def test_base_config(self):
         # Test normal dict
         test_dict = {'A' : 1, 'l' : [1, { 'deep' : 'hole'}], 'B' : { 'k' : 'v'}}
-        test_conf = BasicRick(test_dict)
+        test_conf = BaseRickle(test_dict)
 
         self.assertEquals(test_conf.A, 1)
         self.assertListEqual(test_conf.l, [1,{ 'deep' : 'hole'}])
         self.assertEquals(test_conf.B.k, 'v')
 
         # Test deep dict
-        test_conf = BasicRick(test_dict, deep=True)
+        test_conf = BaseRickle(test_dict, deep=True)
 
         self.assertEquals(test_conf.l[-1].deep, 'hole')
 
         # Test YAML and JSON doc loading with file path
 
-        test_conf_yaml = BasicRick('./tests/placebos/test_config.yaml', deep=True)
-        test_conf_json = BasicRick('./tests/placebos/test_config.json', deep=True)
+        test_conf_yaml = BaseRickle('./tests/placebos/test_config.yaml', deep=True)
+        test_conf_json = BaseRickle('./tests/placebos/test_config.json', deep=True)
 
         self.assertGreater(len(test_conf_yaml), 0)
         self.assertGreater(len(test_conf_json), 0)
@@ -29,8 +29,8 @@ def test_base_config(self):
         # Test YAML and JSON doc loading with file stream
 
         with open('./tests/placebos/test_config.yaml', 'r') as fs_y, open('./tests/placebos/test_config.json', 'r') as fs_j:
-            test_conf_yaml = BasicRick(fs_y, deep=True)
-            test_conf_json = BasicRick(fs_j, deep=True)
+            test_conf_yaml = BaseRickle(fs_y, deep=True)
+            test_conf_json = BaseRickle(fs_j, deep=True)
 
             self.assertGreater(len(test_conf_yaml), 0)
             self.assertGreater(len(test_conf_json), 0)
@@ -42,15 +42,15 @@ def test_base_config(self):
         json_string = """
                 { "ONE" : "value"}
                 """
-        test_conf_yaml = BasicRick(yaml_string, deep=True)
-        test_conf_json = BasicRick(json_string, deep=True)
+        test_conf_yaml = BaseRickle(yaml_string, deep=True)
+        test_conf_json = BaseRickle(json_string, deep=True)
 
         self.assertTrue(test_conf_yaml == test_conf_json)
         self.assertEquals(test_conf_yaml.ONE, "value")
         self.assertEquals(test_conf_json.ONE, "value")
 
     def test_base_config_add_attr(self):
-        test_conf = BasicRick()
+        test_conf = BaseRickle()
 
         test_conf.add_attr('new_var', 42)
 
@@ -63,14 +63,14 @@ def test_base_config_add_attr(self):
     def test_extended_config(self):
         # Test normal dict
         test_dict = {'A' : 1, 'l' : [1, { 'deep' : 'hole'}], 'B' : { 'k' : 'v'}}
-        test_conf = PickleRick(test_dict)
+        test_conf = Rickle(test_dict)
 
         self.assertEquals(test_conf.A, 1)
         self.assertListEqual(test_conf.l, [1,{ 'deep' : 'hole'}])
         self.assertEquals(test_conf.B.k, 'v')
 
         # Test deep dict
-        test_conf = PickleRick(test_dict, deep=True)
+        test_conf = Rickle(test_dict, deep=True)
 
         self.assertEquals(test_conf.l[-1].deep, 'hole')
 
@@ -85,7 +85,7 @@ def test_extended_config(self):
                      }
         }
 
-        test_conf = PickleRick(test_dict, load_lambda=True)
+        test_conf = Rickle(test_dict, load_lambda=True)
 
         expected_username = os.getenv('USERNAME')
 
@@ -93,7 +93,7 @@ def test_extended_config(self):
         self.assertEquals(test_conf.func(41), 42)
 
     def test_config_get_search(self):
-        test_conf_yaml = BasicRick('./tests/placebos/test_config.yaml', deep=True)
+        test_conf_yaml = BaseRickle('./tests/placebos/test_config.yaml', deep=True)
 
         value = test_conf_yaml.get('one')
 
@@ -105,7 +105,7 @@ def test_config_get_search(self):
 
         value = test_conf_yaml.get('USERNAME')
 
-        self.assertIsInstance(value, BasicRick)
+        self.assertIsInstance(value, BaseRickle)
         self.assertEquals(value.type, 'env')
 
     def test_config_to_dict(self):
@@ -119,7 +119,7 @@ def test_config_to_dict(self):
             }
         }
 
-        test_conf = BasicRick(test_dict)
+        test_conf = BaseRickle(test_dict)
 
         self.assertDictEqual(test_conf.dict(), test_dict)
 
@@ -134,7 +134,7 @@ def test_config_keys(self):
             }
         }
 
-        test_conf = PickleRick(test_dict)
+        test_conf = Rickle(test_dict)
 
         for k in test_conf.keys():
             self.assertIn(k, ['user', 'func'])
@@ -148,7 +148,7 @@ def test_config_iterator(self):
             }
         }
 
-        test_conf = PickleRick(test_dict)
+        test_conf = Rickle(test_dict)
 
         for k in test_conf:
             self.assertEquals(k.hello, 'world')
@@ -162,7 +162,7 @@ def test_config_has_key(self):
             }
         }
 
-        test_conf = PickleRick(test_dict)
+        test_conf = Rickle(test_dict)
 
         self.assertTrue(test_conf.has('user'))
         self.assertFalse(test_conf.has('hello'))
@@ -178,7 +178,7 @@ def test_config_values(self):
 
         expected = ['BYE', 'hello']
 
-        test_conf = BasicRick(test_dict)
+        test_conf = BaseRickle(test_dict)
 
         l = test_conf.values()
 
@@ -190,7 +190,7 @@ def test_config_items(self):
             'func': 'hello'
         }
 
-        test_conf = BasicRick(test_dict)
+        test_conf = BaseRickle(test_dict)
 
         for k, v in test_conf.items():
             self.assertEquals(v, test_dict[k])
@@ -208,7 +208,7 @@ def test_dump_yaml(self):
             }
         }
 
-        conf = BasicRick(test_dict)
+        conf = BaseRickle(test_dict)
 
         dumped_string = conf.to_yaml_string()
 
@@ -235,7 +235,7 @@ def test_dump_json(self):
             }
         }
 
-        conf = BasicRick(test_dict)
+        conf = BaseRickle(test_dict)
 
         dumped_string = conf.to_json_string()
         expected = '{"user": {"type": "env", "load": "USERNAME"}, "func": {"type": "lambda", "load": "lambda x: x+1"}}'
@@ -252,7 +252,7 @@ def test_dump_json(self):
 
     def test_extended_config_add_function(self):
         import math
-        test_conf = PickleRick()
+        test_conf = Rickle()
 
         load = """
 def tester(x, c):
@@ -277,7 +277,7 @@ def tester(x, c):
 
     def test_extended_config_add_lambda(self):
             from datetime import datetime as dd
-            test_conf = PickleRick()
+            test_conf = Rickle()
 
             load = "lambda: dd.utcnow().strftime('%Y-%m-%d')"
 
@@ -292,14 +292,14 @@ def test_extended_config_add_lambda(self):
             self.assertEquals(y, y_true)
 
     def test_pickle_rick_dict_decon(self):
-        test_conf_yaml = PickleRick('./tests/placebos/test_config.yaml', deep=True, load_lambda=True)
+        test_conf_yaml = Rickle('./tests/placebos/test_config.yaml', deep=True, load_lambda=True)
 
         d = test_conf_yaml.dict()
 
         s = test_conf_yaml.to_yaml_string()
 
     def test_pickle_rick_load_param(self):
-        test_conf_yaml = PickleRick('./tests/placebos/test_config.yaml', deep=True, arg_name='hallo_wereld', load_lambda=True)
+        test_conf_yaml = Rickle('./tests/placebos/test_config.yaml', deep=True, arg_name='hallo_wereld', load_lambda=True)
 
         d = test_conf_yaml.dict()
 
@@ -307,8 +307,8 @@ def test_pickle_rick_load_param(self):
 
         s = test_conf_yaml.to_yaml_string(serialised=False)
 
-        test_conf_yaml = PickleRick('./tests/placebos/test_config.yaml', deep=True,
-                                    load_lambda=True)
+        test_conf_yaml = Rickle('./tests/placebos/test_config.yaml', deep=True,
+                                load_lambda=True)
 
         d = test_conf_yaml.dict()
 
@@ -316,12 +316,12 @@ def test_pickle_rick_load_param(self):
 
     def test_multi_file_load(self):
         files = ['./tests/placebos/test_config.yaml', './tests/placebos/test_second.yaml']
-        test_conf_yaml = PickleRick(files, deep=True, load_lambda=True)
+        test_conf_yaml = Rickle(files, deep=True, load_lambda=True)
 
         self.assertTrue(True)
 
     def test_pickle_rick_dict_decon_deserialised_vs_serialised(self):
-        test_conf_yaml = PickleRick('./tests/placebos/test_config.yaml', deep=True, load_lambda=True)
+        test_conf_yaml = Rickle('./tests/placebos/test_config.yaml', deep=True, load_lambda=True)
 
         d = test_conf_yaml.dict()