Skip to main content

Wyatt's Data Storage Format

Project description

Wyatt's Data Storage Format (WDSF)

What Is It?

WDSF is a data storage format that uses text:key pairs. This is similar to JSON, but unlike JSON it is partially programmatic. WDSF Files are internally converted to Dictionary objects so they can be easily used in a program. Currently, it can be modified by using the official python library.

How to write a WDSF file

A WDSF file is simple enough that it can be written by hand. Heres how to write one: All files must be started with a header:

#WDSF1.0

This is the most simple data structure:

key|value

That is it. But, there is also a list type:

!LIST|LIST_NAME:
1
2
3
4
5
6
7
8
9
10
!LIST_END

There is also a programmatic way to use WDSF, similar to Flask's Template Rendering System:

COOL_DATA|!#FUNC:x*y

These arguments will be passed and evaluated at time of reading:

wdsf_file.read(args=[["x", 10], ["y", 20]])

For compatibility reasons, all data types (excluding lists) are treated as strings.

Library Documentation

Reading a WDSF file and convert it to a Dictionary object:

import wdsflib
wdsf_file = wdsflib.WDSFFile(file_name)
wdsf_data = wdsf_file.read() #Returns a dictionary that can be used in wdsf_data.get('key')

Transmutation of a file is a process that converts a WDSF file into a JSON file it can be used like this:

import wdsflib
wdsf_file = wdsflib.WDSFFile(file_name)
wdsf_file.transmute("output.json")

And there is a function that can do the opposite:

import wdsflib
dict_object = {
    "key": "value"
}
#Convert the dictionary to a WDSF file
wdsflib.convert_to_wdsf(dict_object, f"{file_name}.wdsf")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wdsf-1.0.0.tar.gz (40.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wdsf-1.0.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file wdsf-1.0.0.tar.gz.

File metadata

  • Download URL: wdsf-1.0.0.tar.gz
  • Upload date:
  • Size: 40.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for wdsf-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2c5d588eda25508c98ab9b5ceac5a37f87335cc8ec38291b72b6cc21d2d4ae72
MD5 7e0ea6ea67094fb52be8e5d08aba4f0e
BLAKE2b-256 5d2123cdee7a9da6c87739a747bbe36ecd8e2984c0decb83d315fa6aa8e67e6b

See more details on using hashes here.

File details

Details for the file wdsf-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: wdsf-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for wdsf-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aec81f0c0a0dfbfc484f40c09cd01b37164a4a2028f06029926c82b497cca39a
MD5 06163d086bf4473a1eb872ac425bdd18
BLAKE2b-256 6aae67461d2d35234119384c46966596dd15f31a5695f9014670130a3bc3d4b6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page