- Python 3
- TimescaleDB installed
- Schema has been set up using the [
schema.sql
][schema] script.
We recommend to create a separate virtual environment for this project and install the requirements there:
virtualenv env && source env/bin/activate
pip install -r requirements.txt
-
Download sample NFT data:
wget https://assets.timescale.com/docs/downloads/nft_sample.zip
-
Unzip the file
unzip nft_sample.zip
-
Insert the content of the CSV files into the database using psql:
psql -x "postgres://tsdbadmin:{YOUR_PASSWORD_HERE}@{YOUR_HOSTNAME_HERE}:{YOUR_PORT_HERE}/tsdb?sslmode=require"
If you're using Timescale Cloud, the instructions under
How to Connect
provide a customized command to run to connect directly to your database.\copy accounts FROM 001_accounts.csv CSV HEADER; \copy collections FROM 002_collections.csv CSV HEADER; \copy assets FROM 003_assets.csv CSV HEADER; \copy nft_sales FROM 004_nft_sales.csv CSV HEADER;
- Open the
.streamlit/secrets.toml
file - Modify the secrets so Streamlit can connect to your database
[NFT_DATABASE] dbname="tsdb" host="xxxxxxxxxxxxxx.tsdb.cloud.timescale.com" user="tsdbadmin" password="xxxxxxx" port=33333
streamlit run app.py