Skip to main content

Perseus MicrORM

Majormode Perseus MicrORM Python Library is a small, little, mini, tiny, micro Object-Relational Mapping (ORM).

MicrORM is not a object-relational mapping in the sense it maps Pyth objects to a Relational DataBase Management System (RDBMS), but in the sense it maps results of SQL queries, executed on a RDBMS, to Python objects.

Installation

To install Perseus MicrORM Python Library, simply enter the follow command line:

pip install perseus-microrm-library

Usage

import uuid

from majormode.perseus.utils import cast
from majormode.perseus.utils.rdbms import RdbmsConnection


RDBMS_CONNECTION_PROPERTIES = {
    None: {
        'rdbms_hostname': 'localhost',
        'rdbms_port': 5432,
        'rdbms_database_name': 'foo',
        'rdbms_account_username': 'dbo',
        'rdbms_account_password': ''
    }
}

PLACE_IDS = [
    uuid.UUID('54879ffc-a1ec-11e8-85bd-0008a20c190f'),
    uuid.UUID('9025d1c8-a1ec-11e8-9e29-0007cb040bcc')
]

with RdbmsConnection.acquire_connection(
        RDBMS_CONNECTION_PROPERTIES,
        auto_commit=False,
        connection=None) as connection:
    cursor = connection.execute(
        """
        SELECT place_id,
               ST_X(location) AS longitude,
               ST_Y(location) AS latitude,
               ST_Z(location) AS altitude,
               accuracy,
               creation_time
          FROM place
          WHERE place_id IN %[place_ids]s
        """,
        {
            'place_ids': PLACE_IDS 
        })
    rows = cursor.fetch_all()

    places = [
        row.get_object({
            'place_id': cast.string_to_uuid,
            'creation_time': cast.string_to_timestamp})
        for row in cursor.fetch_all()]

    for place in places:
        print(place.place_id, place.longitude, place.latitude)

Metadata

Release files for perseus-microrm-library 1.3.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for perseus-microrm-library 1.3.9
File Size Uploaded Provenance Actions
perseus_microrm_library-1.3.9.tar.gz 11.2 kB Without provenance Details for perseus_microrm_library-1.3.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for perseus-microrm-library 1.3.9
File Interpreter ABI Platform Actions
perseus_microrm_library-1.3.9-py3-none-any.whl Python 3 none any Details for perseus_microrm_library-1.3.9-py3-none-any.whl

Total release size: 26.0 kB

Release files / perseus_microrm_library-1.3.9.tar.gz

Download URL perseus_microrm_library-1.3.9.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
52f88046785f1664d620bf85dce6a09587f4b4d5a013be78ed5b2d0b8bf3a6ac
BLAKE2b-256 checksum
How to use checksums
25aae66cdb4ef4cde3d45ecce3febb94d5d4caa5d2e64f25971418b05908655b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.10.6 Darwin/23.5.0

Release files / perseus_microrm_library-1.3.9-py3-none-any.whl

Download URL perseus_microrm_library-1.3.9-py3-none-any.whl
Size 14.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5c9e6283b31fe75ff42cf7bb4d586770828536fa9b90f0462b23dd461e495ece
BLAKE2b-256 checksum
How to use checksums
0bba2daaaf657987a28b870ae85d2bdccaee5868bb5ba790e33b69ecdcfd197e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.10.6 Darwin/23.5.0

Security for perseus-microrm-library 1.3.9

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page