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

DSG Logo 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.

Read the Full Documentation here.

AI Assistant Integration

Using GitHub Copilot, Claude, or another AI coding assistant to add this library to your app? Generate up-to-date integration instructions directly into your app's repo:

python -m dsg_lib.ai_instructions claude --write    # -> ./CLAUDE.md
python -m dsg_lib.ai_instructions copilot --write   # -> ./.github/copilot-instructions.md
python -m dsg_lib.ai_instructions generic --write   # -> ./AI_INSTRUCTIONS.md

See the AI Assistant Integration docs for details.

Development — No virtualenvs

  • This project and the devcontainer use the system Python inside the container. Do not create virtual environments in the workspace (for example venv, .venv, env, or _venv).
  • The devcontainer is configured to disable Poetry/Pipenv virtualenv creation and to use the system interpreter.
  • If you have local virtualenv folders, remove them before committing. Example:
rm -rf .venv venv env _venv

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.
  • File Moving: Move files from one directory to another, with an option to compress the file being moved.

  • 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.

Quick Reference

  • Logging & Config Setup
  • FastAPI Endpoints
  • Calendar & Date Utilities
  • Pattern Matching
  • CSV & JSON Helpers

Installation

To install devsetgo_lib, use pip:

pip install devsetgo-lib

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

# Experimental support for other databases
pip install devsetgo-lib[oracle]
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-2026.7.23.1.tar.gz (65.8 kB view details)

Uploaded Source

Built Distribution

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

devsetgo_lib-2026.7.23.1-py3-none-any.whl (76.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: devsetgo_lib-2026.7.23.1.tar.gz
  • Upload date:
  • Size: 65.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for devsetgo_lib-2026.7.23.1.tar.gz
Algorithm Hash digest
SHA256 da6edece5e685495810f9bc0cb32384d3b2c64f46c5cfa4627b0905fd427ec85
MD5 9e08a755fb1f67f5e1543c3baacbbd6f
BLAKE2b-256 e46720cfa474dd27825b60ae81bb8b78b967b8bd0c36904bdd59984c50dde772

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for devsetgo_lib-2026.7.23.1-py3-none-any.whl
Algorithm Hash digest
SHA256 73a2e4d5a76aa0d6e85139539a368580b578c05466dd2fe84700459b5300a852
MD5 2a9f48a7721a844aec9426a63e57d65c
BLAKE2b-256 d1396e167670bb0195840e225205be0b2fd7a6d1e51a9e195703faf6bc7cc5d4

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