Skip to main content

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

Project description

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

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

gadfastetcd-0.0.1.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

gadfastetcd-0.0.1-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file gadfastetcd-0.0.1.tar.gz.

File metadata

  • Download URL: gadfastetcd-0.0.1.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for gadfastetcd-0.0.1.tar.gz
Algorithm Hash digest
SHA256 4c37aff8233d0ee2304061068c2c5e18fd6ea9d396eda226b6d4c04753877450
MD5 160bd6c9e6671fc2884618ba1e4831db
BLAKE2b-256 266e32a0e4a62206ccf8914933984094fd692cb1ee31d6a2a236640720edcf7c

See more details on using hashes here.

File details

Details for the file gadfastetcd-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: gadfastetcd-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for gadfastetcd-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2fa58a23f47be6603b885246430edc94950cfdf688190504c8eecd98475d951c
MD5 8666b517968737661cf7df6dba83875e
BLAKE2b-256 8c32d187263995101d1a85aa391cbc66063c20bca15e5d21f9e0a5291703c254

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