Skip to main content

Provides functionality for creating a new empty file with unique name

Project description

FileCreate

PyPI

Provides functionality for creating a new empty file with unique name.

The file_mask parameter may contain a sequence of hash marks '#' which will be substituted by a unique sequence number starting from 001.

Install:

$ pip install filecreate

Usage Samples:

from filecreate import FileCreate

# Create file using mask
# by default parameter leading_zeros=True and all hash signs are replaced with numbers
with FileCreate('test####.txt') as file:    # if test0001.txt does not exist - creates it
    file.writelines()                       # working with file descriptor as usual

with FileCreate('test####.txt', leading_zeros=False):   # will create file test1.txt
    file.writelines()                       

# if file cannot be created (maximum sequence reached) - FileExistsError exception is raised

# Get available file name without creating an actual file
filename = FileCreate.get_filename('Folder', 'test###.txt')

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

filecreate-0.0.7.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

filecreate-0.0.7-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file filecreate-0.0.7.tar.gz.

File metadata

  • Download URL: filecreate-0.0.7.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.1.2 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

File hashes

Hashes for filecreate-0.0.7.tar.gz
Algorithm Hash digest
SHA256 1d955ebb90c3fd651603c1390686541ed652bec604a682459e9771a286d51842
MD5 beb2dc138e193394b62f48cb9452c8f7
BLAKE2b-256 19892ad7b2f3549f0e5ba22f366d6f05ffd59795be60d9c62d57c9fcb8d683f2

See more details on using hashes here.

File details

Details for the file filecreate-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: filecreate-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.1.2 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

File hashes

Hashes for filecreate-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 9197c77874339ab70f249750c35a245de112f257017542458080a6acd2597151
MD5 785a00d8de1eb99a2faf3bdd6528ce52
BLAKE2b-256 49f3f495eb72355636604961472326d25dc0c03d21ce4fc219bbd2930eb71b65

See more details on using hashes here.

Supported by

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