File
- class naming.File(name='', sep=' ')[source]
Inherited by:
naming.PipeFile
File Name objects. All named files are expected to have a suffix (extension) after a dot.
Field
Characters
suffix
Any amount of word characters
- Example:
>>> from naming import File >>> class MyFile(File): ... config = dict(base=r'\w+') ... >>> f = MyFile() >>> f.get() '{basse}.{suffix}' >>> f.get(suffix='png') '{base}.png' >>> f = MyFile('hello.world') >>> f.values {'base': 'hello', 'suffix': 'world'} >>> f.suffix 'world' >>> f.suffix = 'abc' >>> f.name 'hello.abc' >>> f.path WindowsPath('hello.abc')