Skip to content

jgrey4296/jgdv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

606 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deja Vu

Author: John Grey Date : 2024-03-04

Overview

I keep writing these things.

Examples

ChainGuard

With Toml Data:

   key = "value"
   [table]
   key = "other value"
   sub = {key="blah"}
data = ChainGuard.load("some.toml")
# Normal key access
data['key'] == "value"
# Key attributes
data.key == "value"
# Chained key attributes
data.table.sub.key == "blah"
# Failable keys
data.on_fail(2).table.sub.key() == "blah"
data.on_fail(2).table.sub.bad_key() == 2

Strang

example : Strang = Strang("head.meta.data::tail.value")
# Regular string index access:
example[0] == "h"
example[0:4] == "he"
# Section access:
example[0,:] == "head.meta.data"
example[1,:] == "tail.value"
example[0,0] == "head"
example[1,0] == "tail"

About

I've Written This Before

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors