Skip to main content

A comprehensive utility library for Python

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyswisslib-1.0.1.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyswisslib-1.0.1-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file pyswisslib-1.0.1.tar.gz.

File metadata

  • Download URL: pyswisslib-1.0.1.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pyswisslib-1.0.1.tar.gz
Algorithm Hash digest
SHA256 ad15f2a85ec6f3e862f35b6a611599421099b83fea5efbf63f315493eaeff5af
MD5 c3ca4ecff8413a1513c265c2c778b231
BLAKE2b-256 d16385dece780e1efb87e88409d9484e032f454afbdc0bc4880db23496baddcc

See more details on using hashes here.

File details

Details for the file pyswisslib-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pyswisslib-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pyswisslib-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f7924229f441bc98ce3d75b0be8e9785102aaf9d6d052496d3b77dc81a4dce2c
MD5 654bd4f2ebf9b971f893cfedc8025d3e
BLAKE2b-256 cc2a396994bd27cea869619aa3a2819a4b223cc8980aa8843830cc7e3d740826

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page