<commit_before># -*- coding: utf-8 -*-
"""
	simplite.py
	~~~~~~~~~
	:copyright: (c) 2014 by <NAME>.
	:license: MIT, see LICENSE for more details.
"""

import sqlite3

#Intract with sqlite3 in python as simple as it can be.
class Simplite:

	#first argument is name of database that store in same name file on disk
	def __init__(self,db_name):	
		self.db_name = db_name
		self.db = sqlite3.connect(db_name)


	#Add table
	#first argument is table name.
	#other arguments have to be labled names equal to data type.for example title="text" or id="int"
	def add_table(self,table_name,**columns):

		self.cols = ""

		for col_name,col_type in columns.items():
			self.cols += col_name+" "+col_type+","
		self.cols = self.cols[0:len(self.cols)-1]

		self.db.execute("CREATE TABLE IF NOT EXISTS {}({})".format(table_name,self.cols))


	#insert data
	#first argument is table name
	#other arguments have to be a list of args of table column.
	def insert(self,table_name,*data):
		self.data = ""
		for value in data:
			self.data += '"'+value+'"'+','
		self.data = self.data[0:len(self.data)-1]

		self.db.execute("INSERT INTO {} values({})".format(table_name,self.data))
		self.db.commit()


	#remove items
	#first argument is table name
	#second argument is condition
	def remove(self,table_name,where="1"):<commit_msg>add() method to add every thingby type<commit_after># -*- coding: utf-8 -*-
"""
	simplite.py
	~~~~~~~~~
	:copyright: (c) 2014 by <NAME>.
	:license: MIT, see LICENSE for more details.
"""

import sqlite3

#Intract with sqlite3 in python as simple as it can be.
class Simplite:

	#first argument is name of database that store in same name file on disk
	def __init__(self,db_name):	
		self.db_name = db_name
		self.db = sqlite3.connect(db_name)


	#Add table
	#first argument is table name.
	#other arguments have to be labled names equal to data type.for example title="text" or id="int"
	def add_table(self,table_name,**columns):

		self.cols = ""

		for col_name,col_type in columns.items():
			self.cols += col_name+" "+col_type+","
		self.cols = self.cols[0:len(self.cols)-1]

		self.db.execute("CREATE TABLE IF NOT EXISTS {}({})".format(table_name,self.cols))


	#insert data
	#first argument is table name
	#other arguments have to be a list of args of table column.
	def insert(self,table_name,*data):
		self.data = ""
		for value in data:
			self.data += '"'+value+'"'+','
		self.data = self.data[0:len(self.data)-1]

		self.db.execute("INSERT INTO {} values({})".format(table_name,self.data))
		self.db.commit()


	#add
	#first argument is insertion type : 'table' or 'data'
	#second argument is table name
	def add(self,insertion_type,table_name,**columns):
		if (insertion_type == 'table'):
			self.cols = ""

			for col_name,col_type in columns.items():
				self.cols += col_name+" "+col_type+","
			self.cols = self.cols[0:len(self.cols)-1]

			self.db.execute("CREATE TABLE IF NOT EXISTS {}({})".format(table_name,self.cols))


	#remove items
	#first argument is table name
	#second argument is condition
	def remove(self,table_name,where="1"):
{'fraction_non_alphanumeric': 0.14788273615635178, 'fraction_numerical': 0.009120521172638436, 'mean_word_length': 4.231686541737649, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6470971', 'n_tokens_mistral': 1124, 'n_tokens_neox': 1036, 'n_words': 316}