Skip to content

BetaHuhn/deta-space-exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deta Space Data Exporter

Simple Deno script that can export your data (Horizons, Instances, Collections) from Deta Space.

Setup

Make sure you have Deno installed (see Deno Docs for instructions).

Clone this repository:

git clone https://github.com/BetaHuhn/deta-space-exporter

Navigate into the repository:

cd deta-space-exporter

Authentication

To use the script you need to provide your Deta Space Access Token. You can either provide it as an environment variable:

DETA_ACCESS_TOKEN=<your-access-token> ./deta-space-exporter

or create a .env file in the root of the repository with the following content:

DETA_ACCESS_TOKEN=<your-access-token>

Usage

You can either run the compiled binary:

./deta-space-exporter

or run it via the Deno run command:

deno run --allow-net --allow-read --allow-write --allow-env --allow-run main.ts

To export your data you need to first create snapshots and then download them. This is two separate steps as creating snapshots might take some additional time.

Creating Snapshots

To create snapshots you can use the create command and optionally provide a scope:

./deta-space-exporter create <scope>

Available scopes:

  • horizons
  • instances
  • collections

If no scope is provided snapshots will be created for all three.

Download Snapshots

To download snapshots you can use the download command and optionally provide a scope:

./deta-space-exporter download <scope>

Available scopes:

  • horizons
  • instances
  • collections

If no scope is provided snapshots will be downloaded for all three.

Options

  • --output=<path> - The path where the snapshots should be saved (default: ./exports)
  • --unzip=<boolean> - Unzip the snapshots after downloading (default: true)

The snapshots will be saved in the ./exports folder by default. You can change this by providing the --output argument with a path:

./deta-space-exporter download --output <path>

By default the script will unzip the snapshots. You can disable this by providing the --no-unzip argument:

./deta-space-exporter download --no-unzip

Examples

Create and Download Snapshots for all data

Create snapshots for all data:

./deta-space-exporter create

Download snapshots for all data:

./deta-space-exporter download

Create and Download Snapshots for a specific scope

Create snapshots your Collections:

./deta-space-exporter create collections

Download snapshots for your Collections:

./deta-space-exporter download collections

License

This project is licensed under the MIT License - see the LICENSE file for details

About

Script to export all your Deta Space data

Resources

License

Stars

Watchers

Forks