Prism-py

Latest version: v0.0.3

Safety actively analyzes 722674 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.0.3

What's New?

- Added project image to [PyPI](https://pypi.org/project/prism-py/0.0.3/) page and GitHub
- Fixed prism ecosystem references (on README)

0.0.2

We're excited to release version 0.0.2 of prism-ts with significant type system improvements and quality enhancements.

What's New?

- ✅ **Improved Type Definitions**: Added explicit return types to all public API methods
- 🚀 **Better Performance**: Fixed "slow types" issues to enhance type checking speed

Next Steps

We're working on several exciting features for upcoming releases:

- Schema visualization improvements
- Advanced filtering capabilities
- Enhanced error handling with retry logic
- Expanded test coverage

Thank you for using prism-ts! We appreciate your feedback and contributions.

0.0.1

We're excited to announce the first release of prism-ts - a TypeScript client library designed to provide full type safety and simplified interaction with prism-py generated APIs.

This library creates a seamless bridge between your database-driven API and frontend applications with zero boilerplate and complete type safety.

Key Features

- 🔒 **Type-Safe API Client**: Fully typed requests and responses
- 🔄 **Code Generation**: Generate TypeScript interfaces from database schemas
- 📚 **Metadata Explorer**: Explore your API structure programmatically
- 🔧 **CRUD Operations**: Standardized operations for all database tables
- 🔍 **Type Inference**: Leverages TypeScript's type system for excellent IDE support
- 📝 **Query Builder**: Type-safe filter construction for API requests
- 🧩 **Zero Configuration**: Works out of the box with prism-py APIs

Installation

bash
Using Deno
deno add jsr/prism-ts

Using npm via deno2node
npm install jsr/prism-ts


Quick Start

typescript
import { BaseClient, Prism } from "jsr/prism-ts";

// Initialize the client pointing to your prism-py API
const client = new BaseClient("http://localhost:8000");
const prism = new Prism(client);

// Initialize and load schema metadata
await prism.initialize();

// Generate TypeScript types (during development)
await prism.generateTypes("./src/types");

// Get type-safe operations for a specific table
const userOperations = await prism.getTableOperations("public", "users");

// Fetch with filtering, sorting, and pagination
const activeUsers = await userOperations.findMany({
where: { status: "active" },
orderBy: "created_at",
order_dir: "desc",
limit: 10,
offset: 0,
});

// Create a new record
const newUser = await userOperations.create({
username: "johndoe",
email: "johnexample.com",
status: "active"
});

// Update a record
await userOperations.update(newUser.id, {
status: "inactive"
});

// Delete a record
await userOperations.delete(newUser.id);


The Prism Ecosystem

This release is part of the Prism ecosystem, designed to create a seamless bridge between your database and type-safe client applications:

- **prism-py**: Server-side library for automatic API generation
- **prism-ts**: Client-side library for consuming prism-py APIs with full type safety

Together, these libraries enable end-to-end type safety and eliminate boilerplate code across your full stack.

Notes

- This is an initial release focused on core functionality
- Compatible with prism-py version 0.0.1 and later
- Built for Deno with JSR package distribution
- View operations have some limitations due to server-side issues in prism-py
- Please report any issues or feature requests!

Thank you for trying prism-ts! We're looking forward to your feedback.

Links

Releases

Has known vulnerabilities

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.