Skip to main content

Medial - minimal database assistance library

Medial is not an abstraction layer to magically make your classes persistent. it merely tries to alleviate some of the tedium, hopefully not by adding more tedium or new complexity.

Knowledge of SQL is still necessary, as well as the specific flavour(s) used. Medial currently supports SQLite and Postgres.

API documentation is available.

Example usage

import medial

class Thing(Persistent):

  table = 'things'
  key = 'name'
  persistence = {
    'name': {
    },
    'description': {
    }
  }

  def __init__(self, name=None, description=None, new=False):

    if name and not new:
      # lookup
      super().__init__(name)
    else:
      # new object
      super().__init__()
      self.name = name
      self.description = description

# configure medial
medial.configure('file:///tmp/example.sqlite')

# lookup thing or create new thing
try:
  # lookup
  t = Thing(name='example')
except medial.exceptions.ObjectNotFound:
  # create
  t = Thing(name='example', new=True)
  t.commit()

Status

Medial is in active development. Due to its minimal design, features you may expect (relations, for example) are easily implemented with regular SQL, but if/when new features are introduced (relations, for example), existing code will almost certainly continue to work.

Current features

  • SQLite and Postgres
  • Python enumerations
  • Validation and setter override functions

Planned features

  • Relations

Metadata

Release files for medial 0.4.6

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

Source distribution (sdist)

Source distribution for medial 0.4.6
File Size Uploaded
medial-0.4.6.tar.gz 11.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for medial 0.4.6
File Interpreter ABI Platform
medial-0.4.6-py3-none-any.whl Python 3 none any Details

Total release size: 25.1 kB

Release files / medial-0.4.6.tar.gz

Download URL medial-0.4.6.tar.gz
Size 11.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1ac279582ab5cf8aa9e1f8ead37e9b61b769be9c5e260d1b45feaaf1eafa9d43
BLAKE2b-256 checksum
How to use checksums
255c18bd179dcbff25fe6e5af318d703c2d8ccf2ad5005a25b6da76bfa4b3120
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.7

Release files / medial-0.4.6-py3-none-any.whl

Download URL medial-0.4.6-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8cb377e184a603b53896f761d52acc7c7897d564707a6b8920d597cd8026d331
BLAKE2b-256 checksum
How to use checksums
56a005d57ddbe9c491fd0a093c8ddc72d241bd97bd63a61da2de31e63c1aea2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.7

Release history Release notifications | RSS feed

This release

0.4.6 This release

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

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