Skip to main content

A simple python real-time remote configuration framework.

Project description

rtconfig

A simple Python lib for manage remote server configuration.

  • Configuration remote unified management center.
  • When the configuration changes, pushed to client in real time.

Installing

pip install rtconfig

Server deploy

You can start server directly by single process.

python -m rtconfig.server

Command options:

  • --host: str, server host
  • --port: str, server port
  • --auto-reload: bool, if auto reload
  • --store-type: str, rtconfig server store type
  • --broker-url: str, rtconfig server broker url
  • --login-disable: bool, rtconfig server disable login
  • --config: str, rtconfig server config file path

Client connect

Create a new python module conf.py, then write code like this:

from rtconfig import RtConfigClient
client = RtConfigClient('demo',ws_url='ws://127.0.0.1:8089',config_module=globals())

So, you can use real time configuration like this:

conf.config_name

Configuration

You can create service.py python config file, And add file path to params --config=services.py.

Configuration options:

config name type default description
DEBUG bool false debug mode
MAX_CONNECTION int 1024 max client connections
STORE_TYPE string json_file data store type
BROKER_URL string data store broker url
LOGIN_DISABLED bool false server disable login
OPEN_CLIENT_AUTH_TOKEN bool false data store broker url

Config data store method broker url

json_file

BROKER_URL = "~/rtconfig" (默认可不填)

redis

BROKER_URL = "redis://127.0.0.1:6379/0"

mongodb

BROKER_URL = "mongodb://127.0.0.1:27017/demo?connect=false"

Notes

  • rtconfig not support multiprocess deploy now.

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

rtconfig-0.1.8.tar.gz (809.6 kB view details)

Uploaded Source

Built Distribution

rtconfig-0.1.8-py3-none-any.whl (874.9 kB view details)

Uploaded Python 3

File details

Details for the file rtconfig-0.1.8.tar.gz.

File metadata

  • Download URL: rtconfig-0.1.8.tar.gz
  • Upload date:
  • Size: 809.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5

File hashes

Hashes for rtconfig-0.1.8.tar.gz
Algorithm Hash digest
SHA256 6d71b841d9e86f168275e93550acc07fc1f7cdc70853b207ae38ffa0d6ba4e3c
MD5 c4b58fa1a7b107c18316ec336027fa35
BLAKE2b-256 59d2fe19823183eaec14081a2a7a57f651fdefa4cdc72f94953d9a7748b2d207

See more details on using hashes here.

File details

Details for the file rtconfig-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: rtconfig-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 874.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5

File hashes

Hashes for rtconfig-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 212e7e9fa14d138d0e8baf29589ae215496a21965be9a8fc4c36d365a308dfac
MD5 06bf2f0ae8b9d797d7f7ceafff307039
BLAKE2b-256 2d7cb6d4a764ddc18282e4f2128c86140eb41911169392a834a08343d202da13

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page