ripozo-cassandra
ripozo-cassandra is a ripozo-extension that provides a Manager that integrates cqlengine (and thereby Cassandra) with ripozo. It provides convience functions for generating resources. In particular it focues on creating shortcuts for CRUD+L type operations. It fully implements the BaseManager class that is provided in the ripozo package.
Example
This is the minimal example of creating ripozo managers with ripozo-cassandra and integrating them with a resource. As you can see in the example, there are only three functional lines of code.
from cqlengine.models import Model
from cqlengine import columns, connection
from cqlengine.management import create_keyspace, sync_table, delete_keyspace
from ripozo_cassandra import CQLManager
from uuid import uuid4
# Define your model
class Person(Model):
id = columns.UUID(primary_key=True, default=lambda:uuid4())
first_name = columns.Text()
last_name = columns.Text()
# Setup cqlengine and sync the person table
keyspace_name = 'mykeyspace'
connection.setup(['192.168.56.102'], keyspace_name)
create_keyspace(keyspace_name)
sync_table(Person)
# This is where you define your manager
class PersonManageR(CQLManager):
model = Person # Assign the cqlengin model to the manager
fields = ('id', 'first_name', 'last_name',) # Specify the fields to use for this manager
# This is the ripozo specific part.
# This creates a resource class that can be given
# to a dispatcher (e.g. the flask-ripozo package's FlaskDispatcher)
class PersonResource(ResourceBase):
manager = PersonManager
pks = ['id']
# A retrieval method that will operate on the '/api/person' route
# It retrieves the id, first_name, and last_name properties
@apimethod(methods=['GET'])
def get_person(cls, request):
properties = self.manager.retrieve(request.url_params)
return cls(properties=properties)
Metadata
Release files for ripozo-cassandra 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ripozo-cassandra-0.2.1.tar.gz | 4.8 kB | Without provenance | Details |
Release files / ripozo-cassandra-0.2.1.tar.gz
| Download URL | ripozo-cassandra-0.2.1.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c5dc30a29d5e6f995cee52250489ee060d62c006feeabab0fe1cb95371fcb68d
|
|
BLAKE2b-256 checksum How to use checksums |
44f798d9357682dd7a7c6d04e71e37c11054eb12712ef6139d3999171f23f116
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for ripozo-cassandra 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.