PHPackages                             tuefekci/deta - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. tuefekci/deta

ActiveLibrary

tuefekci/deta
=============

v0.0.5(3y ago)4441PHP

Since Mar 28Pushed 3y ago1 watchersCompare

[ Source](https://github.com/tuefekci/Deta-PHP)[ Packagist](https://packagist.org/packages/tuefekci/deta)[ GitHub Sponsors](https://github.com/tuefekci)[ Patreon](https://www.patreon.com/user?u=91143553)[ RSS](/packages/tuefekci-deta/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (5)Versions (6)Used By (0)

Deta PHP
========

[](#deta-php)

This is a PHP client for the [Deta](https://deta.sh/) API.

Explore the Client Deta Space via

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require tuefekci/deta
```

Usage
-----

[](#usage)

To use the Deta client, first create an instance of the `Deta` class, passing in your project ID and API key:

```
use tuefekci\deta\Deta;

$deta = new Deta('your_project_id', 'your_api_key');
```

If you have set ENV Variables or are in a Deta Micro you can leave the keys out.

```
use tuefekci\deta\Deta;
$deta = new Deta();
```

Then, you can use the `base` method to get a reference to a base in your project:

```
$my_base = $deta->base('my_base');
```

You can then use the methods on the base to interact with the items stored in the base:

```
// Insert an item
$my_base->insert(['name' => 'Alice', 'age' => 30]);

// Get an item by key
$item = $my_base->get('abc123');

// Update an item
$my_base->update('abc123', ['name' => 'Bob']);

// Delete an item
$my_base->delete('abc123');

// Query items
$items = $my_base->query(['age' => ['lt' => 40]]);
```

Similarly, you can use the `drive` method to get a reference to a drive in your project:

```
$my_drive = $deta->drive('my_drive');
```

And then use the methods on the drive to interact with the files stored in the drive:

```
// Upload a file
$my_drive->put('file.txt', 'Hello, world!');

// Download a file
$content = $my_drive->get('file.txt');

// List files
$files = $my_drive->list();
```

Documentation for `Deta-PHP` classes and files
----------------------------------------------

[](#documentation-for-deta-php-classes-and-files)

This repository contains `Deta-PHP`, which is a PHP SDK for interacting with the Deta API. The SDK contains the following files and classes:

### deta.php

[](#detaphp)

This file contains the `Deta` class, which is used to instantiate a Deta client. The `Deta` class constructor takes the following parameters:

- `project_id`: the Deta project ID
- `api_key`: the Deta project API key
- `options`: an optional array of options for the Guzzle HTTP client

The `Deta` class provides the following methods:

- `base($base_name)`: creates and returns a new `Base` instance
- `drive($drive_name)`: creates and returns a new `Drive` instance

### base.php

[](#basephp)

This file contains the `Base` class, which provides methods for interacting with Deta Base. The `Base` class constructor takes a single parameter, which is an instance of the Guzzle HTTP client.

The `Base` class provides the following methods:

- `put($items)`: adds or updates items in the base
- `get($key)`: retrieves an item from the base by key
- `delete($key)`: deletes an item from the base by key
- `insert($item)`: adds a new item to the base
- `update($key, $set = null, $increment = null, $append = null, $delete = null)`: updates an item in the base by key
- `query($query = null, $limit = null, $last = null)`: queries the base

### drive.php

[](#drivephp)

This file contains the `Drive` class, which provides methods for interacting with Deta Drive. The `Drive` class constructor takes a single parameter, which is an instance of the Guzzle HTTP client.

The `Drive` class provides the following methods:

- `put($name, $content, $content_type = null)`: uploads a new file to Deta Drive
- `initializeChunkedUpload($name)`: initiates a chunked upload to Deta Drive
- `uploadChunkedPart($upload_id, $name, $part, $content)`: uploads a part of a chunked upload to Deta Drive
- `endChunkedUpload($upload_id, $name)`: ends a chunked upload to Deta Drive
- `abortChunkedUpload($upload_id, $name)`: aborts a chunked upload to Deta Drive
- `get($name)`: retrieves a file from Deta Drive
- `list($limit = null, $prefix = null, $last = null)`: lists files in Deta Drive
- `delete($name)`: deletes a file from Deta Drive by name

### Namespace

[](#namespace)

All classes are defined in the `tuefekci\deta` namespace. To use the SDK in your PHP code, include the following statement:

```
use tuefekci\deta\Deta;
use tuefekci\deta\Base;
use tuefekci\deta\Drive;
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

22

—

LowBetter than 23% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

5

Last Release

1129d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6e92b5d223c1a544d7c154fad2f7be64cc5922c9ea4a7ab14b33b38ceb3fd38b?d=identicon)[tuefekci](/maintainers/tuefekci)

---

Top Contributors

[![tuefekci](https://avatars.githubusercontent.com/u/2657626?v=4)](https://github.com/tuefekci "tuefekci (17 commits)")

---

Tags

detadeta-basedeta-drivedeta-microsdeta-spacephp

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/tuefekci-deta/health.svg)

```
[![Health](https://phpackages.com/badges/tuefekci-deta/health.svg)](https://phpackages.com/packages/tuefekci-deta)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.6k509.9M16.9k](/packages/laravel-framework)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M647](/packages/sylius-sylius)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19462.3M1.3k](/packages/drupal-core)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[nutgram/nutgram

The Telegram bot library that doesn't drive you nuts

714214.9k8](/packages/nutgram-nutgram)[tempest/framework

The PHP framework that gets out of your way.

2.1k23.1k9](/packages/tempest-framework)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
