Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Load folder contents into object or dict

Project description

filemap - processing Kubernetes-style config maps and secrets

What's this

filemap is a Python module for comfortable processing of Kubernetes-style config maps and secrets, mounted as the volumes.


When connected as volumes, Kubernetes config maps and secrets are single-level directory, where files are keys and file contents are values.

Basic usage

When loaded, inside FileMap object, keys are transformed into fields and namespaces, field trees are formed with the dots in file names, as:

  • somekey =>
  • some.key =>
  • some.another.key =>


from filemap import FileMap

config = FileMap('/etc/config')


Note: when text data is loaded, it's automatically right-stripped.

Getting single key by name


Serialization to dict

When serialized, FileMap object is transformed into dict:

data = config.serialize() # or
data = dict(config) # does the same

Combining multiple volumes

FileMap object can be updated multiple times with content from the different data folders:

config = FileMap()


If the same keys exist in different volumes, newer keys override the older ones.

Loading binary data, numbers, JSON

Refer to library pydoc for more info


pip3 install filemap

Project details

Download files

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

Files for filemap, version 0.0.7
Filename, size File type Python version Upload date Hashes
Filename, size filemap-0.0.7.tar.gz (3.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page