Skip to main content

DevSetGo Library is a Python library offering reusable functions for efficient coding. It includes file operations, calendar utilities, pattern matching, advanced logging with loguru, FastAPI endpoints, async database handling, and email validation. Designed for ease of use and versatility, it's a valuable tool for Python developers.

Project description

Python:

PyPI version fury.io Downloads Downloads Downloads

Support Python Versions

Static Badge Ruff Coverage Status Tests Status

CI/CD Pipeline:

Testing - Main Testing - Dev

SonarCloud:

Coverage Maintainability Rating Quality Gate Status Reliability Rating Vulnerabilities

DevSetGo Common Library

devsetgo_lib is a versatile library designed to provide common functions for Python applications. Its main goal is to increase reusability and reduce the need to rewrite the same functions across multiple applications. This also allows for quick defect resolution and propagation of fixes across all dependent projects.

Key Features

Common Functions:

  • File Operations:

    • CSV, JSON, and Text File Functions: Create, read, write, and manipulate various file types with ease.
    • Folder Functions: Create and remove directories, list directory contents, and manage file system operations efficiently.
  • Logging: Comprehensive logging setup using the Loguru Library. Provides extensive customization options for log configuration, including log rotation, retention, and formatting. Includes improvements for multiprocessing environments to ensure log messages are handled correctly across multiple processes.

  • Calendar Functions: Convert between month names and numbers seamlessly.

  • Pattern Matching: Powerful tools for searching patterns in text using regular expressions.

FastAPI Endpoints:

  • Pre-built endpoints for system health checks, status, and uptime monitoring.
  • Functions to generate HTTP response codes easily.

Async Database:

  • Configuration and management of asynchronous database sessions.
  • CRUD operations with async support.

Installation

To install devsetgo_lib, use pip:

pip install devsetgo-lib

# For async database setup with SQLite or PostgreSQL
pip install devsetgo-lib[sqlite]
pip install devsetgo-lib[postgres]

# Experimental support for other databases
pip install devsetgo-lib[oracle]
pip install devsetgo-lib[mssql]
pip install devsetgo-lib[mysql]

# For adding FastAPI endpoints
pip install devsetgo-lib[fastapi]

# Install everything
pip install devsetgo-lib[all]

Usage

Here's a quick example to demonstrate how you can use some of the key features of devsetgo_lib:

from devsetgo_lib.common_functions import file_functions, logging_config, patterns, calendar_functions

# File Operations
file_functions.create_sample_files("example", 100)
content = file_functions.read_from_file("example.csv")
print(content)

# Logging
logging_config.config_log(logging_directory='logs', log_name='app.log', logging_level='DEBUG')
logger = logging.getLogger('app_logger')
logger.info("This is an info message")

# Pattern Matching
text = "Hello, my name is 'John Doe' and I live in 'New York'."
results = patterns.pattern_between_two_char(text, "'", "'")
print(results)

# Calendar Functions
print(calendar_functions.get_month(1))  # Output: 'January'
print(calendar_functions.get_month_number('January'))  # Output: 1

For detailed documentation on each module and function, please refer to the official documentation.

Contributing

We welcome contributions! Please see our contributing guidelines for more details.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Contact

For any questions or issues, please open an issue on GitHub or contact us at devsetgo@example.com.

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

devsetgo_lib-2024.10.20.1.tar.gz (41.3 kB view details)

Uploaded Source

Built Distribution

devsetgo_lib-2024.10.20.1-py3-none-any.whl (49.8 kB view details)

Uploaded Python 3

File details

Details for the file devsetgo_lib-2024.10.20.1.tar.gz.

File metadata

  • Download URL: devsetgo_lib-2024.10.20.1.tar.gz
  • Upload date:
  • Size: 41.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for devsetgo_lib-2024.10.20.1.tar.gz
Algorithm Hash digest
SHA256 0b18523d8ea4901853d885c63dcf3c07842f831b150cfebbd0f5aad4ced5c41b
MD5 046b808eb9f7b2ed2521e04722e4f2a6
BLAKE2b-256 ecabbb4ec0d680985e7d08a13d1272369f1f82675145dec8a74b48c3c5878f82

See more details on using hashes here.

File details

Details for the file devsetgo_lib-2024.10.20.1-py3-none-any.whl.

File metadata

File hashes

Hashes for devsetgo_lib-2024.10.20.1-py3-none-any.whl
Algorithm Hash digest
SHA256 af7510008a60240403f2b37bf5135759465f63d46e8edc2cc2ce116924e2af6c
MD5 e51502c58d6f75f1bf9212e0d554dd6d
BLAKE2b-256 da0a21fe823e514d97d2eb7522f430ec61421e348d1502bf6c2470dd45e31330

See more details on using hashes here.

Supported by

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