Skip to main content

srx-lib-core

Core utilities for SRX Python services. Small, generic helpers you can reuse across FastAPI-based microservices.

What it includes:

  • Logging setup with loguru (get_logger, setup_logger)
  • Base settings class with Pydantic Settings
  • FastAPI app factory with sensible defaults (CORS, exception handling, health route)

Install

PyPI (public):

  • pip install srx-lib-core

Using uv (pyproject):

[project]
dependencies = ["srx-lib-core>=0.1.0"]

Usage

Logging:

from srx_lib_core import get_logger
logger = get_logger(__name__)
logger.info("hello")

Settings:

from srx_lib_core import BaseServiceSettings

class Settings(BaseServiceSettings):
    OPENAI_API_KEY: str | None = None

settings = Settings()  # loads from .env by default

FastAPI app factory:

from fastapi import APIRouter
from srx_lib_core import create_app

router = APIRouter()

@router.get("/health")
def health():
    return {"status": "ok"}

app = create_app(title="my-service", routers=[router])

Environment Variables

  • LOG_LEVEL (default: INFO)
  • LOG_FILE (optional path)
  • ENVIRONMENT (default: development)
  • CORS_ORIGIN (comma-separated origins; default empty)

Release

This repo ships a GitHub Actions workflow that publishes to GitHub Packages on tags v*.

  • Create a tag: git tag v0.1.0 && git push --tags
  • The workflow uses GITHUB_TOKEN with packages:write.

License

Proprietary © SRX

Metadata

Release files for srx-lib-core 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for srx-lib-core 0.1.2
File Size Uploaded
srx_lib_core-0.1.2.tar.gz 3.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for srx-lib-core 0.1.2
File Interpreter ABI Platform
srx_lib_core-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 6.9 kB

Release files / srx_lib_core-0.1.2.tar.gz

Download URL srx_lib_core-0.1.2.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d1370083076e823263585240f61780390b597212a13c37e9ee1d37d9cf9d776b
BLAKE2b-256 checksum
How to use checksums
261eaf95fa515a2e02b41f31cf5ef2ccb425539aab82a30fbc5b81dd7385d672
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.11

Release files / srx_lib_core-0.1.2-py3-none-any.whl

Download URL srx_lib_core-0.1.2-py3-none-any.whl
Size 3.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c92534f73285ef41ccad327bdac8aa9b8cb15d15fb18f01265e817fccd419d3c
BLAKE2b-256 checksum
How to use checksums
4190804a3446e14ca9af7f677b711cc0f669c3a7b1676ab5b0647d640588e50f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.11

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page