<jupyter_start><jupyter_text>Install Beneath:<jupyter_code>!pip3 install --upgrade beneath<jupyter_output><empty_output><jupyter_text>Create a CLI secret on [beneath.dev](https://beneath.dev) and use it authenticate Beneath:<jupyter_code>!beneath auth SECRET<jupyter_output><empty_output><jupyter_text>Create a project<jupyter_code>!beneath project create USERNAME/NEW_PROJECT_NAME<jupyter_output><empty_output><jupyter_text>Create a table of movies<jupyter_code>import beneath
client = beneath.Client()

table = await client.create_table("USERNAME/PROJECT_NAME/NEW_TABLE_NAME", schema="""
    " A table of movies "
    type Movie @schema {
        title: String! @key
        released_on: Timestamp! @key 
        director: String
        budget_usd: Int
        rating: Float
    }
""", update_if_exists=True)<jupyter_output><empty_output><jupyter_text>Write a single record to the table (head over to the web console to see records flow!)<jupyter_code>from datetime import datetime

async with table.primary_instance.writer() as w:
    await w.write({
        "title":       "Star Wars: Episode IV",
        "released_on": datetime(year=1977, month=5, day=25),
        "director":    "<NAME>",
        "budget_usd":  11000000,
        "rating":      8.6,
    })<jupyter_output><empty_output><jupyter_text>Write some more movies to the table<jupyter_code>import aiohttp
import asyncio

import random

# load a dataset of movies
url = "https://raw.githubusercontent.com/vega/vega/master/docs/data/movies.json"
async with aiohttp.ClientSession() as session:
    async with session.get(url) as res:
        movies = await res.json(content_type=None)

# write a 100 random movies one-by-one
n = 100
async with table.primary_instance.writer() as w:
    for i in range(n):
        # get a random movie
        movie = random.choice(movies) 

        # transform and write the movie
        await w.write({
            "title":       str(movie["Title"]),
            "released_on": datetime.strptime(movie["Release Date"], "%b %d %Y"),
            "director":    movie["Director"],
            "budget_usd":  movie["Production Budget"],
            "rating":      movie["IMDB Rating"],
        })

        # wait about a second
        await asyncio.sleep(1.1)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11334792122538294, 'fraction_numerical': 0.011378555798687089, 'mean_word_length': 3.5357142857142856, 'pattern_counts': {'":': 10, '<': 26, '<?xml version=': 0, '>': 26, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '215144', 'license': 'MIT', 'n_tokens_mistral': 757, 'n_tokens_neox': 727, 'n_words': 178, 'path': 'examples/quick-starts/create_table.ipynb', 'repo_name': 'admariner/beneath', 'size': '2291'}