Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

A library for tokenisable filename paths

Project description

A library for tokenisable filename paths

Full Documentation


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

Download files

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

Files for fptokens, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size fptokens-0.1.1-py2.py3-none-any.whl (6.4 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size fptokens-0.1.1.tar.gz (13.6 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