A utility library for managing and processing files.
Project description
📦 managed-file-py
A lightweight Python utility library for loading, exporting, duplicating, and managing dataset files.
Supports CSV & Excel loading, safe filename generation, exporting with clean directory structure, and CLI tools.
🚀 Features
- Load datasets from CSV and Excel (.xlsx, .xls)
- Export pandas DataFrames to CSV
- Auto-generate safe filenames (
safe_filename) - Duplicate files with customizable count
- Auto-create output directories
- Clean CLI tools:
duplicate-fileexport-file
- Full pytest test suite
- Minimal & clean dependencies
🧰 Requirements
| Component | Version |
|---|---|
| Python | 3.9 – 3.12 |
| pandas | Latest stable |
Tested on:
- Python 3.9
- Python 3.10
- Python 3.11
- Python 3.12
📥 Installation
Install from PyPI
pip install tools-managed-file-py
Install from GitHub
pip install git+https://github.com/madamroger007/python-tools.git
Local Development
pip install -e .
📘 Usage
🔹Load a Dataset
from tools_managed_file.exporter import load_dataset
df = load_dataset("data.csv")
print(df)
🔹Export a Dataset to CSV
from tools_managed_file.exporter import export_dataset
import pandas as pd
df = pd.DataFrame([
{"name": "Adam", "age": 20},
{"name": "Sarah", "age": 22}
])
output = export_dataset(df, "outputs", "student-data")
print("Exported to:", output)
Generates:
outputs/student-data.csv
🔹Duplicate a File
duplicate-file input.csv --count 5
Creates:
input_copy_1.csv
input_copy_2.csv
input_copy_3.csv
input_copy_4.csv
input_copy_5.csv
🔧 CLI Commands
✔ Exporting
export-file input.xlsx --output out --name cleaned
✔ Exporting
duplicate-file report.pdf --count 3
🔧 CLI Commands
This project follows Semantic Versioning (SemVer).
0.1.0 — Initial Release
- Dataset loader (CSV & Excel)
- CSV exporter
- Filename sanitization
- File duplicator
- CLI utilities
- Full pytest suite
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file managed_file_py-0.0.1.tar.gz.
File metadata
- Download URL: managed_file_py-0.0.1.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92df7fcc694bf0a536b8a93babcab0ecc8c9c08863a19546af46b172fc03c9c0
|
|
| MD5 |
22e94d8f4629c6d79ca69d8929c8286e
|
|
| BLAKE2b-256 |
591d860a1a012504c012e99257532fd5c6a0e07d6395afb568e1cd972c573d13
|
File details
Details for the file managed_file_py-0.0.1-py3-none-any.whl.
File metadata
- Download URL: managed_file_py-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2755ef34d125a4955cd498d208438d348489f136696aa1e012dee536eb6e42bc
|
|
| MD5 |
963400e7dac83de19a24120957fd2c3c
|
|
| BLAKE2b-256 |
f9578ec13ccc8d73e1c6b6317907eeaf873d0fe24df99fe914e2ce24f8e435a2
|