Simple and fast ORM for python
Project description
# OreoPy
Simple and fast ORM for python.
[](https://github.com/maclinchy/oreopy/blob/master/LICENSE)
## Installation
There are two ways to install:
- **Install OreoPy from PyPI (recommended):**
```sh
sudo pip install oreopy
```
- **Install OreoPy from GitHub source:**
```sh
git clone https://github.com/maclinchy/oreopy.git
cd oreopy
sudo python3 setup.py install
```
------------------
## Getting started
Let's create a file called `models.py`
```python3
from oreopy.models import base
from oreopy.fields import IntegerField, TextField
class Album(base.Model):
title = TextField()
artist = TextField()
year = IntegerField()
album = Album()
album.create_table()
```
New record in database:
```python3
from models import Album
new_album = Album(title="Hits", artist="deadmau5", year=2018)
new_album.save()
```
Update record in database:
```python3
upd_album = Album(title="Greatest Hits")
upd_album.update(pk=1)
```
Delete record from database:
```python3
del_album = Album()
del_album.delete(pk=1)
```
Simple and fast ORM for python.
[](https://github.com/maclinchy/oreopy/blob/master/LICENSE)
## Installation
There are two ways to install:
- **Install OreoPy from PyPI (recommended):**
```sh
sudo pip install oreopy
```
- **Install OreoPy from GitHub source:**
```sh
git clone https://github.com/maclinchy/oreopy.git
cd oreopy
sudo python3 setup.py install
```
------------------
## Getting started
Let's create a file called `models.py`
```python3
from oreopy.models import base
from oreopy.fields import IntegerField, TextField
class Album(base.Model):
title = TextField()
artist = TextField()
year = IntegerField()
album = Album()
album.create_table()
```
New record in database:
```python3
from models import Album
new_album = Album(title="Hits", artist="deadmau5", year=2018)
new_album.save()
```
Update record in database:
```python3
upd_album = Album(title="Greatest Hits")
upd_album.update(pk=1)
```
Delete record from database:
```python3
del_album = Album()
del_album.delete(pk=1)
```
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size oreopy-0.0.4-py3.7.egg (6.7 kB) | File type Egg | Python version 3.7 | Upload date | Hashes View |
Filename, size oreopy-0.0.4.tar.gz (2.5 kB) | File type Source | Python version None | Upload date | Hashes View |