Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KV perspectives for standard libs #53

Open
thorwhalen opened this issue Mar 6, 2020 · 1 comment
Open

KV perspectives for standard libs #53

thorwhalen opened this issue Mar 6, 2020 · 1 comment

Comments

@thorwhalen
Copy link
Member

thorwhalen commented Mar 6, 2020

Lots of the standard libs that come for free with python have, or could have, one or several read or read/write k/v perspectives.

We covered zipfile module with ZipReader already (still need to extend to ZipPersister), the csv module, but there's many more...

  • configparser
  • sqlite3
  • wave
  • chunk
  • zlib
  • gzip
  • bs2
  • lzma
  • tarfile
  • plistfile
  • dbm
  • mailbox.Maildir (mailbox.Mailbox already has a kv interface)
  • codecs

And of course, there's subsets of the modules that could use some kv interfaces. For example, consider inspect.Signature which contains some inspect.Parameter elements. Both dict-like.

As always, start as close to wrapped module as possible first, then transform/subclass/layer to create easier interfaces, consistency groups, or useful extensions.

Consider consistency groups of extensions. For example, any SpecificKvFileReader that takes a file as an input could be extended to a 'SpecificKvDirReaderwhose keys are the file paths or names of the directory and whose values areSpecificKvFileReader(file)`. It's a common useful pattern, so should be implemented as such.

@thorwhalen thorwhalen changed the title Stores for standard libs KV perspectives for standard libs Mar 6, 2020
@thorwhalen
Copy link
Member Author

linecache: Wrap to create list-like interface to file lines. If lines themselves are structured (such as csv), can go deeper in the list-like interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant