Metadata-Version: 2.1
Name: odeta
Version: 0.1.37
Summary: A simple NoSQL-like interface for SQLite
Home-page: https://github.com/malwaremanu/odeta
Author: Manupal Choudhary
Author-email: tech.manujpr@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE

# Odeta

A simple NoSQL-like interface for SQLite.

## Installation

```bash
pip install odeta
```

## Usages
### Importing the Library

```
from odeta import database
or
from odeta import localbase
```

Initializing the Database and create a table in it.

```
db = database("my_database.db")
# or db = localbase("my_database.db")
users = db("users")
```

## Fetching Data
### Fetch all records from the table:

```
# Fetch records by ID
print(users.get("this_is_the_id")) 

# Fetch all records
print(users.fetch())
```

### Fetch records that match a specific query:

```
print(users.fetch({"name": "Bob Johnson"}))

print(users.fetch({"name?contains": "Bob"}))

# for all the records with OR condition
print(users.fetchall({"name?contains": "Bob", "age" : 30}))

# for all the records with AND condition
print(users.fetch({"name?contains": "Bob", "age" : 30}))
```

# Inserting Data
## Insert a new record into the table:
```
new_user_id = users.put({"name": "Alice Smith", "age": 30})
print(new_user_id)
```

## Updating Data

### Update an existing record in the table:
```
users.update({"name": "Alice Johnson", "age": 31}, new_user_id)
```

## Deleting Data
### Delete a record from the table:
```
users.delete(new_user_id)
```

## Count, Truncate & Drop
### Operations on the table:
```
users.count()
users.truncate()
users.drop()
```


