YepCode Storage
YepCode Storage is a robust file storage system designed to handle file operations within your processes. It provides a simple and efficient way to store, retrieve, and manage files through accessible source code integration.
With YepCode Storage, you can perform various file operations including:
- File Upload: Store files from your processes or external sources
- File Download: Retrieve files for processing or analysis
- File Management: List and delete your stored files
Use Cases
Section titled “Use Cases”YepCode Storage is perfect for scenarios such as:
- Document Processing: Store uploaded documents for analysis or transformation
- Image Processing: Handle image files for resizing, conversion or analysis
- Data Export: Generate and store reports, CSV files or other exports
- File Sharing: Create temporary file storage for sharing between processes
- Backup Operations: Store important files as part of backup workflows
Access Methods
Section titled “Access Methods”YepCode Storage can be accessed through multiple methods, making it flexible for different use cases and integration scenarios:
1. From Process Source Code
Section titled “1. From Process Source Code”The most direct way to use YepCode Storage is from within your process source code using the yepcode.storage
helper:
const path = require("node:path");const localPath = path.join(process.env.TMP_DATA_DIR, "myfile.txt");await yepcode.storage.upload("path/myfile.txt", fs.createReadStream(localPath));
const files = await yepcode.storage.list();console.log(files);
const path = require("node:path");const localPath = path.join(process.env.TMP_DATA_DIR, "downloaded.txt");const stream = await yepcode.storage.download("path/myfile.txt");stream.pipe(fs.createWriteStream(localPath));
await yepcode.storage.delete("path/myfile.txt");
import oslocal_path = os.path.join(os.environ.get("TMP_DATA_DIR"), "myfile.txt")with open(local_path, "rb") as f: obj = yepcode.storage.upload("path/myfile.txt", f) print("Uploaded:", obj.name, obj.size, obj.link)
objects = yepcode.storage.list()for obj in objects: print(obj.name, obj.size, obj.link)
import oslocal_path = os.path.join(os.environ.get("TMP_DATA_DIR"), "downloaded.txt")content = yepcode.storage.download("path/myfile.txt")with open(local_path, "wb") as f: f.write(content)
yepcode.storage.delete("myfile.txt")
2. From External Systems via REST API
Section titled “2. From External Systems via REST API”YepCode Storage is also available through our REST API, allowing you to upload, download, list, and delete files from any external system. This enables integration with third-party applications, web services, or any system that can make HTTP requests.
3. Using YepCode Run SDK
Section titled “3. Using YepCode Run SDK”You can interact with YepCode Storage from external applications using our YepCode Run SDK, available for both JavaScript and Python:
const { YepCodeStorage } = require('@yepcode/run');const fs = require('fs');
const storage = new YepCodeStorage({ apiToken: 'your-api-token' });
// Upload a file (using Node.js stream)await storage.upload('path/myfile.txt', fs.createReadStream('./myfile.txt'));
// List filesconst files = await storage.list();console.log(files);
// Download a fileconst stream = await storage.download('path/myfile.txt');stream.pipe(fs.createWriteStream('./downloaded.txt'));
// Delete a fileawait storage.delete('myfile.txt');
Install the SDK: npm install @yepcode/run
from yepcode_run import YepCodeStorage, YepCodeApiConfig
storage = YepCodeStorage( YepCodeApiConfig(api_token='your-api-token'))
# Upload a filewith open('myfile.txt', 'rb') as f: obj = storage.upload('myfile.txt', f) print('Uploaded:', obj.name, obj.size, obj.link)
# List all storage objectsobjects = storage.list()for obj in objects: print(obj.name, obj.size, obj.link)
# Download a filecontent = storage.download('myfile.txt')with open('downloaded.txt', 'wb') as f: f.write(content)
# Delete a filestorage.delete('myfile.txt')
Install the SDK: pip install yepcode-run
4. From AI Agents via MCP Server
Section titled “4. From AI Agents via MCP Server”YepCode Storage is available as MCP (Model Context Protocol) tools in our MCP server, making it incredibly powerful when combined with AI agents. This enables AI agents to:
- Handle file-based tasks end-to-end without manual intervention
- Process complex data using the full power of Python/JavaScript ecosystems
- Store and retrieve results securely in the cloud
- Chain multiple operations across different files and datasets
When combined with our run_code
tool, AI agents can upload files, generate and execute code to process them, and store results back to YepCode Storage automatically.