SyncList - список Python с автоматической синхронизацией данных с файлом JSON.
Project description
SyncList
SyncList is a Python list with automatic synchronization of data with a JSON file. This can be useful in cases where you need to save data between program sessions or if you need to save the state of data in real time.
Installation
You can install SyncList using pip:
pip install sync_list
Usage
from sync_list import SyncList
# Creating SyncList object with initial data
my_list = SyncList([1, 2, 3])
# Adding elements
my_list.append(4)
my_list.extend([5, 6])
# Inserting an element
my_list.insert(3, 0)
# Removing an element
my_list.remove(2)
# Accessing an element by index
print(my_list[0]) # 1
# Changing an element
my_list[0] = 0
# Sorting the list
my_list.sort()
# Reversing the list
my_list.reverse()
When the sync()
method is called, the data in the list will be written to a file in JSON format. On the next program
run, the data will be loaded from the file and available for use in the SyncList object.
Developers
- Azreil-OFD (fantom2413@gmail.com)
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
sync_list-1.2.0.tar.gz
(2.1 kB
view hashes)
Built Distribution
Close
Hashes for sync_list-1.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c44ea9d0ff1a6a6c4b3fd1910530922f26da3354d5b9b7b75911c9e5e566fe2 |
|
MD5 | 6e7874f1f9b052abfdd2d2385319ab22 |
|
BLAKE2b-256 | 94ee003f1e73b8776f0b357410a3d5ce3c57e4d9b34699b6c3abd8c11828ac3d |