基于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中创建固定大小的泛型数组?   javascript Paypal Braintree订阅付款   使用BufferedReader和PrintWriter实现java数据持久化?   类似于iCloud的java唯一google id   java使用网格布局和抓取组合框   java我的while循环无限运行,当我检查它时,它说while循环没有主体,而我认为它显然没有主体   java LWJGL碰撞3D OpenGL   java将Tibco RV切换到WebSphere MQ?   java如何使用Postman从curl发布REST   java是超级的,在通用通配符中是独占的吗?   在swing 1.5中,java在指定时间后自动关闭非模态对话框   java PrimeFaces饼图在JSF 2.0中不显示   java如何在Spring MVC中提供带有xml配置的默认bean实现?   java在eclipse中使用按钮关闭JFrame   java Sqoop jar已弃用   Java中的Getter方法