Name | saracendb JSON |
Version |
0.8
JSON |
| download |
home_page | |
Summary | |
upload_time | 2023-07-17 09:24:53 |
maintainer | |
docs_url | None |
author | Saracen Rhue |
requires_python | |
license | |
keywords |
python
db
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# SaracenDB Documentation
## Introduction
SaracenDB is a Python-based NoSQL database, offering a simple and flexible data storage solution. It uses BSON for data serialization and allows users to create, read, update, and delete data in an easy-to-use manner.
## Class Initialization
```python
db = SaracenDB(filename: str, collection: str='default')
```
- `filename` : Name of the file that will store the database.
- `collection` : Name of the collection to use initially. If not provided, the default collection name will be 'default'.
## Methods
### Add
Add a new entry to the current collection.
```python
db.add(entry: dict)
```
- `entry` : The data to be added to the collection, in dictionary form.
### Find
Finds entries in the current collection that match a given key-value pair.
```python
db.find(key: str, value: str)
```
- `key` : The key to look for in the entries.
- `value` : The value to look for in the entries.
### Get
Get an entry by its ID in the current collection.
```python
db.get(id: int)
```
- `id` : The ID of the entry.
### Edit
Edit a key-value pair in an entry in the current collection.
```python
db.edit(id: int, key: str, value)
```
- `id` : The ID of the entry.
- `key` : The key to edit.
- `value` : The new value.
### rm_item
Delete an entry from the current collection using its ID.
```python
db.rm_item(id: int)
```
- `id` : The ID of the entry.
### rm_key
Delete a key from an entry in the current collection.
```python
db.rm_key(key: str, id)
```
- `key` : The key to delete.
- `id` : The ID of the entry.
### rm_coll
Delete a collection.
```python
db.rm_coll(collection: str)
```
- `collection` : The name of the collection to delete.
### rm_key_for_all
Delete a key from all entries in the current collection.
```python
db.rm_key_for_all(key: str)
```
- `key` : The key to delete.
### add_key_for_all
Add a key to all entries in the current collection.
```python
db.add_key_for_all(key: str, value='')
```
- `key` : The key to add.
- `value` : The initial value of the new key.
### add_coll
Create a new collection.
```python
db.add_coll(collection: str)
```
- `collection` : The name of the new collection.
### use_coll
Switch to another collection.
```python
db.use_coll(collection: str)
```
- `collection` : The name of the collection to switch to.
### push
Save changes to the database.
```python
db.push()
```
### compact
Remove deleted entries from the database file to reduce file size.
```python
db.compact()
```
### to_json
Write the current collection to a JSON file.
```python
db.to_json(path: str)
```
- `path` : The path of the JSON file.
### to_yaml
Write the current collection to a YAML file.
```python
db.to_yaml(path: str)
```
- `path` : The path of the YAML file.
### db_to_json
Write the entire database to a JSON file.
```python
db.db_to_json(path: str)
```
- `path` : The path of the JSON file.
### db_to_yaml
Write the entire database to a YAML file.
```python
db.db_to_yaml(path: str)
```
- `path` : The path of the YAML file.
### json_to_db
Create a new database from a JSON file.
```python
db.json_to_db(path: str)
```
- `path` : The path of the JSON file.
### yaml_to_db
Create a new database from a YAML file.
```python
db.yaml_to_db(path: str)
```
- `path` : The path of the YAML file.
### import_json_to_coll
Import a JSON file to the current collection.
```python
db.import_json_to_coll(path: str)
```
- `path` : The path of the JSON file.
### import_yaml_to_coll
Import a YAML file to the current collection.
```python
db.import_yaml_to_coll(path: str)
```
- `path` : The path of the YAML file.
### reindex
Reindex the current collection.
```python
db.reindex()
```
### coll_list
List all collections in the database.
```python
db.coll_list()
```
### get_coll
Return the current collection.
```python
db.get_coll()
```
### set_coll
Overwrite the current collection.
```python
db.set_coll(coll: list)
```
- `coll` : The new collection data, in list form.
### get_full_db
Return the full database.
```python
db.get_full_db()
```
Raw data
{
"_id": null,
"home_page": "",
"name": "saracendb",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "python,db",
"author": "Saracen Rhue",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/c6/56/92d06e81abbfa231c54ea6b3b1013ce277df3886008421e5cce48e7a3f26/saracendb-0.8.tar.gz",
"platform": null,
"description": "\n# SaracenDB Documentation\n\n## Introduction\n\nSaracenDB is a Python-based NoSQL database, offering a simple and flexible data storage solution. It uses BSON for data serialization and allows users to create, read, update, and delete data in an easy-to-use manner.\n\n## Class Initialization\n\n```python\ndb = SaracenDB(filename: str, collection: str='default')\n```\n\n- `filename` : Name of the file that will store the database.\n- `collection` : Name of the collection to use initially. If not provided, the default collection name will be 'default'.\n\n## Methods\n\n### Add\n\nAdd a new entry to the current collection.\n\n```python\ndb.add(entry: dict) \n```\n\n- `entry` : The data to be added to the collection, in dictionary form.\n\n### Find\n\nFinds entries in the current collection that match a given key-value pair.\n\n```python\ndb.find(key: str, value: str)\n```\n\n- `key` : The key to look for in the entries.\n- `value` : The value to look for in the entries.\n\n### Get\n\nGet an entry by its ID in the current collection.\n\n```python\ndb.get(id: int)\n```\n\n- `id` : The ID of the entry.\n\n### Edit\n\nEdit a key-value pair in an entry in the current collection.\n\n```python\ndb.edit(id: int, key: str, value)\n```\n\n- `id` : The ID of the entry.\n- `key` : The key to edit.\n- `value` : The new value.\n\n### rm_item\n\nDelete an entry from the current collection using its ID.\n\n```python\ndb.rm_item(id: int)\n```\n\n- `id` : The ID of the entry.\n\n### rm_key\n\nDelete a key from an entry in the current collection.\n\n```python\ndb.rm_key(key: str, id)\n```\n\n- `key` : The key to delete.\n- `id` : The ID of the entry.\n\n### rm_coll\n\nDelete a collection.\n\n```python\ndb.rm_coll(collection: str)\n```\n\n- `collection` : The name of the collection to delete.\n\n### rm_key_for_all\n\nDelete a key from all entries in the current collection.\n\n```python\ndb.rm_key_for_all(key: str)\n```\n\n- `key` : The key to delete.\n\n### add_key_for_all\n\nAdd a key to all entries in the current collection.\n\n```python\ndb.add_key_for_all(key: str, value='')\n```\n\n- `key` : The key to add.\n- `value` : The initial value of the new key.\n\n### add_coll\n\nCreate a new collection.\n\n```python\ndb.add_coll(collection: str)\n```\n\n- `collection` : The name of the new collection.\n\n### use_coll\n\nSwitch to another collection.\n\n```python\ndb.use_coll(collection: str)\n```\n\n- `collection` : The name of the collection to switch to.\n\n### push\n\nSave changes to the database.\n\n```python\ndb.push()\n```\n\n### compact\n\nRemove deleted entries from the database file to reduce file size.\n\n```python\ndb.compact()\n```\n\n### to_json\n\nWrite the current collection to a JSON file.\n\n```python\ndb.to_json(path: str)\n```\n\n- `path` : The path of the JSON file.\n\n### to_yaml\n\nWrite the current collection to a YAML file.\n\n```python\ndb.to_yaml(path: str)\n```\n\n- `path` : The path of the YAML file.\n\n### db_to_json\n\nWrite the entire database to a JSON file.\n\n```python\ndb.db_to_json(path: str)\n```\n\n- `path` : The path of the JSON file.\n\n### db_to_yaml\n\nWrite the entire database to a YAML file.\n\n```python\ndb.db_to_yaml(path: str)\n```\n\n- `path` : The path of the YAML file.\n\n### json_to_db\n\nCreate a new database from a JSON file.\n\n```python\ndb.json_to_db(path: str)\n```\n\n- `path` : The path of the JSON file.\n\n### yaml_to_db\n\nCreate a new database from a YAML file.\n\n```python\ndb.yaml_to_db(path: str)\n```\n\n- `path` : The path of the YAML file.\n\n### import_json_to_coll\n\nImport a JSON file to the current collection.\n\n```python\ndb.import_json_to_coll(path: str)\n```\n\n- `path` : The path of the JSON file.\n\n### import_yaml_to_coll\n\nImport a YAML file to the current collection.\n\n```python\ndb.import_yaml_to_coll(path: str)\n```\n\n- `path` : The path of the YAML file.\n\n### reindex\n\nReindex the current collection.\n\n```python\ndb.reindex()\n```\n\n### coll_list\n\nList all collections in the database.\n\n```python\ndb.coll_list()\n```\n\n### get_coll\n\nReturn the current collection.\n\n```python\ndb.get_coll()\n```\n\n### set_coll\n\nOverwrite the current collection.\n\n```python\ndb.set_coll(coll: list)\n```\n\n- `coll` : The new collection data, in list form.\n\n### get_full_db\n\nReturn the full database.\n\n```python\ndb.get_full_db()\n```\n",
"bugtrack_url": null,
"license": "",
"summary": "",
"version": "0.8",
"project_urls": null,
"split_keywords": [
"python",
"db"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9c03293414329ca1a90b9e857a666f1bb385b38c3382a97b32ae56e51591b74b",
"md5": "dabfde94d2b1685e53613ea5a41a0b50",
"sha256": "f63185d1dbf5040c4f3ae13a16a800f47163d9983e4b01036c56f026d61b2852"
},
"downloads": -1,
"filename": "saracendb-0.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "dabfde94d2b1685e53613ea5a41a0b50",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 4403,
"upload_time": "2023-07-17T09:24:52",
"upload_time_iso_8601": "2023-07-17T09:24:52.111993Z",
"url": "https://files.pythonhosted.org/packages/9c/03/293414329ca1a90b9e857a666f1bb385b38c3382a97b32ae56e51591b74b/saracendb-0.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c65692d06e81abbfa231c54ea6b3b1013ce277df3886008421e5cce48e7a3f26",
"md5": "84da7acde9c33a75f99d9eab7879490b",
"sha256": "fe2fa07163d1b4156b0d47e3dda0143ba45ae6785e0cbf77c61e9ac685dac658"
},
"downloads": -1,
"filename": "saracendb-0.8.tar.gz",
"has_sig": false,
"md5_digest": "84da7acde9c33a75f99d9eab7879490b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 4406,
"upload_time": "2023-07-17T09:24:53",
"upload_time_iso_8601": "2023-07-17T09:24:53.397880Z",
"url": "https://files.pythonhosted.org/packages/c6/56/92d06e81abbfa231c54ea6b3b1013ce277df3886008421e5cce48e7a3f26/saracendb-0.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-17 09:24:53",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "saracendb"
}