generate file name from file info
Project description
namefile
Install
pip install namefile
Usage
from namefile import namefile, parse
filename = namefile(
stem='glue-cola',
suffix='csv',
tags=('classification', 'processed'),
date=True,
version='1.2.0.post1'
)
# filename: 'glue_cola-classification-processed.20220829.1.2.0.post1-v.csv'
fileinfo = parse(filename)
# fileinfo: FileInfo(stem='glue_cola', suffix='csv', tags={'classification', 'processed'}, date=datetime.datetime(2022, 8, 29, 0, 0), version=<Version('1.2.0.post1')>)
assert filename == fileinfo.name() == str(fileinfo)
Development
conda env
conda env create
poetry
poetry install
Makefile
# 帮助文档
make help
# 格式化代码
make style
# 静态检查
make lint
...
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
namefile-0.3.1.post0.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for namefile-0.3.1.post0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0d1599e72b4ec8fc1bf7f8e9be433ebdc1228d8eaaa59e1cdf95389ae38bf76 |
|
MD5 | 19001b3633894870398bb0e3f77434f3 |
|
BLAKE2b-256 | 7913c04f4dbc264fbcc22a29c591cf72be296569aaa60009e5bfadabf8c52a5f |