Freeway is a module for managing file system structures with recursive pattern rules.
Project description
freeway
Freeway is a module for managing file system structures with recursive pattern rules.
Install freeway
This module can be installed from PyPi, as follows:
$ pip install freeway
Some usage examples
Examples require the RULESFILE environment variable to be set, which points to a JSON file that contains all the rule patterns to resolve the paths and nomenclatures. The file can be found at ‘freeway/examples/rules.json’
Parse data from path
from freeway import Freeway
filepath = "C:/example/assets/Characters/Roberto/MOD/Work/example_CH_Roberto_MOD.v001.abc"
myPath = Freeway(filepath)
# Show all parsed data
print(myPath)
Result:
['assetWorkspacePath']: {'assetType': 'Characters', 'asset': 'Roberto', 'process': 'MOD', 'stage': 'Work', 'assetPrefix': 'CH', 'task': 'MOD', 'version': '001', 'ext': 'abc'}
Use parsed data
print("%s_%s_%s_example" % (myPath.asset, myPath.assetType, myPath.task))
Results:
Roberto_Characters_MOD_example
Use parsed data for make new paths
print(myPath.assetDir)
Results:
C:/example/assets/Characters/Roberto
Make a path from data
data = {'assetType': 'Prop',
'asset': 'Table',
'process': 'MOD',
'stage': 'Work',
'assetPrefix': 'PR',
'task': 'MOD',
'version': '001',
'ext': 'abc'}
myPath = Freeway(**data)
print(myPath.assetWorkspacePath)
print(myPath.assetFile)
print(myPath.assetDir)
Results:
C:/example/assets/Prop/Table/MOD/Work/example_PR_Table_MOD.v001.abc example_Prop_Table_MOD_v001.abc C:/example/assets/Prop/Table
Modify parsed data to make new paths
other = myPath.copy()
myPath.stage = "Publish"
myPath.ext = "usd"
myPath.asset = "Chair"
print(myPath.assetWorkspacePath)
Results:
C:/example/assets/Prop/Chair/MOD/Publish/example_PR_Chair_MOD.v001.usd
Or also
other.update({"process": "SHD",
"ext": "mb",
"version": "123"})
print(other.assetWorkspacePath)
Results:
C:/example/assets/Prop/Table/SHD/Work/example_PR_Table_MOD.v123.mb
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
freeway-0.0.12.tar.gz
(8.1 kB
view details)
Built Distribution
File details
Details for the file freeway-0.0.12.tar.gz
.
File metadata
- Download URL: freeway-0.0.12.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9449987a90db068024df0f77318a0d21204040f63c99c084b07408bc39108de9 |
|
MD5 | 09f8f2ef16ffef195803c7e9c87087a5 |
|
BLAKE2b-256 | 8d5be665bc6279e4a8ec022198deeb3727d72e4d8340c7e8ab78615d5c00dec6 |
File details
Details for the file freeway-0.0.12-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: freeway-0.0.12-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 145.8 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 832670224306d6cb75236daa187520775309ffe114da9ece52483bfae377b100 |
|
MD5 | 01d187e52f87a804cb64a4edcd6b59e8 |
|
BLAKE2b-256 | 268f67f9ad939f21fbeefb04bb03a71bf7e59eff9b593fc4bc2ec4bde12f95bd |