基于orm的平面文件数据库

Ojota的Python项目详细描述


欢迎使用Ojota的文档!

https://travis-ci.org/MSA-Argentina/ojota.svg?branch=develop

Ojota是一个ORM和平面文件数据库引擎。

Ojota是免费软件!您可以在https://github.com/MSA-Argentina/ojota

它是如何工作的?

首先,我们将定义数据对象

# The information is stored in a file called Persons.jsonclassPerson(Ojota):required_fields=("name","address","age")cache=Memcache()# The information is stored in a file called Teams.yamlclassTeam(Ojota):pk_field="id"data_source=YAMLSource()required_fields=("id","name","color")def__repr__(self):returnself.name

这样我们就可以查询orm对象了

# Some Example queries# "all" returns all the Person ObjectsPerson.all()# "many will return filtered resultsPerson.many(age=30,sorted="name")Person.many(age__lt=30,sorted="-name")Person.many(sorted="name")# "one" will get only one objectTeam.one(1)# you can just send the primary keyTeam.one(name="River Plate")# You can sub-query over the resultspersons=Person.all()elders=persons.many(age__gt=30)fat_elders=elders.many(weight__gt=50)female_elders=elders.many(gender="F")

就这样,你的信息将以纯文本存储,你将拥有 强大的orm来使用它

支持的数据格式

  • JSON
  • YAML
  • CSV
  • JSON through web service
  • XLS

2.0的新功能

  • QuerySets with recursive filtering
  • “Callbacks” support (you can add custom properties with a callback function)
  • Hierarchical Objects support

安装

使用简易安装

sudo easy_install ojota

使用pip

sudo pip install ojota

来源

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

可选依赖项

  • pyyaml - To fecth the data from a file with YAML format
  • request - To fetch JSON form web sevice
  • flask – To run the example web service.

您可能还想看看Ojota的姊妹项目haviana http://havaiana.rtfd.org

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何创建带有图标的按钮?   java我想实现定制的Android应用程序物理键盘键,我需要修改qwerty吗。kl文件或如何添加新的键盘映射?   java Toast并没有显示在Android应用程序中,但它首先被显示,然后在两天后停止   java如何检查URLConnection是否已处于连接状态?   java无法访问其他类中的方法(Android Studio)   java无法获取访问字符串中字符的方法   使用jdax/dex2jar反编译后的java类   java如何使用Junit获取数据块报告   如何在java/j2ee中以编程方式为新闻网站生成RSS?   java如何使用已声明的事实类型动态重新加载规则?   java单例模式使用   javaq:Mockito使用@Mock和@Autowired   java在Raspberry Pi上将RXTX集成到OSGi包时未解决的需求