Skip to main content

Dictionary like access to the filesystem.

Project description

FSDict

Design principles

  1. Every key of a fsdict must be of type 'str' or 'FunctionType'.
  2. A fsdict may not be part of a list.
  3. A fsdict may contain other fsdicts.
  4. Dictionaries in python are passed by reference; so are fsdicts. By default an fsdict is always passed by refernece. That is, its values are not copied but the fsdict is symlinked to the new position.

Internals

Keys of type 'str' work just as normal dictionary keys. Keys of type 'FunctionType' are used as filters for the keys of an fsdict. So

dictionary[lambda key: "foo" in key]

would return a generator which yields the values for keys which contain the string 'foo'.

Possible value types and how they are handled:

  • fsdict - a directory
  • 'bytes' type - written to file as is
  • any other python object (except for 'bytes') - pickled

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

filesystem-dict-0.1.7.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

filesystem_dict-0.1.7-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

Supported by

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