A better way to dictionary
Version: 1.0.2
Build: Latest (Jan 25 2022 @ 3:11 PM EST)
Platform: Experimental (It might explode) (Things might be buggy)
- Added flags support, See the devGuide.
SCON (Pronounced: scone) is a versatile way for formmatting data and is loosely based on JSON, and can be used across multiple platforms.
*Examples can be found in the examples directory of the repo
str
int
bool
list
dict
NoneType
Put this as a key in the dictonary and the value will become a comment.
Creates and writes a SCON file from a dictionary.
- obj
- type: dict
- fp
- type: builtin_function_or_method
Make sure that fp is writable.
Creates a SCON file from a dictionary.
- obj
- type: dict
Returns a SCON string
Creates a dictonary from a SCON file.
- fp
- type: builtin_function_or_method
Make sure that fp is readable.
Return a namedtuple: data
contains the parsed SCON file, comments
contains the comments from the parsed SCON file.
Creates a dictonary from a SCON string.
- obj
- type: str
Make sure that fp is readable.
Return a namedtuple: data
contains the parsed SCON file, comments
contains the comments from the parsed SCON file.
Browse a SCON object like a POSIX file path.
ex. /test/name.str
Python Type | Extention |
---|---|
str | .str |
int | .int |
bool | .bol |
list | .lst |
dict | None (sub-dictionaries represented as directories) |
Creates a browsable object.
data can be types: str
,dict
Find value from a path in the dictonary
Gets the current directory.
Changes the current directory.
Opens the value to be read or written to.
NOTE!: Any changes made to the dictonary will not sync to the SCON file. (This feature will be added soon in the developer release)
-
Path
- type: str
-
Mode
- type: str
Returns a class similar to the builtin function open()
, the following methods are available.
- write()
- read()
- close()
Views the current directory tree or the directory specified in path
.
- path
- type: str
Returns contents of current or specifified directory
string="This is a string";
int=0;
true_bool=true;
false_bool=false;
nothing=null;
list=[0,1,2,3,4,5,6,7,8,9];
sub_dictionary0{
sub_value="I am a sub";
}
#Every line ends with semicolons execept for dictionaries. this comment will continue until you put a semicolon;
Happy database creation!
- Micropython port
Check out other builds such as developer
or Stable
©2022 Github73840134