databx 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- databx-0.1.0/LICENSE +1 -0
- databx-0.1.0/PKG-INFO +12 -0
- databx-0.1.0/README.md +1 -0
- databx-0.1.0/databx/__init__.py +35 -0
- databx-0.1.0/databx.egg-info/PKG-INFO +12 -0
- databx-0.1.0/databx.egg-info/SOURCES.txt +8 -0
- databx-0.1.0/databx.egg-info/dependency_links.txt +1 -0
- databx-0.1.0/databx.egg-info/top_level.txt +1 -0
- databx-0.1.0/pyproject.toml +12 -0
- databx-0.1.0/setup.cfg +4 -0
databx-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
MIT
|
databx-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: databx
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Speichere beliebige Daten flexibel
|
|
5
|
+
Author: Gurkennutelabro
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.8
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Dynamic: license-file
|
|
11
|
+
|
|
12
|
+
# Mein nices modul
|
databx-0.1.0/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Mein nices modul
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
# interne Klasse für Speicherung
|
|
5
|
+
class _DataStore:
|
|
6
|
+
def __init__(self, filename="data.json"):
|
|
7
|
+
self.filename = filename
|
|
8
|
+
if os.path.exists(self.filename):
|
|
9
|
+
with open(self.filename, "r") as f:
|
|
10
|
+
try:
|
|
11
|
+
self.data = json.load(f)
|
|
12
|
+
except json.JSONDecodeError:
|
|
13
|
+
self.data = []
|
|
14
|
+
else:
|
|
15
|
+
self.data = []
|
|
16
|
+
|
|
17
|
+
def save(self, **kwargs):
|
|
18
|
+
self.data.append(kwargs)
|
|
19
|
+
with open(self.filename, "w") as f:
|
|
20
|
+
json.dump(self.data, f, indent=4)
|
|
21
|
+
|
|
22
|
+
def load_all(self):
|
|
23
|
+
return self.data
|
|
24
|
+
|
|
25
|
+
# Ein globales Objekt für direkten Zugriff
|
|
26
|
+
_store = _DataStore()
|
|
27
|
+
|
|
28
|
+
# Funktionen, die direkt aufgerufen werden können
|
|
29
|
+
def save(**kwargs):
|
|
30
|
+
"""Speichert beliebige Daten direkt."""
|
|
31
|
+
_store.save(**kwargs)
|
|
32
|
+
|
|
33
|
+
def load_all():
|
|
34
|
+
"""Lädt alle gespeicherten Daten."""
|
|
35
|
+
return _store.load_all()
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: databx
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Speichere beliebige Daten flexibel
|
|
5
|
+
Author: Gurkennutelabro
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.8
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Dynamic: license-file
|
|
11
|
+
|
|
12
|
+
# Mein nices modul
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
databx
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=42","wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "databx" # Dein Paketname auf PyPI
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Speichere beliebige Daten flexibel"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
authors = [{name="Gurkennutelabro"}]
|
|
11
|
+
license = {text="MIT"}
|
|
12
|
+
requires-python = ">=3.8"
|
databx-0.1.0/setup.cfg
ADDED