Skip to main content

kiarina-lib-cloudflare

PyPI version Python License: MIT

English | 日本語

Dependencies

Package Version License
Pydantic Settings >=2.10.1 MIT
pydantic-settings-manager >=3.2.0 MIT

A Cloudflare SDK is not included as a dependency. Add one to the application that uses the credentials.

Installation

pip install kiarina-lib-cloudflare

Features

  • Configuring Cloudflare Authentication Store an account ID and API token as typed settings.
  • Managing Multiple Accounts Switch between named settings for multiple accounts.
  • Loading Environment Variables Load environment variables with the KIARINA_LIB_CLOUDFLARE_ prefix.
  • Protecting API Tokens Store the API token as SecretStr.

Configuring Cloudflare Authentication

from kiarina.lib.cloudflare import CloudflareSettings

settings = CloudflareSettings(
    account_id="0123456789abcdef",
    api_token="secret-token",
)

Extract the token where it is needed to create a Cloudflare client.

account_id = settings.account_id
api_token = settings.api_token.get_secret_value()

Managing Multiple Accounts

settings_manager uses multiple-settings mode. Place named settings under configs.

kiarina.lib.cloudflare:
  default: production
  configs:
    development:
      account_id: development-account
      api_token: development-token
    production:
      account_id: production-account
      api_token: production-token
import yaml
from pydantic_settings_manager import load_user_configs

from kiarina.lib.cloudflare import settings_manager

with open("config.yaml", encoding="utf-8") as file:
    load_user_configs(yaml.safe_load(file) or {})

settings = settings_manager.get_settings("production")

To configure only this package directly, assign settings_manager.user_config.

from kiarina.lib.cloudflare import settings_manager

settings_manager.user_config = {
    "default": "development",
    "configs": {
        "development": {
            "account_id": "development-account",
            "api_token": "development-token",
        },
        "production": {
            "account_id": "production-account",
            "api_token": "production-token",
        },
    },
}

Loading Environment Variables

Load a single configuration from environment variables.

export KIARINA_LIB_CLOUDFLARE_ACCOUNT_ID="0123456789abcdef"
export KIARINA_LIB_CLOUDFLARE_API_TOKEN="secret-token"
from kiarina.lib.cloudflare import CloudflareSettings

settings = CloudflareSettings()

Protecting API Tokens

api_token is a SecretStr. Extract its value explicitly only where required.

api_token = settings.api_token.get_secret_value()

API Reference

kiarina.lib.cloudflare

from kiarina.lib.cloudflare import (
    CloudflareSettings,
    settings_manager,
)

CloudflareSettings

class CloudflareSettings(BaseSettings):
    def __init__(
        self,
        *,
        account_id: str,
        api_token: SecretStr,
    ) -> None: ...

Cloudflare account settings.

Fields

  • account_id (str): Cloudflare account ID.
  • api_token (SecretStr): Cloudflare API token.

settings_manager

settings_manager: SettingsManager[CloudflareSettings]

Global instance that manages named Cloudflare account settings.

Metadata

Release files for kiarina-lib-cloudflare 2.3.1

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

Source distribution (sdist)

Source distribution for kiarina-lib-cloudflare 2.3.1
File Size Uploaded Provenance Actions
kiarina_lib_cloudflare-2.3.1.tar.gz 5.6 kB With provenance Details for kiarina_lib_cloudflare-2.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kiarina-lib-cloudflare 2.3.1
File Interpreter ABI Platform Actions
kiarina_lib_cloudflare-2.3.1-py3-none-any.whl Python 3 none any Details for kiarina_lib_cloudflare-2.3.1-py3-none-any.whl

Total release size: 9.5 kB

Release files / kiarina_lib_cloudflare-2.3.1.tar.gz

Download URL kiarina_lib_cloudflare-2.3.1.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
99d162c8eb22d98ab1d6c7a98b094bd638445563f08426d8d18b59a8e179ec2c
BLAKE2b-256 checksum
How to use checksums
9fe5a58b9d62d28ced963a685799e1069a337eb09c040034d25c7ed05888c695
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 2, 2026.

Transparency log

Release files / kiarina_lib_cloudflare-2.3.1-py3-none-any.whl

Download URL kiarina_lib_cloudflare-2.3.1-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7a217d3087f5189ef1a14030bfa071a51ef4d3f8f31548ee1d97417556b12a8d
BLAKE2b-256 checksum
How to use checksums
72f7d5367e6f23fcbfa8e65b5031e867f6cdf17967a83645334269848a0bf6ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 2, 2026.

Transparency log

Security for kiarina-lib-cloudflare 2.3.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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for kiarina_lib_cloudflare-2.3.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 2, 2026.

Transparency log

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.

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