
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
A package that assist with imports via drag and dropping of files so end users can run scripts with ease
Script that contains utility definitions common to most import scripts
Author: Alok M Date: 11/2015 Packaged by: Devin Akerley Date: 06/2024
This script contains some common function definitions that are needed by most python file import scripts. The goal of this script is to reduce the amount of coding required to generate a new file import script.
The anticipated usage is as follows:
include a line at the top of a specific script as follows:
from fileimport_util import *
Define specific functions to read an instrument file and write a corresponding clims file.
def read_file(filename): ...
def write_file(filename): ...
In both function definitions, the "filename" corresponds to the fully specified filename that the user has selected. If the user selects multiple files, these functions will be called once for each file. In these, if something goes wrong, the function should raise an exception; any data that needs to be communicated between these should be managed through global variables. Some commonly used filename parsing functions are imported:
Call the main function to kick off the processing
transform(read_file, write_file)
What you get from this file: - pre-imports of commonly used python modules - pre-imports of specific useful components of modules: - pprint() - OrderedDict() - dirname() Example: dirname("a/b/c/a.csv") => "a/b/c" - basename() Example: basename("a/b/c/a.csv") => "a.csv" - splitext() Example: file_part, extension = splitext("a/b/c/a.csv") => ("a/b/c/a", ".csv") - get_input_filenames: provides support to prompt user for filenames; - main(): supports drag/drop of files onto script; if none are provided, then prompts user; then alternates between calling read_file and write_file to process each. - Logger (LOG), useful for logging errors and warnings.
Change Log: AKM 11/2015: Created.
FAQs
A package that assist with imports via drag and dropping of files so end users can run scripts with ease
We found that fileimport-util demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.