A Python version of the Blueprints property graph model interface by tinkerpop
escalant3, updated
🕥
2022-01-21 18:56:55
pyblueprints
:synopsis: Provides a layer to abstract the Python developer from the graph database system used
Following the set of interfaces provided by tinkerpop for Blueprints,
this project aims to give Python developers a similar functionality.
A set of abstract classes are defined in order to guide the design of
implementations for the different graph database engines.
Features
This is an experimental version only permitting partial functionality to:
- Rexster infrastructure, supporting every database supported by Rexster (https://github.com/tinkerpop/rexster/)
- Neo4j database providing abstraction over the neo4j-rest-client API.
Please keep in mind to backup your data before trying this library.
Installation
The easiest way to get pyblueprints installed in your virtualenv is by:
pip install pyblueprints
Usage
This version of pybluerprints allows you to connect to graph databases by a Rexster Instance or through the neo4j-rest-client API. Therefore a Neo4j database can be accessed with both options, although the Neo4j transactional mode is only available through the later.
The Rexster instance also provides connection to the following databases:
- TinkerGraph
- OrientDB
- DEX
- Sail RDF Stores
Rexster
"""""""
Connecting to a Rexster instance
from pyblueprints import RexsterServer, RexsterGraph, RexsterIndexableGraph
Connecting to server
HOST = 'http://localhost:8182'
server = RexsterServer(HOST)
List graphs availbale in server
server.graphs()
[u'tinkergraph', u'gratefulgraph', u'tinkergraph-readonly', u'sailgraph', u'emptygraph']
Connecting to a given graph
graph = RexsterIndexableGraph(server, 'tinkergraph')
neo4j-rest-client
"""""""""""""""""
Creating a graph object through the neo4j-rest-client API
from pyblueprints.neo4j import Neo4jGraph
graph = Neo4jGraph('http://localhost:7474/db/data')
Creating an indexable graph object through the neo4j-rest-client API
from pyblueprints.neo4j import Neo4jIndexableGraph
graph = Neo4jIndexableGraph('http://localhost:7474/db/data')
The available classes are:
- Neo4jGraph
- Neo4jIndexableGraph
- Neo4jTransactionalGraph
- Neo4jTransactionalIndexableGraph
code examples
"""""""""""""
Add/Remove Vertex
'''''''''''''''''
vertex = graph.addVertex()
graph.removeVertex(vertex)
Add/Remove Edge
'''''''''''''''
v1 = graph.addVertex()
v2 = graph.addVertex()
newEdge = graph.addEdge(v1, v2, 'myLabel')
graph.removeEdge(newEdge)
Vertex Methods
''''''''''''''
graph= Neo4jGraph(HOST)
v1 = graph.addVertex()
v2 = graph.addVertex()
newEdge = graph.addEdge(v1, v2, 'myLabel')
vertex = graph.getVertex(_id)
get methods return a generator function
edge = list(vertex.getBothEdges())[0]
edge = list(vertex.getOutEdges())[0]
edges = list(vertex.getInEdges())
Vertex/Edges properties
'''''''''''''''''''''''
vertex_id = vertex.getId()
vertex.setProperty('name', 'paquito')
print vertex.getPropertyKeys()
print vertex.getProperty('name')
vertex.removeProperty('name')
Edge Methods
''''''''''''
outVertex = edge.getOutVertex()
inVertex = edge.getInVertex()
print getLabel()
Add/Remove Manual Index
'''''''''''''''''''''''
index = graph.createManualIndex('myManualIndex', 'vertex')
graph.dropIndex('myManualIndex', 'vertex')
Index Methods
'''''''''''''
index = graph.getIndex('myManualIndex', 'vertex')
vertex = graph.addVertex()
index.put('key1', 'value1', vertex)
print index.count('key1', 'value1')
print index.getIndexName()
print index.getIndexClass()
print index.getIndexType()
get returns a generator function
vertex2 = list(index.get('key1', 'value1'))[0]
index.remove('key1', 'value1', vertex)
Transactional Methods
'''''''''''''''''''''
graph= Neo4jTransactionalGraph(HOST)
graph.startTransaction()
v = graph.addVertex()
Stoping calls the commit
graph.stopTransaction()
vertexId = v.getId()
v = graph.getVertex(vertexId)
graph.startTransaction()
v.setProperty('p1', 'v1')
graph.stopTransaction()
Issues
opened on 2022-01-21 18:56:55 by dependabot[bot]
Bumps ipython from 0.12 to 7.16.3.
Release notes
Sourced from ipython's releases.
7.9.0
No release notes provided.
7.8.0
No release notes provided.
7.7.0
No release notes provided.
7.6.1
No release notes provided.
7.6.0
No release notes provided.
7.5.0
No release notes provided.
7.4.0
No release notes provided.
7.3.0
No release notes provided.
7.2.0
No release notes provided.
7.1.1
No release notes provided.
7.1.0
No release notes provided.
7.0.1
No release notes provided.
7.0.0
No release notes provided.
7.0.0-doc
No release notes provided.
7.0.0rc1
No release notes provided.
7.0.0b1
No release notes provided.
6.2.1
No release notes provided.
... (truncated)
Commits

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase
.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/escalant3/pyblueprints/network/alerts).
opened on 2021-02-08 20:14:44 by dependabot[bot]
Bumps httplib2 from 0.7.2 to 0.19.0.
Changelog
Sourced from httplib2's changelog.
0.19.0
auth: parse headers using pyparsing instead of regexp
httplib2/httplib2#182
auth: WSSE token needs to be string not bytes
httplib2/httplib2#179
0.18.1
explicit build-backend workaround for pip build isolation bug
"AttributeError: 'module' object has no attribute 'legacy'" on pip install
httplib2/httplib2#169
0.18.0
IMPORTANT security vulnerability CWE-93 CRLF injection
Force %xx quote of space, CR, LF characters in uri.
Special thanks to Recar https://github.com/Ciyfly for discrete notification.
https://cwe.mitre.org/data/definitions/93.html
0.17.4
Ship test suite in source dist
httplib2/httplib2#168
0.17.3
IronPython2.7: relative import iri2uri fixes ImportError
httplib2/httplib2#163
0.17.2
python3 + debug + IPv6 disabled: https raised
"IndexError: Replacement index 1 out of range for positional args tuple"
httplib2/httplib2#161
0.17.1
python3: no_proxy was not checked with https
httplib2/httplib2#160
0.17.0
feature: Http().redirect_codes set, works after follow(_all)_redirects check
This allows one line workaround for old gcloud library that uses 308
response without redirect semantics.
httplib2/httplib2#156
0.16.0
... (truncated)
Commits

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase
.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/escalant3/pyblueprints/network/alerts).
opened on 2019-10-02 03:29:20 by dependabot[bot]
Bumps requests from 0.5.0 to 2.20.0.
Changelog
*Sourced from [requests's changelog](https://github.com/psf/requests/blob/master/HISTORY.md).*
> 2.20.0 (2018-10-18)
> -------------------
>
> **Bugfixes**
>
> - Content-Type header parsing is now case-insensitive (e.g.
> charset=utf8 v Charset=utf8).
> - Fixed exception leak where certain redirect urls would raise
> uncaught urllib3 exceptions.
> - Requests removes Authorization header from requests redirected
> from https to http on the same hostname. (CVE-2018-18074)
> - `should_bypass_proxies` now handles URIs without hostnames (e.g.
> files).
>
> **Dependencies**
>
> - Requests now supports urllib3 v1.24.
>
> **Deprecations**
>
> - Requests has officially stopped support for Python 2.6.
>
> 2.19.1 (2018-06-14)
> -------------------
>
> **Bugfixes**
>
> - Fixed issue where status\_codes.py's `init` function failed trying
> to append to a `__doc__` value of `None`.
>
> 2.19.0 (2018-06-12)
> -------------------
>
> **Improvements**
>
> - Warn user about possible slowdown when using cryptography version
> < 1.3.4
> - Check for invalid host in proxy URL, before forwarding request to
> adapter.
> - Fragments are now properly maintained across redirects. (RFC7231
> 7.1.2)
> - Removed use of cgi module to expedite library load time.
> - Added support for SHA-256 and SHA-512 digest auth algorithms.
> - Minor performance improvement to `Request.content`.
> - Migrate to using collections.abc for 3.7 compatibility.
>
> **Bugfixes**
>
> - Parsing empty `Link` headers with `parse_header_links()` no longer
> return one bogus entry.
> ... (truncated)
Commits
- [`bd84045`](https://github.com/psf/requests/commit/bd840450c0d1e9db3bf62382c15d96378cc3a056) v2.20.0
- [`7fd9267`](https://github.com/psf/requests/commit/7fd9267b3bab1d45f5e4ac0953629c5531ecbc55) remove final remnants from 2.6
- [`6ae8a21`](https://github.com/psf/requests/commit/6ae8a2189235b62d7c5b2a6b95528750f046097c) Add myself to AUTHORS
- [`89ab030`](https://github.com/psf/requests/commit/89ab030cdb83a728a30e172bc65d27ba214d2eda) Use comprehensions whenever possible
- [`2c6a842`](https://github.com/psf/requests/commit/2c6a8426aebd853966747f2c851f551c583cb21a) Merge pull request [#4827](https://github-redirect.dependabot.com/requests/requests/issues/4827) from webmaven/patch-1
- [`30be889`](https://github.com/psf/requests/commit/30be889651e7034eaa56edaf5794d68ffbfde9ed) CVE URLs update: www sub-subdomain no longer valid
- [`a6cd380`](https://github.com/psf/requests/commit/a6cd380c640087218695bc7c62311a4843777e43) Merge pull request [#4765](https://github-redirect.dependabot.com/requests/requests/issues/4765) from requests/encapsulate_urllib3_exc
- [`bbdbcc8`](https://github.com/psf/requests/commit/bbdbcc8f0553f112ff68b0950b4128bd8af000fc) wrap url parsing exceptions from urllib3's PoolManager
- [`ff0c325`](https://github.com/psf/requests/commit/ff0c325014f817095de35013d385e137b111d6e8) Merge pull request [#4805](https://github-redirect.dependabot.com/requests/requests/issues/4805) from jdufresne/https
- [`b0ad249`](https://github.com/psf/requests/commit/b0ad2499c8641d29affc90f565e6628d333d2a96) Prefer https:// for URLs throughout project
- Additional commits viewable in [compare view](https://github.com/requests/requests/compare/v0.5.0...v2.20.0)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase
.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/escalant3/pyblueprints/network/alerts).
opened on 2015-05-19 11:24:56 by jenmud
Hi there,
Will you be implementing the blueprints query interface and object?
opened on 2015-04-23 08:27:57 by cocoon-project
a first shot to add mongodb as a backend
needs pymongo ( add to requirements.txt ?)