Skip to main content

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


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)

Uploaded Source

Built Distribution

namefile-0.3.1.post0-py3-none-any.whl (3.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page