DataCamp
Learn how to configure DataCamp for use with Filebase.
DataCamp is an online learning platform that allows users to build and develop programming and data science skills from browser-based development environments. DataCamp offers a wide variety of tutorials, courses, and educational resources that engage students in an interactive interface to learn about coding.
Read below to learn how to use DataCamp with Filebase.
From the dashboard, select ‘Workspace’ from the top navigation menu bar.

This example uses a Python-based workspace:




For the value of these variables, enter your Filebase Access Key and Filebase Secret Key. Name this integration ‘Filebase Keys’. Then select ‘Create’.




import os
import boto3
filebase_access_key = os.environ["FILEBASE_ACCESS_KEY"]
filebase_secret_key = os.environ["FILEBASE_SECRET_KEY"]
s3 = boto3.client('s3',
endpoint_url='https://s3.filebase.com',
aws_access_key_id=filebase_access_key,
aws_secret_access_key=filebase_secret_key)
response = s3.list_buckets()
# Output the bucket names
print('Existing buckets:')
for bucket in response['Buckets']:
print(f' {bucket["Name"]}')

Your Filebase bucket names should be returned:

import os
import boto3
filebase_access_key = os.environ["FILEBASE_ACCESS_KEY"]
filebase_secret_key = os.environ["FILEBASE_SECRET_KEY"]
s3 = boto3.client('s3',
endpoint_url='https://s3.filebase.com',
aws_access_key_id=filebase_access_key,
aws_secret_access_key=filebase_secret_key)
bucket_name = "new-filebase-bucket-name"
s3.create_bucket(Bucket=bucket_name)

The response data should resemble the following, including a 200 HTTP Status Code indicating the success:

import os
import boto3
filebase_access_key = os.environ["FILEBASE_ACCESS_KEY"]
filebase_secret_key = os.environ["FILEBASE_SECRET_KEY"]
s3 = boto3.client('s3',
endpoint_url='https://s3.filebase.com',
aws_access_key_id=filebase_access_key,
aws_secret_access_key=filebase_secret_key)
file_path = ""
bucket_name = "filebase-bucket-name"
key_name = "object-name"
s3.put_object(Body=file_path, Bucket=bucket_name, Key=key_name)
Replace
filebase-bucket-name
with your Filebase bucket name, and object-name
with the name of the file to be uploaded.
The response data should resemble the following, including a 200 HTTP Status Code indicating the success:


import os
import boto3
filebase_access_key = os.environ["FILEBASE_ACCESS_KEY"]
filebase_secret_key = os.environ["FILEBASE_SECRET_KEY"]
s3 = boto3.client('s3',
endpoint_url='https://s3.filebase.com',
aws_access_key_id=filebase_access_key,
aws_secret_access_key=filebase_secret_key)
bucket_name = "filebase-bucket-name"
key_name = "object-name"
s3.get_object(Bucket=bucket_name, Key=key_name)
Replace
filebase-bucket-name
with your Filebase bucket name, and object-name
with the name of the file to be uploaded.
The response data should resemble the following, including a 200 HTTP Status Code indicating the success:

If you have any questions, please join our Discord server, or send us an email at [email protected]
Last modified 1yr ago