Skip to main content

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

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)

Uploaded Source

Built Distribution

sync_list-1.2.0-py3-none-any.whl (2.7 kB view hashes)

Uploaded Python 3

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