<jupyter_start><jupyter_text>Init<jupyter_code>cd c:\Workspace\Jupyter\plastic<jupyter_output>c:\Workspace\Jupyter\plastic<jupyter_text>MySQL<jupyter_code>from plastic.connectors.mysql import PlasticMysql
class Task(PlasticMysql): pass
Task.find(Task.id[3:])<jupyter_output><empty_output><jupyter_text>Quickstart (SQLite)File-based testing (as used in the committed entry)  Get some data out<jupyter_code>from plastic.connectors.sqlite import PlasticSqlite
PlasticSqlite._dbInfo = './dev/sqlite-test.db'
class Task(PlasticSqlite): pass
Task.find(Task.id[3:])<jupyter_output><empty_output><jupyter_text>Change a record<jupyter_code>task = Task(id=4)
task
task.title = "A bit more interesting"
task._commit()
Task(id=4)<jupyter_output><empty_output><jupyter_text>Find and filter<jupyter_code>print({task.title: task.description 
       for task 
       in Task.find(Task.active[0])})<jupyter_output>{'Skipped': None, 'A bit more interesting': 'Not much to say here.'}<jupyter_text>Add an entry<jupyter_code>newTask = Task()
newTask.title = "A new task to do"
newTask.active = True
newTask._commit()
Task.find(Task.id[5:]) # get tasks after the last added<jupyter_output><empty_output><jupyter_text>SQLiteIn-memory testing<jupyter_code>from plastic.connectors.sqlite import PlasticSqlite, Sqlite_Connector
PlasticSqlite._connection = Sqlite_Connector()
with open('./test/plastic/connectors/sqlite.base.sql') as rawsql:
    statements = rawsql.read().split(';')
    for statement in statements:
        PlasticSqlite._connection._execute_query(statement, [])
class Task(PlasticSqlite):
    _connection = PlasticSqlite._connection
    pass
Task._pending
t = Task(id=2)
Task._pending
Task.find(Task.id[1:])
Task.find(Task.id[7])
t7 = Task(active=1, title="New Task")
t7._pending
t7._commit()
t7._pending
Task.find(Task.id[1:])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13027027027027027, 'fraction_numerical': 0.008108108108108109, 'mean_word_length': 7.118421052631579, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '426966', 'license': 'Apache-2.0', 'n_tokens_mistral': 675, 'n_tokens_neox': 674, 'n_words': 114, 'path': 'dev/Testing demo - Python 3.ipynb', 'repo_name': 'CorsoSource/plastic', 'size': '1850'}