Skip to content

Instantly share code, notes, and snippets.

@Sarverott
Last active May 24, 2025 04:00
Show Gist options
  • Save Sarverott/411a1278959c2fb71dcf3f7d221d67af to your computer and use it in GitHub Desktop.
Save Sarverott/411a1278959c2fb71dcf3f7d221d67af to your computer and use it in GitHub Desktop.
old archival version of initially materialised idea of darkpoint mnemonic long-term-mem database. created with Ace as exercise to quide him of padavan road at beggining being technomancer.
#!/usr/bin/env python
# DarkPoint - technomantic framework for mnemonic toolkit that is in accordance with singular principles of thought model system
# Copyright (C) 2024 Sett Sarverott (https://sarverott.com/) <[email protected]>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
from _helpers import EXAMPLE_HEADER
def EXAMPLE(palace):
EXAMPLE_HEADER(__name__, "Changing context recursively")
print(f"\n\t CONTEXT of palace:")
print(f"\t {palace.context}")
print(f"\t hooks of palace with contexts")
for hooked, info in palace:
print(f"\t\t{hooked}/CONTEXT=\t\t{info.context}")
print(f"\n\t Context change recursively in void")
print(
f"\t palace['void']//'###_SPACE_DARKNESS_VOID_PALACE_###' \n\t RETURNS \n\t '{ palace['void']//'###_SPACE_DARKNESS_VOID_PALACE_###' }'"
)
print(f"\n\t CONTEXT of palace:")
print(f"\t {palace.context}")
print(f"\t hooks of palace with contexts")
for hooked, info in palace:
print(f"\t\t{hooked}/CONTEXT=\t\t{info.context}")
print(
f"\t recurrent changes stops when iterated item's context is other then context of startpoint "
)
print(
f"\t all previously related by hook chain from palace['void'] should have diffrent context, besides palace that had changed context before"
)
# ATTENTION! this is not decided yet
#### supreme ultrahooking
#palace **"THE PALACE"+palace
# ATTENTION! this is not decided yet
#### filters
## grab first find in context
#palace %{"/":"darkness"}*"space"+palace
## grab all of context
#palace %{"/":"darkness"}**"space"+palace
#!/usr/bin/env python
# DarkPoint - technomantic framework for mnemonic toolkit that is in accordance with singular principles of thought model system
# Copyright (C) 2024 Sett Sarverott <[email protected]> (https://sarverott.com)
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
from _helpers import EXAMPLE_HEADER
def EXAMPLE(palace):
EXAMPLE_HEADER(__name__, "basic quick hooking of new information")
# quick hooking of new information
palace["palace"] = (
"THE PALACE for mind is common place to put enormous ammounts of threads, so having infinite space in there is nice"
)
palace["color"] = "dark"
palace["templates"] = "templates for repetitive constructs"
palace["hook"] = (
"hooks are self-explanatory named reference to points with data mentioned by name"
)
palace["point"] = (
"information that is also node for hooks to recognized points with informations that are associated with this one"
)
palace["info"] = "data content of point"
#!/usr/bin/env python
# DarkPoint - technomantic framework for mnemonic toolkit that is in accordance with singular principles of thought model system
# Copyright (C) 2024 Sett Sarverott <[email protected]> (https://sarverott.com)
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
from _helpers import EXAMPLE_HEADER
def EXAMPLE(palace):
EXAMPLE_HEADER(
__name__, "chaining hooks into hooking path with quick data inserting"
)
# chaining hooks into hooking path with quick data inserting
palace["singular principles"] = "this is main set of rules"
palace["singular principles"][
"points are data"
] = "Each piece of information is represented as a point"
palace["singular principles"][
"Points have hooks"
] = "most common are point that has a hook."
palace["singular principles"][
"hooks are ended with points"
] = "The hooks lead to additional points, creating a chain of information."
palace["singular principles"][
"points are related by hooking"
] = "Informations are related by hooking. The connections between points are established through hooks."
palace["singular principles"][
"one direction of hook"
] = "Hooks are one-directional. The connections only go in one direction, leading from one point to another with evental resulting nature, not dimentional."
palace["singular principles"][
"templates of points"
] = "Points can be extended by templates. This is for type of information grouping and categorization - for point, that are similar to each other thay can have obvious associations with other points or standard procedures - these can be added through templates."
palace["singular principles"][
"starting point"
] = "Set starting point of each mindset. There is a designated starting point from which the connections begin that is easy to access by first thought about that topic."
palace["singular principles"][
"idea of thought palace"
] = "For The PALACE there is special starting point. this is root placed in the middle of memories, every time after reset or starting, the point of focus lands here. For example my palace is: `dark void` and reset for me runs through simply thinking about `darkness`."
#!/usr/bin/env python
# DarkPoint - technomantic framework for mnemonic toolkit that is in accordance with singular principles of thought model system
# Copyright (C) 2024 Sett Sarverott <[email protected]> (https://sarverott.com)
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
from _helpers import EXAMPLE_HEADER
def EXAMPLE(palace):
EXAMPLE_HEADER(__name__, "print test of come points")
print("#### DARKNESS")
print("\t", palace)
print("#### COLOR")
print("\t", palace["color"])
print("#### TEMPLATES ? ")
print("\t", palace["templates"])
#!/usr/bin/env python
# DarkPoint - technomantic framework for mnemonic toolkit that is in accordance with singular principles of thought model system
# Copyright (C) 2024 Sett Sarverott <[email protected]> (https://sarverott.com)
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
from _helpers import EXAMPLE_HEADER
def EXAMPLE(palace):
EXAMPLE_HEADER(__name__, "printing with for loop iterating")
# printing with for loop iterating
print("### DARKNESS; What's in here?")
for hooked, info in palace:
print(f"\t{hooked} --- {info}")
#!/usr/bin/env python
# DarkPoint - technomantic framework for mnemonic toolkit that is in accordance with singular principles of thought model system
# Copyright (C) 2024 Sett Sarverott <[email protected]> (https://sarverott.com)
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
from _helpers import EXAMPLE_HEADER
def EXAMPLE(palace):
EXAMPLE_HEADER(__name__, "grabing hook and printing with for loop iterating")
# grabing hook and printing with for loop iterating
print("### singular principles ")
for hooked, info in palace["singular principles"]:
print(f"\t{hooked} --- {info}")
#!/usr/bin/env python
# DarkPoint - technomantic framework for mnemonic toolkit that is in accordance with singular principles of thought model system
# Copyright (C) 2024 Sett Sarverott <[email protected]> (https://sarverott.com)
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
from _helpers import EXAMPLE_HEADER
def EXAMPLE(palace):
EXAMPLE_HEADER(__name__, "adding hooks to existing points")
# adding hooks to existing points
palace * "information" + palace["info"]
palace["hook"] * "point" + palace["point"]
# spaces are fluid thing
palace["singular principles"] * "THE PALACE" + palace
# for better readability i will play with spaced gaps
palace * "palace" + palace["singular principles"]["idea of thought palace"]
# this variant looks ok
palace * "what is that" + palace["palace"]
#!/usr/bin/env python
# DarkPoint - technomantic framework for mnemonic toolkit that is in accordance with singular principles of thought model system
# Copyright (C) 2024 Sett Sarverott <[email protected]> (https://sarverott.com)
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
from _helpers import EXAMPLE_HEADER
def EXAMPLE(palace):
EXAMPLE_HEADER(__name__, "hooking path can be looped")
print("### ABSOLUTE PATH TRAVERSAL")
palace["singular principles"]["THE PALACE"]["what is that"] * "example" + palace
print(
"\t\tcontent of palace['singular principles']['idea of thought palace']['example']:"
)
print(f"\t{palace['singular principles']['idea of thought palace']['example']}")
print("\t\tis it palace?")
print(
f"\t{palace['singular principles']['idea of thought palace']['example']==palace}"
)
#!/usr/bin/env python
# DarkPoint - technomantic framework for mnemonic toolkit that is in accordance with singular principles of thought model system
# Copyright (C) 2024 Sett Sarverott <[email protected]> (https://sarverott.com)
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
from _helpers import EXAMPLE_HEADER
def EXAMPLE(palace):
EXAMPLE_HEADER(__name__, "couple chaining examples")
# chaining example
palace["void"] = (
"void is emptyness, void is darkness, void is all that IS, void is default state of space"
)
# let's make some explaining presets for commentary before next example
# # # ~RULES~
# PALACE == darkness as root point
# [...label] == point's absolute path from PALACE
# point->other_point == hooking
# ---arguments == reason why that is hooked
# in this inline chain are several hookings
print(
palace * "darkness"
+ palace["void"] * "color"
+ palace["color"] * "space"
+ palace["void"] * "darkness"
+ palace
)
# ["darkness"]->["void"] ---darkness is void
# THEN
# ["void"]->["color"] ---void is dark
# THEN
# ["color", "space"]->["void"] ---dark space is void
# THEN
# ["void", "darkness"]->PALACE ---void is darkness
# ...and prints out data in last attached node in chain as latest result on top
# another inline hooking that fills some gaps in fallback nett around root of palace
palace["void"] * "space" + palace * "space" + palace["void"]
# ["void", "space"]->PALACE ---void space is palace
# THEN
# ["space"]->["void"] ---space in palace is void
#!/usr/bin/env python
# DarkPoint - technomantic framework for mnemonic toolkit that is in accordance with singular principles of thought model system
# Copyright (C) 2024 Sett Sarverott <[email protected]> (https://sarverott.com)
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
from _helpers import EXAMPLE_HEADER
def EXAMPLE(palace):
EXAMPLE_HEADER(__name__, "showing context and changing it")
print("\n### CONTEXT OF PALACE")
print(f"\t PALACE: {palace}")
print(f"\t CONTEXT: {palace.context}")
print("\n### Changing context")
print(f"\t method return value is SELF")
print(f"\t palace/'DARK_VOID' \n\t RETURNS \n\t '{ palace/'DARK_VOID' }'")
print(f"\tit's for optional involving it while chaining")
print(f"\t CONTEXT of palace: {palace.context}")
"""DarkPoint: technomantic memories framework for mnemonic forrests in darkness"""
# DarkPoint: technomantic memories framework for mnemonic forrests in darkness
# Copyright (C) 2024 Sett Sarverott <[email protected]> (https://sarverott.com)
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
FLAG = True
__all__ = [
'_9_context_change.py',
'_2_hooking_path.py',
'_1_quick_hooking.py',
'_8_chaining.py',
'helpers.py',
'_6_hook_existing_points.py',
'examples.py',
'_3_printing.py',
'_11_supreme_hooking.py',
'_helpers.py',
'_12_filters.py',
'_5_for_loop_with_hooking_path.py',
'_4_print_hooks.py',
'point_declaration.py',
'_10_multiple_context_change.py',
'_7_absolute_path_traversal.py'
]
if __name__ == "__main__":
if FLAG:
print(
"\n\n\t \33[7m ",
" \33[0m",
"\n\33[0m\t \33[7m █▀▄ ▄▀█ █▀█ █▄▀ █▀█ █▀█ █ █▄░█ ▀█▀ \33[0m",
"\n\t \33[7m █▄▀ █▀█ █▀▄ █░█ █▀▀ █▄█ █ █░▀█ ░█░ \33[0m",
"\n\t \33[7m \33[0m\n",
"\n\tDarkPoint ",
"Copyright (C) 2024 Sett Sarverott ",
"<[email protected]> (https://sarverott.com)",
"\n\tThis program comes with ABSOLUTELY NO WARRANTY;",
' for details read file "LICENSE".',
"\n\tThis is free software, and you are welcome to redistribute it",
"\n\tunder certain conditions of license GNU GPL v3.\n\n",
)
FLAG = False
print("darkpoint lounch")
else:
print("darkpoint import")
    2024 @ Sett Sarverott <[email protected]> (https://sarverott.com)

      █▀▄ ▄▀█ █▀█ █▄▀ █▀█ █▀█ █ █▄░█ ▀█▀   framework of technomantic memory system
      █▄▀ █▀█ █▀▄ █░█ █▀▀ █▄█ █ █░▀█ ░█░   for mnemonic forrest placed in darkness

    published under terms of GNU_GPLv3 license                                  

DarkPoint - implementation in Python

2024 @ Sett Sarverott

GitHub code size in bytes GitHub last commit GitHub License Python Version from PEP 621 TOML PyPI - Downloads PyPI - Python Version Pepy Total Downloads GitHub Downloads (all assets, all releases)

This Python framework aims to process information simply and universally. Idea of DarkPoint is based on my personal memorization structure and metaphorical explanation how it works.

Final version will be included in Mind Toolkit of Technomancer as Thought Model System with definition as Singular Principles that allows to create memory palace with startpoint in darkness.


thought model system overview

This is my personal way of thinking, that as natural mechanism is my default non-verbal thought behaviour. It's automatic and acts as my lowest-level coding method of mindsets. After years in process of clearyfication through trial and error I learned to explain how I'm thinking and why perspective of mine can sometimes terrifyingly stand out from other people. I uses simplifying and metaphores to define in the readers' imagination basic core of things and fundamental rules how it works. This README.md document is in my opinion still not enought clear, but i hope that soon I finally figure out how to close full fundations of mechanic's ruleset in human words.

singular principles

These are basic rules that are essential

  • Points have hooks: Each piece of information is represented as a point that has a hook.
  • On the end of hooks are next points: The hooks lead to additional points, creating a chain of information.
  • Every point is information: Each point represents a specific piece of information.
  • Informations are related by hooking: The connections between points are established through hooks.
  • Hooks are one-directional: The connections only go in one direction, leading from one point to another with evental resulting nature, not dimentional.
  • Points can be extended by templates: Each point can have additional context or details added through templates.
  • Set starting point: There is a designated starting point from which the connections begin.
  • For The PALACE there is special starting point: this is root placed in the middle of memories, every time after reset or starting, the point of focus lands here. For example my palace is: dark void and reset for me runs through simply thinking about darkness.
  • All templates to work properly have to be accessible from the starting point: These are declared as points too so all relevant information have be reached from the starting point.

installation

Install official release by using pip python package manager

pip install darkpoint

Examples

All examples can be tested at once, by using python ./examples/main.py

including package

# using points
from darkpoint.Point import Point

creating Point object

#creating new mnemonic sanctuary
palace = Point("darkness")

quick hooking of new information

palace["color"]="dark"

longer hooking path of new data

palace["color"]["time"]="dark time is night"
palace["color"]["time"]["always"]="night is always in space as default constant daytime"
palace["color"]["time"]["always"]["sun"]="local star for humanity"
palace["color"]["time"]["always"]["sun"]["far"]="suns in further space from our sun are simply called stars"
palace["color"]["time"]["always"]["sun"]["far"]["images"]="points created by stars on sky are constelations"

to print just type

print(palace)
print(palace["color"])

hooking existing points

# some hooking
palace   *"time"   +palace["color"]["time"]
palace   *"space"   +Point("natural state of space is darkness and empty void")
# more hooking
palace["space"]   *"time"   +palace["color"]["time"]["always"]
palace["space"]   *"stars"   +palace["color"]["time"]["always"]["sun"]["far"]

context change

# single
palace/'DARK_VOID'
# this and repeat with every hook until reaches another than old context
palace["space"]//'###_SPACE_CONTEXT_INVASION_###'

Links


Copyright (C) 2024 Sett Sarverott [email protected] (https://sarverott.com)

DarkPoint - technomantic framework for mnemonic toolkit that is in accordance with singular principles of thought model system 
Copyright (C) 2024   Sett Sarverott <[email protected]> (https://sarverott.com)

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.

Copy of License can be found in "LICENSE" file.

#!/usr/bin/env python
# DarkPoint - technomantic framework for mnemonic toolkit that is in accordance with singular principles of thought model system
# Copyright (C) 2024 Sett Sarverott (https://sarverott.com/) <[email protected]>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
flag = True
if flag:
print(
"\n\n\t \33[7m ",
" \33[0m",
"\n\33[0m\t \33[7m █▀▄ ▄▀█ █▀█ █▄▀ █▀█ █▀█ █ █▄░█ ▀█▀ \33[0m",
"\n\t \33[7m █▄▀ █▀█ █▀▄ █░█ █▀▀ █▄█ █ █░▀█ ░█░ \33[0m",
"\n\t \33[7m \33[0m\n",
"\n\tDarkPoint ",
"Copyright (C) 2024 Sett Sarverott ",
"<[email protected]> (https://sarverott.com)",
"\n\tThis program comes with ABSOLUTELY NO WARRANTY;",
' for details read file "LICENSE".',
"\n\tThis is free software, and you are welcome to redistribute it",
"\n\tunder certain conditions of license GNU GPL v3.\n\n",
)
flag = False
def EXAMPLE_HEADER(example_name, description):
print(
"\33[31m\r \n|",
"\r\n|---------------------------------------------",
f"\r\n|\t EXAMPLE: {example_name} ",
f"\r\n|\t --- {description} \r\n\x1b[0m\r ",
)
def IS_PACKAGE_INSTALLED():
print("\n|\n|--BEFORE LOUNCH CHECKUP begins")
output = None
try:
print("trying to import DarkPoint from package library...")
from point_declaration import Point
print("DarkPoint IMPORTED!")
print("checking if content of package is not blank...")
x = Point("dark void testing here", "DARKNESS - test scope")
print(" X = new Point ")
print(f"\tpoint X = '{x}'")
print(f"\tcontext of X = '{x.context}'")
except Exception as ISSUE:
print("\33[41m")
print("!!! ERROR !!!")
print("\t", ISSUE)
print("\t-TYPE: ", type(ISSUE))
print("\t-ARGS:\n\t\t", "\n\t\t".join(ISSUE.args))
print("~import-darkpoint~:: CHECKUP FAILS!")
print("\33[0m")
output = False
else:
print("\33[42m")
print("CHECKUP PASSED!\t\33[0m")
print("")
output = True
print("|--BEFORE LOUNCH CHECKUP ends\n|\n")
return output
#!/usr/bin/env python
# DarkPoint - technomantic framework for mnemonic toolkit that is in accordance with singular principles of thought model system
# Copyright (C) 2024 Sett Sarverott <[email protected]> (https://sarverott.com)
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# package installed checkup
from _helpers import IS_PACKAGE_INSTALLED
if not IS_PACKAGE_INSTALLED():
print("try next time after installing package")
print("\tSEE:")
print("\t\t- dev/unix/install-local.sh")
print("\t\t- dev/unix/install-public.sh")
print("\t\t- dev\\dos\\install-local.bat")
print("\t\t- dev\\dos\\install-public.bat")
exit(1)
# intro
from point_declaration import Point
palace = Point("darkness")
# all examples loading
from _1_quick_hooking import EXAMPLE as quick_hooking
from _2_hooking_path import EXAMPLE as hooking_path
from _3_printing import EXAMPLE as printing
from _4_print_hooks import EXAMPLE as print_hooks
from _5_for_loop_with_hooking_path import EXAMPLE as for_loop_with_hooking_path
from _6_hook_existing_points import EXAMPLE as hook_existing_points
from _7_absolute_path_traversal import EXAMPLE as absolute_path_traversal
from _8_chaining import EXAMPLE as chaining
from _9_context_change import EXAMPLE as context_change
from _10_multiple_context_change import EXAMPLE as multiple_context_change
# from _11_supreme_hooking import EXAMPLE
# from _12_filters import EXAMPLE
# example 1
quick_hooking(palace)
# example 2
hooking_path(palace)
# example 3
printing(palace)
# example 4
print_hooks(palace)
# example 5
for_loop_with_hooking_path(palace)
# example 6
hook_existing_points(palace)
# example 7
absolute_path_traversal(palace)
# example 8
chaining(palace)
# example 9
context_change(palace)
# example 10
multiple_context_change(palace)
"""DarkPoint's helper functions toolset file"""
# DarkPoint: technomantic memories framework for mnemonic forrests in darkness
# Copyright (C) 2024 Sett Sarverott <[email protected]> (https://sarverott.com)
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
def default_hard_chars_replacing():
"""default replacing matrix"""
return [
["\n", "\\n"],
["'", "\\'"],
['"', '\\"'],
["\b", "\\b"],
["\0", "\\0"],
["\t", "\\t"],
["\r", "\\r"],
["\\", "\\\\"],
]
def soft_string(input_str, hard_char_replacing=None):
"""replaces hard escaping chars with softer backslashed versions"""
output_str = None # better return nothing to indicade error
if hard_char_replacing is None:
hard_char_replacing = default_hard_chars_replacing()
for replacement in hard_char_replacing:
if output_str is None:
output_str = input_str
output_str = output_str.replace(replacement[0], replacement[1])
return output_str
"""DarkPoint's point class declaration file"""
# DarkPoint: technomantic memories framework for mnemonic forrests in darkness
# Copyright (C) 2024 Sett Sarverott <[email protected]> (https://sarverott.com)
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# from . import helpers
class Point:
"""DarkPoint's point class"""
ROOT = None
def __init__(self, data, context="dark void"):
if Point.ROOT is None:
Point.ROOT = self
self.data = data
self.context = context
self.hooks = {}
self.hook_name_buffer = context
def __str__(self):
return self.data
def __repr__(self):
return self.__str__()
##def __repr__(self):
##return f"<\"{helpers.soft_string(self.data)}\"-{self.context};{}
def __getitem__(self, key=None):
if key is None:
key = self.context
return self.hooks[key]
def __setitem__(self, key=None, data=None):
if key is None:
key = self.context
if data is None:
data = f"{Point.ROOT}"
self.hooks[key] = Point(data, self.context)
def __mul__(self, hook_name):
if isinstance(hook_name, Point):
self.hook_name_buffer = str(hook_name) # setting hook name
elif isinstance(hook_name, str):
self.hook_name_buffer = hook_name # setting hook name
else:
raise ValueError("non-Point adding is forbidden!")
return self
def __add__(self, point_to_hook):
if not isinstance(point_to_hook, Point):
raise ValueError("non-Point adding is forbidden!")
self.hooks[self.hook_name_buffer] = point_to_hook # setting point on hook
self.hook_name_buffer = self.context # context as default hook_name_buffer
return point_to_hook # Return hooked point for chaining
def __iter__(self):
return iter(self.hooks.items())
def __truediv__(self, new_context):
self.context = new_context # Change current context
return self # Return self for chaining
def change_context_recursively(self, new_context, old_context):
"""multiple hooked points can have changed context value with that"""
# print(f"### POINT // ###")
# print("\t", self)
# print(f"\t?-{self.context} == {old_context}")
if self.context == old_context:
# tmp = None
# print(f"\t\tchange context from {old_context} to {new_context}")
for hook_name, hooked_point in self / new_context:
if not hook_name == new_context and not hook_name == old_context:
# for future developement: this statement should have on/off
# switching with filter mechanics
hooked_point.change_context_recursively(new_context, old_context)
# print(f"\t\t...asking point hooked on {hook_name}")
# if hooked_point.change_context_recursively(new_context, old_context):
# tmp = hook_name
# return True
# else:
# print("\t\tno context change")
# return False
def __floordiv__(self, new_context):
if self.context != new_context: # infinite loop check
self.change_context_recursively(new_context, self.context) # submethod
return self
[project]
authors = [
{name = "Sett Sarverott", email = "[email protected]"},
]
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
"Natural Language :: English",
"Natural Language :: Polish",
"Development Status :: 1 - Planning",
"Environment :: Plugins",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"Intended Audience :: Religion",
"Programming Language :: Python :: Implementation",
"Programming Language :: Python",
"Topic :: Adaptive Technologies",
"Topic :: Artistic Software",
"Topic :: Communications",
"Topic :: Database",
"Topic :: Education",
"Topic :: Religion",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Artificial Life",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Scientific/Engineering :: Visualization",
"Topic :: Sociology",
"Topic :: Sociology :: History",
"Topic :: Software Development",
"Topic :: Software Development :: Documentation",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Libraries :: Application Frameworks",
"Topic :: System",
"Topic :: System :: Archiving",
"Topic :: System :: Archiving :: Compression",
"Topic :: System :: Clustering",
"Topic :: System :: Emulators",
"Topic :: System :: Filesystems",
"Topic :: System :: Networking",
"Topic :: System :: Operating System",
"Topic :: System :: Software Distribution",
]
description = "This Python framework is technomantic mnemonic toolkit of thought model system with singular principles that allows to create memory palace with start placing in darkness."
keywords = ["dark", "darkness", "memory"]
license = {file = "LICENSE"}
maintainers = [
{name = "Sett Sarverott", email = "[email protected]"},
]
name = "darkpoint"
readme = "README.md"
version = "0.1.0"
[project.urls]
Homepage = "https://github.com/sarverott/darkpoint"
Issues = "https://github.com/sarverott/darkpoint/issues"
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools >= 40.9.0",
]
[tool.poetry]
name = "darkpoint"
version = "0.1.0"
description = "ghost inside setternet"
authors = ["Sett Sarverott <[email protected]>"]
readme = "README.md"
[tool.setuptools.packages.find]
exclude = ['examples*', 'dev*', 'build*', 'tests*', '.github*']
include = ['src*']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment