Skip to main content

Client für den FNA-DBServer

Project description

FNA-DBClient

Client für den FNA-DBServer

DBClient

Die Klasse DBClient dient als Schnittstelle zwischen dem DBServer und einem Client. Es gibt funktionen, die relevant sind

  1. connect - Öffnet eine Verbidnung zum Server
  2. get_value('KEY') - ruft den Wert von KEY aus dem DB Server ab
  3. set_value('KEY', 'VALUE') - Speichert oder Erstellt den Wert VALUE zum Schlüssel KEY auf dem DB Server ab. Der Server antwortet mit dem gespeicherten Wert
  4. close - schließt die Veringun zum Server

Env Variablen

Die Konfiguration kann auch via ENV Variablen erfolgen

  • FNA_DBSERVER_ADDR - Adresse des Servers (default 12.0.0.1)
  • FNA_DBSERVER_PORT - Port des Servers (Default 20002)

Beispiel

# Instanz erstellen
db = DBClient('127.0.0.1', 20002)

db.connect()

val1 = db.set_value('test', 'Ich bin ein String')
print(val1) # $: 'Ich bin ein String'
val2 = db.get_value('test')
print(val2) # $: 'Ich bin ein String'

db.close()

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

fna_db-0.1.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

fna_db-0.1.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file fna_db-0.1.0.tar.gz.

File metadata

  • Download URL: fna_db-0.1.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for fna_db-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7aaebe5544030c9fad739d00bd1988e244deab590881282acd186c2ee81f398e
MD5 0ffd6c92c66b76be4edda79eadb06b13
BLAKE2b-256 35b8e87064163033975cdd1f484e481f9d6a0b64ba03b64ed5877c78bf6c941f

See more details on using hashes here.

File details

Details for the file fna_db-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fna_db-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for fna_db-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 47d13afe27edb30146ed69b0fcfaee45f4d8b1bec148e59b102870737de30f1d
MD5 90095e7faa70a6cb4bc61cedf45f2515
BLAKE2b-256 59b6462b6cfeb554cc8311c2ce9970e9aa4d9e40a2d103db97acce69b7e25403

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