PySwissLib - A Comprehensive Python Utility Library
PySwissLib is a versatile Python library designed to streamline common programming and data-related tasks. It offers a structured collection of modules for system operations, string manipulation, mathematics, data science, visualization, file handling, and more. Authored by Gautham Nair, this library aims to be a single, convenient toolkit for developers and data scientists.
Installation
You can easily install pyswisslib using pip.
pip install pyswisslib
This command will automatically install all required dependencies, including numpy, pandas, matplotlib, seaborn, torch, scikit-learn, and requests.
Core Features
1. General Utilities (pyswisslib.basic)
- System and Platform Info: Get details about the operating system and Python version.
- Screen Clearing: A cross-platform function to clear the console.
- Package Installation: Install new Python packages directly from your script.
2. String & Math (pyswisslib.string, pyswisslib.math)
- String Manipulation: Perform common operations like string comparison, word counting, and palindrome checks.
- Mathematical Functions: Calculate factorials, check for prime numbers, and generate Fibonacci sequences.
3. Data Science (pyswisslib.datascience)
- DataFrames: Create and manipulate Pandas DataFrames from various sources.
- Statistical Analysis: Get descriptive statistics and calculate correlation matrices.
- Array Operations: Utilize NumPy for efficient array creation and statistical summaries.
4. Visualization (pyswisslib.visualization)
- Plotting: Generate a variety of plots, including line, bar, scatter, and histograms, using Matplotlib and Seaborn.
- Heatmaps: Visualize data correlations with heatmaps.
5. File & Network (pyswisslib.filehandler, pyswisslib.network)
- File Handling: Read, write, and manage files and directories easily.
- Network Utilities: Ping hosts and fetch JSON data from URLs with built-in caching.
6. AI & Machine Learning (pyswisslib.aiml)
- PyTorch Integration: Access PyTorch utilities for model training and evaluation.
- GPU Detection: Automatically detect and utilize available GPUs for accelerated computing.
Usage Example
The library is designed for simple imports and static method calls.
import pandas as pd
from pyswisslib import string, math, datascience, visualization, aiml
# String and Math
my_string = "Hello, PySwissLib!"
print(f"Word count: {string.word_count(my_string)}")
print(f"Is 13 prime? {math.is_prime(13)}")
# Data Science
try:
data = {'numbers': [1, 2, 3, 4, 5], 'squares': [1, 4, 9, 16, 25]}
df = datascience.create_dataframe(data)
print("\nDataFrame statistics:\n", datascience.basic_stats(df))
# Visualization
visualization.line_plot(df['numbers'], df['squares'], title="Numbers vs. Squares")
except Exception as e:
print(f"An error occurred: {e}")
# AI/ML - Get the best available device
try:
device = aiml.get_device()
print(f"\nUsing device: {device}")
except Exception as e:
print(f"An error occurred: {e}")
Author
- Gautham Nair
Metadata
Release files for PySwissLib 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyswisslib-1.0.1.tar.gz | 8.6 kB | Without provenance | Details for pyswisslib-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyswisslib-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for pyswisslib-1.0.1-py3-none-any.whl |
Total release size: 17.2 kB
Release files / pyswisslib-1.0.1.tar.gz
| Download URL | pyswisslib-1.0.1.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ad15f2a85ec6f3e862f35b6a611599421099b83fea5efbf63f315493eaeff5af
|
|
BLAKE2b-256 checksum How to use checksums |
d16385dece780e1efb87e88409d9484e032f454afbdc0bc4880db23496baddcc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / pyswisslib-1.0.1-py3-none-any.whl
| Download URL | pyswisslib-1.0.1-py3-none-any.whl |
|---|---|
| Size | 8.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f7924229f441bc98ce3d75b0be8e9785102aaf9d6d052496d3b77dc81a4dce2c
|
|
BLAKE2b-256 checksum How to use checksums |
cc2a396994bd27cea869619aa3a2819a4b223cc8980aa8843830cc7e3d740826
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for PySwissLib 1.0.1
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.