This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

There are some common concepts for application data on linux. Config files, for example, are typically located in /etc/ and in ~/.config/ with the latter taking precedence.

It is a bit awkward in small projects to implement this behavior. So this library is meant to help with that.


Load config:

config_path = lxpath.config('myproject', first=True)
with open(config_path) as fh:

Update existing config:

config_dir = lxpath.config('myproject', can_write=True, first=True)
with open(config_path, 'w') as fh:

Write new cache file:

cache_dir = lxpath.cache(can_write=True, first=True)
cache_path = os.path.join(cache_dir, 'myproject')
with open(cache_path, 'w') as fh:

Get the root of a git repository:

git_path = lxpath.local('.git', first=True)
root_path = os.path.dirname(git_path)

List all icon dirs:

for path in lxpath.share('icons'):


All functions in this module share the same signature:

config(subpath=None, can_read=True, can_write=False, dot_d=False, first=False)


subpath : search for this subpath in all dirs

can_read : remove all paths that the user can not read

can_read : remove all paths that the user can not write

dot_d : if file foo is included, also include all files in foo.d

first : return first match instead of iterator


config() : Search in common config dirs.

share() : Search in common shared data dirs.

cache() : Search in common cache dirs.

local() : Search from local directory upwards.

root() : Search in /.


  • When subpath is set, ~/.{subpath} will be considered in all the functions. So for example config('netrc') may yield ~/.netrc and share('icons') may yield ~/.icons/ (which is desired). But config('icons') will also yield ~/.icons/ and share('netrc') will also yield ~/.netrc (which is not).
Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
lxpath-0.0.0.tar.gz (3.1 kB) Copy SHA256 Checksum SHA256 Source Apr 9, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting