semvec/pypi-packages huggingface dataset:
universe-matrix 0.0.3
Wrapper for Multivalue Data

# universe_matrix

This package lets developers use BASIC style dynamic arrays within python. This is useful when you're sending data back to universe and are trying to structure it to how it will be used natively.   

Key points here are that indexing starts from 1 and -1 as a position means append, similar to how BASIC handles arrays. 

# Requirements

This package requires the Rocket supplied module u2py as this is just a wrapper around it. 

# Installation
    pip install universe-matrix

# Examples

	>>> from universe_matrix import UniverseMatrix

	>>> a = UniverseMatrix()
	>>> a[1] = 'Hello'
	>>> a[2] = 'World'
	>>> print(a.u2())
	HelloþWorld

	>>> a = UniverseMatrix()
	>>> a[-1] = 'Hello'
	>>> a[-1] = 'World'
	>>> print(a.u2())
	HelloþWorld

	>>> a = UniverseMatrix()
	>>> a[1] = 1
	>>> a[2] = 2
	>>> a[2,1] = 3
	>>> a[2,2] = 4
	>>> a[2,3] = 5
	>>> a[2,3,1] = 6
	>>> a[2,3,2] = 7
	>>> a[2,3,2,2] = 8
	>>> print(a.u2())
	1þ3ý4ý6ü7û8

	>>> print(a[2,3,1])
	6
dbnet 0.2.5
DbNet.
Keywords: dbnet

DbNet is a Python/VueJS database client to access Oracle, Spark (Hive), Postgres, etc. It is still a work in progess, but should work fine for daily use. MS SQL Server is supported, although with some bugs here and there due to JDBC/JTDS bridge.

**Only Chrome and Firefox are supported at the moment.**

Install
=======

.. code-block:: bash

   pip install dbnet

Command ``dbnet`` should now be available in the PATH.

Running
=======

``dbnet --help``

.. code-block:: bash

   usage: dbnet [-h] [--serve] [--init_db] [--reset_db] [--force] [--port PORT]

   DbNet Application

   optional arguments:
     -h, --help   show this help message and exit
     --serve      Start the DbNet server
     --init_db    Initiatlize the backend SQLite database
     --reset_db   Reset the backend SQLite database
     --force      Kill any running instance.
     --port PORT  The web application port

``dbnet --serve``

.. code-block:: bash

   2019-02-27 10:08:11 -- DB Tables OK.
   2019-02-27 10:08:11 -- Main Loop PID is 39685
   2019-02-27 10:08:11 -- Monitor Loop PID is 39691
   2019-02-27 10:08:11 -- Web Server PID is 39692
   2019-02-27 10:08:11 -- URL -> http://macbook:5566/?token=CqPahSJIeg1Nl4Kj
   (39692) wsgi starting up on http://0.0.0.0:5566

Setting up Dababase Profile
---------------------------

Your database profile / credentials needs to be set up at ``~/profile.yaml`` or env var ``PROFILE_YAML``.
Run command ``xutil-create-profile`` to create from template.

Example Entry
^^^^^^^^^^^^^

.. code-block:: yaml

   PG_XENIAL:
     name: PG_XENIAL
     host: xenial-server
     database: db1
     port: 5432
     user: user
     password: password
     type: postgresql
     url: "jdbc:postgresql://xenial-server:5432/db1?&ssl=false"

Screenshots
===========


.. image:: dbnet.screenshot.2.png
   :target: dbnet.screenshot.2.png
   :alt: Screenshot 2



.. image:: dbnet.screenshot.1.png
   :target: dbnet.screenshot.1.png
   :alt: Screenshot 1
jumpDB 0.0.6
A simple kv store
Requires Python: >=3.6

## JumpDB

JumpDB is a simple key-value store that exploits Sorted String Tables.

Here's a [tutorial](https://navyazaveri.github.io/algorithms/2020/01/12/write-a-kv-store-from-scratch.html)  which goes a little more in-depth into how it works.



### Install  

```
pip3 install jumpDB
```



### Usage 

```
from jumpDB import DB

db = DB()
db["k1"] = "v1"
db["k2"] = "v2"
del db["k2"]
assert db["k1"] == "v1"
assert "k2" not in db
```


### API

* `get(key)` => Finds the corresponding value to the given key 

* `set(key, value)` => Insert the entry into the db 

* `delete(key)` => Deletes the key from the db 

* `contains(key)` => Checks if the given key is present in the db 



### Design & Implementation 

The design is essentially a simplified version of [levelDB](https://en.wikipedia.org/wiki/LevelDB). 

Every write is initially inserted into an in-memory data structure (typically called "memtable")
 -- in this case,  a red-black tree. 

When the memtable's size exceeds a certain threshold, all entries are written out into a segment file. 
Exploiting the properties of a red-black BST, we can ensure all entries will be efficiently written in sorted order.
The resulting file is immutable and called a sorted-string table (SST).

Whilst performing the above write, we also maintain a sparse index table, keeping track of the 
file offset of every in 1 in x entries. 

When a read comes in, we first look into the memtable for the corresponding k-v pair; if it doesn't exist, 
we look at the *closest* entry (by key) in the sparse table. We *jump* to the file offset of that entry and then linearly scan forwards 
 until we find the desired key-value pair. This is only possible because the SST is sorted by key.


Periodically, the segments are merged (also called "compaction"); this ensures a reduction 
in memory footprint as the resulting merged segments(s) would only hold the most recent entries. 

An addition optimisation includes the use of bloom-filters to check if a key is not present in 
the DB. This saves us from performing heavy disk reads for keys that haven't been inserted into the db. 



### Tests 
Run `pytest -v`


### License 
BSD 2-Clause License