Turn your thoughts into code

AI code writing assistant for data scientists, engineers, and analysts.
Get code completions and suggestions as you type. Press tab to insert.

from catboost.datasets import titanic
import numpy as np
import pandas as pd
from catboost import CatBoostClassifier

train_df, test_df = titanic()

train_df.head()

# one hot encode all the categorical vars in train_df and test_df
train_df = pd.get_dummies(train_df, columns=['Sex', 'Embarked'])
test_df = pd.get_dummies(test_df, columns=['Sex', 'Embarked'])
Small demo

Improve your productivity with CodeSquire

Try our CodeSquire demo below, and see the power of our code autocompletion for yourself.

result:

                                

Supported Platforms

What can CodeSquire Do?

Turns your comments into code

Quickly write code by translating your comments into code, like in this example where we quickly create a Plotly bar chart.
press tab to insert.

train_df.head()
train_df['Sex'] = train_df['Sex'].astype(str)
train_df['Pclass'] = train_df['Pclass'].astype(str)
a = train_df.groupby(['Survived', 'Pclass']).agg({'PassengerId': 'count'}).reset_index()
# create a bar chart that shows number of survived and not survived broken down by Pclass using plotly
fig = px.bar(a, x='Pclass', y='PassengerId', color='Survived', text='PassengerId', color_discrete_map={0: '#FF0000', 1: '#0000FF'})
fig.show()
# create a function that loads df to bucket_path using aws key and secret
from decouple import config

aws_key = config('aws_key')
secret_key = config('aws_secret_key')

def load_df_to_bucket(df, bucket_path):
 import boto3
  s3 = boto3.client(
    's3',
    aws_access_key_id=aws_key,
    aws_secret_access_key=secret_key
  )
  s3.upload_fileobj(df, 'bucket_name', bucket_path)
Writes functions using well-known libraries

Create entire functions with ease, without searching for library methods and parameters. In this example, we created a function that loads df to AWS bucket in parquet format.
Press tab to insert.

Translates Language into SQL queries

Write SQL queries by providing CodeSquire with simple instructions on what you want to pull, join, and group by, like in the following example where we are trying to determine the top 10 most common names.
Press tab to insert.

SELECT state, gender, year, name, number FROM `bigquery-public-data.usa_names.usa_1910_2013` LIMIT 1000;

-- get top 10 most popular female names in Florida in 1910 to 2013
SELECT state, gender, year, name, number FROM `bigquery-public-data.usa_names.usa_1910_2013` WHERE state = 'FL' AND gender = 'F' ORDER BY number DESC LIMIT 10;
from decouple import config

aws_key = config('aws_key')
secret_key = config('aws_secret_key')

def foo(df, bucket_path):
import boto3

s3 = boto3.client('s3', aws_access_key_id=aws_key, aws_secret_access_key=secret_key)

s3.upload_fileobj(df, 'bucket_name', bucket_path)

# what does function foo do?
# foo uploads a dataframe to an AWS bucket
Explains code

CodeSquire can even help you understand someone elseโ€™s code, just ask to explain the function above, and get your explanation in plain text.
Press tab to insert.

Writes complex functions by specifying multiple steps

CodeSquire can help you create complex functions that involve several logic steps. Brainstorm with it by starting simple and adding more complex features as you go.
Press tab to insert.

from catboost.datasets import titanic
import numpy as np
import pandas as pd
from catboost import CatBoostClassifier
import plotly.express as px

train_df, test_df = titanic()

train_df.head()

'''
1. Split train data into X and Y
2. Convert categorical variables to numeric
3. Scale the dataset using min-max scaling
4. Train the model using CatboostClassifier
'''

# 1. Split train data into X and Y
X_train = train_df.drop('Survived', axis=1)
Y_train = train_df['Survived']

# 2. Convert categorical variables to numeric
X_train = pd.get_dummies(X_train)

# 3. Scale the dataset using min-max scaling
X_train = X_train.values
X_train = X_train.astype('float32')
X_train = X_train/255

# 4. Train the model using CatboostClassifier
model = CatBoostClassifier(iterations=100, learning_rate=0.1, depth=3, loss_function='Logloss')
model.fit(X_train, Y_train)
if 'vertical' in selected_row:
  rest_of_verticals = main_df['vertical'].unique().tolist()
  rest_of_verticals.remove(selected_row['vertical'])

st.session_state['possible_verticals'] = [selected_row['vertical']] + rest_of_verticals + ['All']

if 'area_name' in selected_row:
  rest_of_areas = main_df['area_name'].unique().tolist()
  rest_of_areas.remove(selected_row['area_name'])

st.session_state['possible_areas'] = [selected_row['area_name']] + rest_of_areas + ['All']

if 'product_name_english' in selected_row:
 rest_of_products = main_df['product_name_english'].unique().tolist()
  rest_of_products.remove(selected_row['product_name_english'])
  st.session_state['possible_products'] = [selected_row['product_name_english']] + rest_of_products + ['All']

if 'product_name_arabic' in selected_row:
  rest_of_products = main_df['product_name_arabic'].unique().tolist()
  rest_of_products.remove(selected_row['product_name_arabic'])
  st.session_state['possible_products'] = [selected_row['product_name_arabic']] + rest_of_products + ['All']
Writes code, tailored to your code style and use cases

Increase your productivity by getting smart suggestions from CodeSquire.
Press tab to insert.

Frequently asked questions

Find answers to some of the questions people ask. Can not find an answer to your question? Just reach out at hey@codesquire.ai.

Just download our Chrome Extension, sign up and you are good to go!

Right now we support Google Colab, BigQuery, and JupyterLab with more to come.

Use the following link to read about CodeSquire best practices and guidelines. https://app.codesquire.ai/#tutorials

So far we are gathering feedback on what direction CodeSquire should take in the future. If you have some ideas, let us know at hey@codesquire.ai

CodeSquire works in places that Github Copilot doesn't. We provide a browser extension so that you get the same great code suggestions in places like Google Colab, BigQuery, and JupyterLab in your browser.
Have more questions? Contact us