Skip to main content

Flat File Database with ORM

Project description

Welcome to Ojota’s documentation!

Ojota is a ORM and flat file database engine.

Ojota is Free Software! you can check the code at https://github.com/MSA-Argentina/ojota

How does it works?

First we will define the data object

# The information is stored in a file called Persons.json
class Person(Ojota):
    required_fields = ("name", "address", "age")
    cache  = Memcache()

# The information is stored in a file called Teams.yaml
class Team(Ojota):
    pk_field = "id"
    data_source = YAMLSource()
    required_fields = ("id", "name", "color")

    def __repr__(self):
        return self.name

Just with that we can query the ORM objects

# Some Example queries
# "all" returns all the Person Objects
Person.all()
# "many will return filtered results
Person.many(age=30, sorted="name")
Person.many(age__lt=30, sorted="-name")
Person.many(sorted="name")

# "one" will get only one object
Team.one(1) # you can just send the primary key
Team.one(name="River Plate")

# You can sub-query over the results
persons = Person.all()
elders = persons.many(age__gt=30)
fat_elders = elders.many(weight__gt=50)
female_elders = elders.many(gender="F")

That’s it your information will be stored in plain text and you will have a powerfull ORM to play with it

Supported data formats

  • JSON

  • DSON

  • YAML

  • CSV

  • JSON through web service

  • XLS

New Features for 2.0

  • QuerySets with recursive filtering

  • “Callbacks” support (you can add custom properties with a callback function)

  • Hierarchical Objects support

Installation

With easy_install

sudo easy_install ojota

With pip

sudo pip install ojota

From source

git clone https://github.com/MSA-Argentina/ojota.git
sudo python setup.py install

Optional dependencies

  • pyyaml - To fecth the data from a file with YAML format

  • dogeon - To fecth the data from a file with DSON format

  • request - To fetch JSON form web sevice

  • flask – To run the example web service.

You might also want to to take a look at Ojota’s sister project called Havaiana http://havaiana.rtfd.org

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ojota-3.3.1.dev1.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ojota-3.3.1.dev1-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file ojota-3.3.1.dev1.tar.gz.

File metadata

  • Download URL: ojota-3.3.1.dev1.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for ojota-3.3.1.dev1.tar.gz
Algorithm Hash digest
SHA256 b93ba04ddd295033c1a5dba0098ad818705801bfdf561ddd0de96bef38a92311
MD5 88e9d9ecb456bbd95bd7ee194eac6255
BLAKE2b-256 7dfdf9c24c62643988a8dde41c0316030c8de0d04ec223467d2c68f2e7fec1ec

See more details on using hashes here.

File details

Details for the file ojota-3.3.1.dev1-py3-none-any.whl.

File metadata

  • Download URL: ojota-3.3.1.dev1-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for ojota-3.3.1.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 d9f72550fee101677cc8e00fe40debac0630ec8b27018ac9b0653871a196b293
MD5 9f3ce2be9928ab85aaba5ecdaaab983e
BLAKE2b-256 3c272ceb7446f7657262255b4ad6b9779c3ffb05a18884b5df5bdf442945a123

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page