Skip to main content

A tool for giving meaningful names to file and directory paths

Project description

# Onde

Onde ('OWN-jee') is a simple Python tool for naming and referencing file and directory paths meaningfully.

## Usage
Install Onde with pip:

`pip install onde`

To use Onde, create a YAML file named `paths.yml` in the root directory of your project that maps important files and directories to convenient aliases that you can use to refer to those files.

- some_alias:
- "/some_absolute_path/some_file.txt"
- another_alias:
- "some_relative_path/another_file.txt"
- A third alias:
- "~/some_folder/a_file.txt"

You then use Onde by instantiating it and calling `paths`:

>>> from onde import Onde

>>> onde = Onde()

>>> onde.path('some_alias')

>>> onde.path('another_alias')

>>> onde.path('A third alias')

Paths can include variables, which are wrapped in curly braces. When calling `paths()` you can fill in the variables:

- my_alias:
- path:
- "/{my_directory}/{my_file}.txt"

>>> from onde import Onde

>>> Onde().path('my_alias', 'hey_there', my_file='hows_it_going')

Directories can be nested, to make it easy to refer to represent multiple significant locations within a file system:

- top_level:
- "some/folder"
- thing1:
- "path/to/child_1"
- thing2:
- "path/to/child_2"
- deeply_embedded_thing:
- "deeply/embedded/thing.txt"

>>> from onde import Onde

>>> onde = Onde()

>>> onde.path('top_level')

>>> onde.path('thing1')

>>> onde.path('thing2')

>>> onde.path('deeply_embedded_thing')

Aliases must be unique within the paths YAML file. Attempting to import a YAML file with duplicate aliases will raise an exception.

Path variables must also be unique for each path.

A well-formed Onde paths file should be in the format:
- alias:
- 'path_segment'
- child_alias:
- 'path_segment'
- child_alias:
- 'path_segment'

Each mapping has a single alias as its key and a list as the value of that key. The first item in the list is a

## Contributing
Pull requests are welcome!

To install: `python install`
To run tests: `python test`

## License
Onde is written by Aaron Knight <>. It is released
under the MIT license. See the LICENSE.txt file for more details.

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 onde, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size onde-0.1.1-py3-none-any.whl (5.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size onde-0.1.1.tar.gz (4.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page