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 list of dictionaries as separate files in a directory.
dack.loadbatch will recursively load files in a directory and return a list of dictionaries.

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.2.tar.gz (5.0 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.2-py2.py3-none-any.whl (5.1 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: dack-0.1.2.tar.gz
  • Upload date:
  • Size: 5.0 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.2.tar.gz
Algorithm Hash digest
SHA256 9c225e51e1e50caa9653faeb7767f4b88a73af08f8765e43d00c31aa8209255b
MD5 710ad3524bd4e064574cba54fb3fbc05
BLAKE2b-256 106501481ea59cf07da87d092a81e878822e8d25970f3b9bf4d883cac0a19a55

See more details on using hashes here.

Provenance

The following attestation bundles were made for dack-0.1.2.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.2-py2.py3-none-any.whl.

File metadata

  • Download URL: dack-0.1.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.1 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.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 fe58d315a1cb2f24790c4b6ea7c6d3bcdb397de2ae7c424b5fc21bd6af8f46b7
MD5 471dc2f56404a9624a9fe2efa60e227f
BLAKE2b-256 602fb31ad7279d50f450686532c060359820def187115908b2f09a67756dc62a

See more details on using hashes here.

Provenance

The following attestation bundles were made for dack-0.1.2-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