A library for tokenisable filename paths
Project description
A library for tokenisable filename paths
Installation
To install fptokens, type:
$ pip install fptokens
Getting Started
To get started with fptokens, type:
>>> import fptokens as fpt
To create a file name, type:
>>> filename = fpt.Filename(root='/Users/demo/Desktop',
folders=['assets', '$colors$'],
base=['asset', '$colors$', '1200px'])
This created a file name with default settings, _ as the separator, jpg as the extension and $ as the escape character for the tokens.
To parse and convert the tokens of the file name to actual tokens, type:
>>> filename.parse()
To get the results of the parsing, type:
>>> print filename.tokens
>>> [<Token: $color$>]
The list of tokens could now be used to create permutations of the tokenised file name for example for batch output of image assets.
Once tokens have been replaced with real-world data to create permutations, the relevant folders can be created by typing:
>>> filename.make()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file fptokens-0.1.1.tar.gz
.
File metadata
- Download URL: fptokens-0.1.1.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5254cb6cae5f3e26552b94f8910b23de0babfd6082688180284326edcbd8fc2c |
|
MD5 | e148d08dac7bc6db4b49f6dbf4105484 |
|
BLAKE2b-256 | 0a1e26d26df8e6592cf1d4faae416a2b78b4325593a44ba8f2aa39ef2a71f081 |
File details
Details for the file fptokens-0.1.1-py2.py3-none-any.whl
.
File metadata
- Download URL: fptokens-0.1.1-py2.py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03ec40d1594b238ffcc1ffb0c991ac38471406b6024a8dffe9aa3087409609c7 |
|
MD5 | 11fa5c8b6019c1c4a88e9527e65d5d9e |
|
BLAKE2b-256 | 8f85554fa379ca0e8e2311c7d66a1e62133d432d52504b8231856e558d863a56 |