This package includes utility modules for datetime handling, file management, runtime tracking, etc.
Project description
PC_Utils
A collection of essential utilities for Productivity & Collaboration (P&C) services management, maintenance, and optimization of operational tasks. While applicable to services like Slack, these utilities are designed for broader P&C tasks.
Features
- Datetime Utility: Provides a
Datetimeclass with adate_to_epochmethod that converts a date string to an epoch timestamp. - File Management:
FileManagement.py: Contains aFileMgmtclass for file searching and moving. It also includes methods for reading CSV files into a list of Python dictionaries and creating a CSV file from a list of Python dictionaries.FileManagement_w_Azure.py: Similar toFileManagement.py, intended for Azure storage (currently under development and pending testing before production use).
- Email Extraction:
ObtainEmails.py: Containsget_email_addresses, a function that extracts unique email addresses from a given string.
- Runtime Tracking:
Runtime.py: Provides aRuntimeclass for calculating and displaying runtime information.
Installation
Install the package via pip:
pip install pc-utils
Usage
Import the relevant classes into your Python code:
from pc_utils.Datetime import Datetime
from pc_utils.FileManagement import FileMgmt
from pc_utils.FileManagement_w_Azure import FileMgmt as AzureFileMgmt
from pc_utils.ObtainEmails import get_email_addresses
from pc_utils.Runtime import Runtime
Example Usage
- Datetime Conversion:
from pc_utils.Datetime import Datetime dt = Datetime() epoch_time = dt.date_to_epoch("2025-03-11") print(epoch_time)
- File Management:
from pc_utils.FileManagement import FileMgmt fm = FileMgmt() fm..createOutputCSVfileFromListOfDictionaries(user_channels, fileName, start_msg = "> Writing results to file... ", no_file_created_msg = "> No channels found. No output file was created.")
- Email Extraction:
from pc_utils.ObtainEmails import get_email_addresses emails = get_email_addresses("Contact us at info@example.com and support@example.org.") print(emails)
- Runtime Tracking:
from pc_utils.Runtime import Runtime rt = Runtime() rt.print_time("\n> Start time:") <some code here> rt.print_time("\n> End time:") rt.print_runtime("> Total time:")
Contributing
Contributions are welcome! Feel free to submit pull requests with improvements, new features, or bug fixes.
License
This project is licensed under the MIT License.
Contact
For issues, feature requests, or questions, please open an issue in the repository.
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 pc_utils-0.1.0.post9.tar.gz.
File metadata
- Download URL: pc_utils-0.1.0.post9.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef7125e518a70f157af884035d4d8492fa293fb1e5a734e4ad7213fdbd5e4fbc
|
|
| MD5 |
4b780a86f1693df079d2b48629490862
|
|
| BLAKE2b-256 |
2fd6dae7e217ea9ed1f053a2a257a4fd75410b8b1ff86579d7764d82842c694e
|
File details
Details for the file pc_utils-0.1.0.post9-py3-none-any.whl.
File metadata
- Download URL: pc_utils-0.1.0.post9-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a29be62f5b7b81a4dc0ca90e21915f60363e2ba18214ac8936a9acb66c12c95f
|
|
| MD5 |
77375d90cd77b392f6786c393f98fb74
|
|
| BLAKE2b-256 |
e3ed7dc1c9bb94ec57150676e487826941c1ab2c50ed3aab1bf8f48a4acf546f
|