Skip to main content

logo

A FastAPI integration with Etcd for managing configuration settings via a RESTful API


Installation

pip install gadfastetcd

Usage

API

Set

curl -X 'PUT' \
  'http://127.0.0.1:8000/-/etcd' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "test": 1
}

Get

curl -X 'GET' \
  'http://127.0.0.1:8000/-/etcd' \
  -H 'accept: application/json'

{
  "test": 1
}

Code

import pydantic

import fastapi

from gadfastetcd import Etcd

class Settings(pydantic.BaseModel):
    class Config:
        extra = "allow"

settings = Settings()

etcd = Etcd(url="localhost:2379", storage="/{service_name}/{environment}", settings=settings)

app = fastapi.FastAPI()

app.include_router(etcd.router)

>>> settings.test

Metadata

Release files for gadfastetcd 0.0.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 gadfastetcd 0.0.1
File Size Uploaded
gadfastetcd-0.0.1.tar.gz 2.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gadfastetcd 0.0.1
File Interpreter ABI Platform
gadfastetcd-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 6.0 kB

Release files / gadfastetcd-0.0.1.tar.gz

Download URL gadfastetcd-0.0.1.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4c37aff8233d0ee2304061068c2c5e18fd6ea9d396eda226b6d4c04753877450
BLAKE2b-256 checksum
How to use checksums
266e32a0e4a62206ccf8914933984094fd692cb1ee31d6a2a236640720edcf7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / gadfastetcd-0.0.1-py3-none-any.whl

Download URL gadfastetcd-0.0.1-py3-none-any.whl
Size 3.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2fa58a23f47be6603b885246430edc94950cfdf688190504c8eecd98475d951c
BLAKE2b-256 checksum
How to use checksums
8c32d187263995101d1a85aa391cbc66063c20bca15e5d21f9e0a5291703c254
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.0.1 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