SQLite3 wrapper with a list-like interface
Project description
==========
sqlitelist
==========
sqlitelist is a SQLite3 wrapper with a python list-like interface. It comes with one purpose - to keep your data if it bigger than your RAM size.
.. code-block:: python
>>> from sqlitelist import open
>>> with open('db') as lst:
... lst.append('hello')
... lst.extend(['world', {}])
>>> print(len(lst))
>>> for item in lst:
>>> print(item)
===================================
There is some performance features
===================================
.. code-block:: python
>>> from sqlitelist import open
>>> with open('db', journal_mode='MEMORY', autocommit=False) as lst:
... for _ in range(1000):
... lst.extend(['some', 'data', {'key': 'value', 'another key': 1}])
... lst.commit()
>>> # Do not forget to commit your changes if autocommit is off.
>>> lst.flush() # For flush all your data without removing a database file.
========
Features
========
Values can be any pickable objects.
Support for slices (step and negative indices aren't supported [yet])
.. code-block:: python
>>> with open('db') as lst:
... print(lst[1:200])
... print(lst[:50])
... print(lst[50:])
Support for getting items by it's index
.. code-block:: python
>>> with open('db') as lst:
... lst[5]
... lst[-3]
Support for pop, append and extend methods
.. code-block:: python
>>> with open('db') as lst:
... lst.pop()
... lst.pop(50) # Pop the element in the 51th place
Support for delete (indices and slices with no negative values)
.. code-block:: python
>>> with open('db') as lst:
... del lst[0]
... del lst[-50]
... del lst[:50]
... del lst[50:]
Support for iteration (no multithreading support!)
.. code-block:: python
>>> with open('db') as lst:
... for item in lst:
... print(item)
sqlitelist
==========
sqlitelist is a SQLite3 wrapper with a python list-like interface. It comes with one purpose - to keep your data if it bigger than your RAM size.
.. code-block:: python
>>> from sqlitelist import open
>>> with open('db') as lst:
... lst.append('hello')
... lst.extend(['world', {}])
>>> print(len(lst))
>>> for item in lst:
>>> print(item)
===================================
There is some performance features
===================================
.. code-block:: python
>>> from sqlitelist import open
>>> with open('db', journal_mode='MEMORY', autocommit=False) as lst:
... for _ in range(1000):
... lst.extend(['some', 'data', {'key': 'value', 'another key': 1}])
... lst.commit()
>>> # Do not forget to commit your changes if autocommit is off.
>>> lst.flush() # For flush all your data without removing a database file.
========
Features
========
Values can be any pickable objects.
Support for slices (step and negative indices aren't supported [yet])
.. code-block:: python
>>> with open('db') as lst:
... print(lst[1:200])
... print(lst[:50])
... print(lst[50:])
Support for getting items by it's index
.. code-block:: python
>>> with open('db') as lst:
... lst[5]
... lst[-3]
Support for pop, append and extend methods
.. code-block:: python
>>> with open('db') as lst:
... lst.pop()
... lst.pop(50) # Pop the element in the 51th place
Support for delete (indices and slices with no negative values)
.. code-block:: python
>>> with open('db') as lst:
... del lst[0]
... del lst[-50]
... del lst[:50]
... del lst[50:]
Support for iteration (no multithreading support!)
.. code-block:: python
>>> with open('db') as lst:
... for item in lst:
... print(item)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sqlitelist-0.1.tar.gz
(4.2 kB
view details)
File details
Details for the file sqlitelist-0.1.tar.gz.
File metadata
- Download URL: sqlitelist-0.1.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc0091787bd2f872f1256d1084cefc82b35245c50255856d99e78c3cea205985
|
|
| MD5 |
059f65e8cf29b151e0b9f40af65ed476
|
|
| BLAKE2b-256 |
831007b4b1a9a41349d7e187933512221d1d172c08f17bc3f3d176a3770ccae9
|