A simple Data storage language
Project description
WDay (Whirl Data, alternative to YAML)
A simple Data storage alternative to json and yaml
How to use?
You just call the module by the read() function to read the data..
example:
>>> import wday
>>> data = 'Windows::['v11'::{'quality':['best','great']}]'
>>> print(wday.read(data))
{'Windows': ['v11', {'quality': ['best', 'great']}]}
DOCS for WDay:
there's not much to learn here.. just look at the simple syntax
Name::[value1::[list_item_1,list_item_2]::{dictonary_key_1:dictonary_key_1_value}]
That's soooo simple!
- But what is the separator as an alternative to comma ","?
the "::" that you can see is the separator for the data values..
- What if my data has square brackets? or "::"?
that's simple use a :: in place of "::" and [, ] in place of "[" or "]"
- what about comments?
Commented lines start with '~' and there is no inline comment as of now
- What is the line beginning with
@
?
that is a remark..
EXAMPLE DATA:
~ this is a comment as you know...
wday::["v1"::{"by":"Whirlpool programmer"}]
~ EXAMPLE 2:
~ Python File runner as configured in WhirlEdit 2.0 by default:
Python::[".py"::"python $file"]
Special Function script()
:
So.. There is a special function called "script()" which makes wday a language..
in script, you give it a script which it runs.. it has its own specific rules..
- every line has to end in ';'
- example
if..else..
statement:if (name=="hello"): console.put('is "hello" a name?!');
- to use a variable from outside of a function, it should be made
global variable
..
example:
@config.theme
Themefolder::['./Themes/']
DefaultTheme::['azure-dark.whTheme']
@config.scheme/highlight
Schemefolder::['$default']
DefaultScheme::['azure']
@config.font
Font::['Consolas'::12]
'''
def function(*args):
global entry;
global name;
if (entry.get() == "windows"):
console.put('hello MS-Windows!');
name.set('MS-Windows');
else:
console.put('hi..');
name = StringVar();
name.set('none..');
entry = gui.Entry(window);
entry.grid();
btn = gui.Button(window,text="check?",command = function);
btn.grid();
label = gui.Label(window,textvariable = name);
label.grid();
window.mainloop();
'''
As you can see..
It also has gui functionalities.. inspired from Tkinter..
and remember..
the main data of the file is stored in a variable called init
..
so you can use this program too:
Whirledit::['v1'::'v2'::'v3']
'''
#HERE STARTS THE PROGRAM!
console.put(init);
# as you remember, init is the data..
'''
OUTPUT:
{'@': [], "Whirledit":['v1', 'v2', 'v3']}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file wday-2.0.5-py3-none-any.whl
.
File metadata
- Download URL: wday-2.0.5-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48b76a933e9d2cdabb8455c87fca371e2ea1530ec25f3ef71504e6170fde02ae |
|
MD5 | 850a28d8a137efdc50b47e97691c0f97 |
|
BLAKE2b-256 | f5b62ef15032d265e0f3e891056e955c0ad98a33a90dcf4fb15c2b411e0f7425 |