silly-db


Namesilly-db JSON
Version 2.0.2 PyPI version JSON
download
home_pagehttps://github.com/byoso/silly_db
SummaryVery light ORM for SQLite, simple and efficient
upload_time2022-09-24 21:39:32
maintainer
docs_urlNone
authorVincent Fabre
requires_python>=3.6
licenseMIT
keywords database sqlite3 sqlite db orm
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![logo silly db](https://i.goopics.net/60cef4.png)

# Silly DB
*Quick and easy SQLite ORM  for local python applications.*

## Is it really an ORM ?
It is indeed a ***reversed*** ORM:

- The structure of the DB is built from classic .sql files.
- Then the magic occures to get the models **from** the DB itself. Usually, an ORM does the contrary.

Some minimum SQL knowledge **is required**, the purpose of Silly DB is not to get rid of SQL (actualy, SQL is the best language to manage... a SQL database), but to handle the annoying things, and let you focus on your application with a minimum amount of code.

## Installation

```
$ pip install silly-db
```

## Fast way to begin

Create a new directory and open a console in there.

Get a basic working structure with 'plop':
```
$ silly-db plop db
```

Congratulations ! You've got your database ready to work !
To understand how it works, open the differents files provided and read the comments, it will be easy to adapt to your own needs.

get more info with:
```
$ silly-db -h
```
and more about the plop options here:
```
$ silly-db plop
```

## Examples (simple CRUD)

```python

Cat = db.model('cat') # model created from the existing database

Cat.sil.insert(name="Kutty", owner_id=1)
cats = Cat.sil.filter("name like 'K%'")
print(cats.jsonify())

>>>[{'id': 58, 'name': 'Kutty', 'owner_id': 1}]

Cat.sil.update("id=58", name="Duke")
cat = Cat.sil.get("id=58")
print(cat.name)
>>> 'Duke'

print(cat.jsonify())
>>>{'id': 58, 'name': 'Duke', 'owner_id': 1}

Cat.sil.delete("id=58")

```

## Documentation
Take a look at the [wiki here](https://github.com/byoso/silly_db/wiki#silly-db-wiki)


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/byoso/silly_db",
    "name": "silly-db",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "database sqlite3 sqlite db orm",
    "author": "Vincent Fabre",
    "author_email": "peigne.plume@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/0e/0d/2a4669f484af4f83d587c82fb3c792059fe3bbb5dd91043dd10e4a435009/silly-db-2.0.2.tar.gz",
    "platform": null,
    "description": "![logo silly db](https://i.goopics.net/60cef4.png)\n\n# Silly DB\n*Quick and easy SQLite ORM  for local python applications.*\n\n## Is it really an ORM ?\nIt is indeed a ***reversed*** ORM:\n\n- The structure of the DB is built from classic .sql files.\n- Then the magic occures to get the models **from** the DB itself. Usually, an ORM does the contrary.\n\nSome minimum SQL knowledge **is required**, the purpose of Silly DB is not to get rid of SQL (actualy, SQL is the best language to manage... a SQL database), but to handle the annoying things, and let you focus on your application with a minimum amount of code.\n\n## Installation\n\n```\n$ pip install silly-db\n```\n\n## Fast way to begin\n\nCreate a new directory and open a console in there.\n\nGet a basic working structure with 'plop':\n```\n$ silly-db plop db\n```\n\nCongratulations ! You've got your database ready to work !\nTo understand how it works, open the differents files provided and read the comments, it will be easy to adapt to your own needs.\n\nget more info with:\n```\n$ silly-db -h\n```\nand more about the plop options here:\n```\n$ silly-db plop\n```\n\n## Examples (simple CRUD)\n\n```python\n\nCat = db.model('cat') # model created from the existing database\n\nCat.sil.insert(name=\"Kutty\", owner_id=1)\ncats = Cat.sil.filter(\"name like 'K%'\")\nprint(cats.jsonify())\n\n>>>[{'id': 58, 'name': 'Kutty', 'owner_id': 1}]\n\nCat.sil.update(\"id=58\", name=\"Duke\")\ncat = Cat.sil.get(\"id=58\")\nprint(cat.name)\n>>> 'Duke'\n\nprint(cat.jsonify())\n>>>{'id': 58, 'name': 'Duke', 'owner_id': 1}\n\nCat.sil.delete(\"id=58\")\n\n```\n\n## Documentation\nTake a look at the [wiki here](https://github.com/byoso/silly_db/wiki#silly-db-wiki)\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Very light ORM for SQLite, simple and efficient",
    "version": "2.0.2",
    "split_keywords": [
        "database",
        "sqlite3",
        "sqlite",
        "db",
        "orm"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "a87ddd46f195d4273e5f6be3120d8f2e",
                "sha256": "a63ca5491d957818a265e2b937ff9fb868e632dd7dbab2910aaa3d2db6f490ac"
            },
            "downloads": -1,
            "filename": "silly_db-2.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a87ddd46f195d4273e5f6be3120d8f2e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 13643,
            "upload_time": "2022-09-24T21:39:30",
            "upload_time_iso_8601": "2022-09-24T21:39:30.838388Z",
            "url": "https://files.pythonhosted.org/packages/d2/1d/447a36e1cc5091d6066eee8d4d01130d401c4022ec24fbe14a4d62395089/silly_db-2.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "b31687e42a0f107ca9eaf7234b9f8072",
                "sha256": "9115e91d72171e21f45947279e0933e8239bb50401b4ea6c5144a0f36df3c857"
            },
            "downloads": -1,
            "filename": "silly-db-2.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "b31687e42a0f107ca9eaf7234b9f8072",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 11554,
            "upload_time": "2022-09-24T21:39:32",
            "upload_time_iso_8601": "2022-09-24T21:39:32.999795Z",
            "url": "https://files.pythonhosted.org/packages/0e/0d/2a4669f484af4f83d587c82fb3c792059fe3bbb5dd91043dd10e4a435009/silly-db-2.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-09-24 21:39:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "byoso",
    "github_project": "silly_db",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "silly-db"
}
        
Elapsed time: 0.47390s