More Neo4j than you can shake a cat at
Project description
tamarind
🥭
manage multiple ephemeral neo4j containers
tamarind
is a system that manages Neo4j databases by provisioning Docker container resources for you. The user-facing API provides access to a dictionary-like lookup for your databases, and allows you to start and stop database servers on the fly.
Installation
Install from PyPI using pip:
pip3 install tamarind
You will need Docker already installed if you intend to use the Docker provisioning service. You can install Docker with the script from https://get.docker.com/
.
Usage
Creating a new db
from tamarind import Neo4jDockerProvisioner
N = Neo4jDockerProvisioner()
N.start("MyDatabase")
Now you can access this graph database through py2neo:
>>> N["MyDatabase"]
<py2neo.Graph>
The object returned is a py2neo.database.Graph
object:
>>> N["MyDatabase"].run("MATCH (a:Person) RETURN a.name, a.born LIMIT 4").data()
[{'a.born': 1964, 'a.name': 'Keanu Reeves'},
{'a.born': 1967, 'a.name': 'Carrie-Anne Moss'},
{'a.born': 1961, 'a.name': 'Laurence Fishburne'},
{'a.born': 1960, 'a.name': 'Hugo Weaving'}]
List all
>>> N.ps().keys()
['MyDatabase', 'OldDatabase']
Stop a service
>>> N.stop("OldDatabase")
>>> N.ps().keys()
['MyDatabase']
Custom Provisioners
If you provision Neo4j instances via resources other than Docker (e.g. via AWS EC2 AMIs), you can extend the Neo4jProvisioner
class with start
and ps
function calls (stop
is an optional implementation in Tamarind).
Legal
Licensed under Apache 2.0. Reach out to opensource@fitmango.com with questions.
Copyright 2021 FitMango.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this codebase except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Made with ❤️ at 🥭
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
File details
Details for the file tamarind-0.2.1.tar.gz
.
File metadata
- Download URL: tamarind-0.2.1.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4a0085ddf1454f274e7e0a5665ae77b98ce98319df03589fc6153de191ed786 |
|
MD5 | 6b1e621d42f0546acdccdc898bdb8d00 |
|
BLAKE2b-256 | 644f8b2c3c7b6d6288651550742eac285d11c9e81d14311a71ab0bd7f82605e4 |