New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

object-api

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

object-api

pipPyPI
Version
0.0.1
Maintainers
1

The Object API

ObjectAPI provides a concise negative-boilerplate paradigm for creating full-stack web applications with Python. It is built on top of FastAPI, SQLModel, and pydantic.

Features

  • Active record pattern for database access
  • Automatic get_by_id lookup for instance methods with route decorators
  • Automatic CRUD routes
  • Scheduled service methods
  • Managed DB sessions for service methods and for each request

Installation

pip install object-api

Usage

from object_api import App, Entity, RouterBuilder, ServiceBuilder

app = App()

class User(Entity):
    class Meta:
        service = ServiceBuilder()
        router = RouterBuilder()

        new_private = ["pass"]

    name: str
    pass: str
    age: int

    @service.servicemethod
    @classmethod
    def remove_inactive(cls):
        for user in User.get_all():
            if user.age > 100:
                user.delete()
    
    @router.route()
    def get_name(self):
        return self.name

    @router.post("/change_name")
    def change_name(self, name: str):
        self.name = name
        self.save()

app = App()

app.run()

Documentation

https://github.com/ComputaCo/object-api

License

MIT

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts