neo4j图形数据库的对象映射器。
cythereal-neomodel的Python项目详细描述
注:这是NeoModel的定制版本,供个人使用。使用 official version取而代之。
一个用于neo4j图形数据库的对象图映射器(ogm),构建在令人敬畏的neo4j_driver
- 熟悉的django模型样式定义。
- 强大的查询api。
- 通过基数限制强制您的架构。
- 完全事务支持。
- 线程安全。
- 保存前/保存后/删除挂钩。
- 通过django_neomodel 实现Django集成
文档
在readthedocs上提供。
要求
- Python2.7,3.4+
- Neo4J 3.0、3.1、3.2、3.3
安装
从PYPI安装(推荐):
$ pip install neomodel
从github安装:
$ pip install git+git://github.com/robinedwards/neomodel.git@HEAD#egg=neomodel-dev
将2.x升级到3.x
- Now utilises neo4j_driver as the backend which uses bolt so neo4j 3 is required
- Connection now set through config.DATABASE_URL (see getting started docs)
- The deprecated category() method on StructuredNode has been removed
- The deprecated index property on StructuredNode has been removed
- The streaming=True flag is now irrelevant with bolt and produces a deprecation warning
- Batch operations must now be wrapped in a transaction in order to be atomic
- Indexing NodeSets returns a single node now as opposed to a list
贡献
想法,错误,测试和拉请求总是受欢迎的。
运行测试套件
确保安装了新的virtualenv和nose:
$ pip install nose
也可以使用Neo4J数据库版本3或更高版本来运行测试。(它将在每次测试运行时擦除此数据库):
$ export NEO4J_BOLT_URL=bolt://neo4j:neo4j@localhost:7687 # (the default)
设置虚拟环境,安装NeoModel进行开发并运行测试套件:
$ virtualenv venv $ source venv/bin/activate $ python setup.py develop $ nosetests -s
如果您第一次运行neo4j数据库,测试套件会将密码设置为“test”。
如果安装了docker-compose,则可以对所有受支持的python运行测试套件 口译员和NEO4J版本:
# in the project's root folder: $ ./tests-with-docker-compose.sh