Skip to main content

agm_io_utils

This package provides some more complex functions e.g. for looking for files and creating unique filenames.

Install:

pip install agm_io_utils

Example 1:

from agm_io_utils import io_utils

p = r"C:\Users\micro\OneDrive\Dokumente"
result_list = io_utils.get_all_files_recursively_from_path(path=p,
                                                           file_extensions=[".xmind"],
                                                           not_allowed_in_files_name_list=["test", "optional"],
                                                           not_allowed_in_path_string_list=["duplicate"],
                                                           must_be_a_part_of_files_name_list=["python"])
for file_name in result_list:
    print(file_name)

Output:

2 files found in folder 'C:\Users\micro\OneDrive\Dokumente'
C:\Users\micro\OneDrive\Dokumente\Python.xmind
C:\Users\micro\OneDrive\Dokumente\wmr\Wissen\Python.xmind

Example 2:

Explanation: Sometimes you get a path to a file through user input. Now the following has to be done:

  1. Check whether the file type specified by the user is actually the correct one (e.g. '.txt')
  2. Test whether the file actually exists
  3. To save the original file from being changed, find a new file name for the target file.
    A postfix can either be appended here or, if no postfix is specified, a time stamp is automatically appended. In any case, it must be ensured that the target file does not yet exist in the file system. If so, count up the file name with an additional index.
from agm_io_utils import io_utils

    path_to_file = r"C:\Users\micro\OneDrive\Dokumente\clean_this_xminds.txt"  
    
    new_filename = io_utils.check_path_and_return_new_file_name_with_postfix(path=path_to_file, extension="txt", postfix="tested")
    print(new_filename)

Output:

C:\Users\micro\OneDrive\Dokumente\clean_this_xminds_tested_06.txt

Metadata

Release files for agm-io-utils 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agm-io-utils 0.0.6
File Size Uploaded Provenance
agm_io_utils-0.0.6.tar.gz 4.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for agm-io-utils 0.0.6
File Interpreter ABI Platform
agm_io_utils-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 8.9 kB

Release files / agm_io_utils-0.0.6.tar.gz

Download URL agm_io_utils-0.0.6.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a69f05953b1b78cd83b220166d175327e736bac9c22d3251bc962baddb60afae
BLAKE2b-256 checksum
How to use checksums
a495dbbd6781c9c72dee8ff4faab0d3b7e0b2b1f606b2afb6b030fda20a9d8d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.7.3

Release files / agm_io_utils-0.0.6-py3-none-any.whl

Download URL agm_io_utils-0.0.6-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e47d952ee7b8e2b1b10da16044022a4b6fd30f938900ee332024aa36316941cf
BLAKE2b-256 checksum
How to use checksums
9faf2e2c8bf69339297599273efe9c1ad9ffddae91958d68f7858f244323f68f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.7.3

Security for agm-io-utils 0.0.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page