Skip to main content

Dack is a file format that can be stored in any text file

Project description

Dack is a file format that can be stored in any text file, but will default to .cfg.

Dack primarily stores key value pairs or dictionaries. The syntax are thusly:
&>KEY:VALUE

Anything after &> and before : is a key.
Anything after the first : and before the next &> is a value.

The key may contain anything except &> or :, leading or trailing whitespace will by stripped.
The value may contain anything except &>, leading or trailing whitespace will by stripped.

If there is a &> without an associated : then it will be ignored, effectively acting as comments.
If the file contains duplicate key entries the first one will be used and the rest ignored with a warning.

This format has many benefits:

  • Very simple and readable
  • Very flexible and hard to break
  • Doesn't feel tedious to type in
  • Works with any text document filetype
  • Highly portable, won't break being posted in markdown or on social media

Dack has 10 public functions that are outlined here:

dack.to_pydict will convert a string of the Dack format into a python dict.
dack.from_pydict will convert a python dict into a string of the Dack format.
dack.save dack.load will save or load a dict to or from a file using that file's path.
dack.saveas dack.savefile dack.loadfrom dack.loadfile are like overrides for the save and load functions;
saveas and loadfrom only need the name of the file, savefile and loadfile needs the file name with it's extension.
dack.savebatch will save a dict of dictionaries as separate files in a directory.
dack.loadbatch will load files in a directory and return a dict of dictionaries, option to load recursively or not.

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

dack-0.1.3.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

dack-0.1.3-py2.py3-none-any.whl (5.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file dack-0.1.3.tar.gz.

File metadata

  • Download URL: dack-0.1.3.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dack-0.1.3.tar.gz
Algorithm Hash digest
SHA256 c339ebb72a9e12d1742475dfd6473e439cf8606bd473acfc711df6b97db0bff8
MD5 f28c6f09c9a7a3e46ace88bbaaf5a4d8
BLAKE2b-256 ee430ae09e4c7bdd193a41282972ad4dd2e082cd6377ae681555bdff93016c23

See more details on using hashes here.

Provenance

The following attestation bundles were made for dack-0.1.3.tar.gz:

Publisher: python-publish.yml on Wirlocke/dack

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dack-0.1.3-py2.py3-none-any.whl.

File metadata

  • Download URL: dack-0.1.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dack-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2e40f365ec7bbb2fc4dc96a1f20999809e1d5b9705a75140c1a75dc84d29ee15
MD5 e1a6fd4df813bc003108b1c75ad6394c
BLAKE2b-256 cf1af8729ddb34225b8c4b432f344ab431d2f5c53527f254eaf4e726f696f850

See more details on using hashes here.

Provenance

The following attestation bundles were made for dack-0.1.3-py2.py3-none-any.whl:

Publisher: python-publish.yml on Wirlocke/dack

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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