Package: acctext
Python wrapper for Accelerated TextInstallation$ python -m pip install acctextUsagefromacctextimportAcceleratedTextat=AcceleratedText(host='http://127.0.0.1:3001')Make sure Accelerated Text application is running.
Refer todocumentationfor launch instructions.at.health(){'health': 'Ok'}Interacting with Dictionaryitems=[{'key':'house','category':'N','forms':['house','houses']},{'key':'hill','category':'N','forms':['hill','hills']},{'key':'on','forms':['on'],'category':'Prep','attributes':{'Operation':'Syntax.on_Prep/Prep'}},{'key':'the','forms':['the'],'category':'Det','attributes':{'Operation':'Syntax.the_Det/Det'}}]foriteminitems:at.create_dictionary_item(**item)items=at.list_dictionary_items()items[{'id': 'the_Det_Eng',
  'key': 'the',
  'forms': ['the'],
  'category': 'Det',
  'language': 'Eng',
  'attributes': {'Operation': 'Syntax.the_Det/Det'}},
 {'id': 'hill_N_Eng',
  'key': 'hill',
  'forms': ['hill', 'hills'],
  'category': 'N',
  'language': 'Eng',
  'attributes': {}},
 {'id': 'house_N_Eng',
  'key': 'house',
  'forms': ['house', 'houses'],
  'category': 'N',
  'language': 'Eng',
  'attributes': {}},
 {'id': 'on_Prep_Eng',
  'key': 'on',
  'forms': ['on'],
  'category': 'Prep',
  'language': 'Eng',
  'attributes': {'Operation': 'Syntax.on_Prep/Prep'}}]Working with DataUpload a local fileat.upload_data_file('example_data.csv'){'message': 'Succesfully uploaded file', 'id': 'example_data.csv'}Create a data file from scratchat.create_data_file('example_data_2.csv',['a','b'],[['1','2'],['3','4']]){'id': 'example_data_2.csv'}List available data files[x['id']forxinat.list_data_files()]['example_data.csv', 'example_data_2.csv']Fetch data fileat.get_data_file('example_data_2.csv'){'id': 'example_data_2.csv',
 'filename': 'example_data_2.csv',
 'header': ['a', 'b'],
 'rows': [['1', '2'], ['3', '4']]}Delete data fileat.delete_data_file('example_data_2.csv'){'message': 'Succesfully deleted file', 'id': 'example_data_2.csv'}Languages and ReadersFetch existing language propertiesat.get_language('Eng'){'id': 'Eng', 'name': 'English', 'flag': '🇬🇧', 'default': True}Add new languageat.add_language('Ger','German'){'id': 'Ger', 'name': 'German', 'flag': '🇩🇪', 'default': False}List available languagesat.list_languages()[{'id': 'Eng', 'name': 'English', 'flag': '🇬🇧', 'default': True},
 {'id': 'Ger', 'name': 'German', 'flag': '🇩🇪', 'default': False}]Create new reader typeat.create_reader('Dc','Discount Customer','(DC)'){'id': 'Dc', 'name': 'Discount Customer', 'flag': '(DC)', 'default': False}at.create_reader('Lc','Loyal Customer','(LC)'){'id': 'Lc', 'name': 'Loyal Customer', 'flag': '(LC)', 'default': False}List available readersat.list_readers()[{'id': 'Dc', 'name': 'Discount Customer', 'flag': '(DC)', 'default': False},
 {'id': 'Lc', 'name': 'Loyal Customer', 'flag': '(LC)', 'default': False}]Document plansOpen Accelerated Text document plan editor (http://127.0.0.1:8080by default) and create a new document plan named"House description". More detailed instructions can be found indocumentation.Fetch single document plandp=at.get_document_plan(name='House description')dp['documentPlan']{'type': 'Document-plan',
 'segments': [{'children': [{'modifier': {'name': 'size',
      'type': 'Cell-modifier',
      'srcId': 'B-D0i/`TL4@ja%{U!?2G',
      'child': {'name': 'color',
       'type': 'Cell-modifier',
       'srcId': '!2b?}PBIB?i]%*/(~?XM',
       'child': {'name': 'house',
        'type': 'Dictionary-item',
        'srcId': '+5JLY;_/2/zEOcZ._$,4',
        'kind': 'N',
        'itemId': 'house_N_Eng'}}},
     'type': 'Modifier',
     'srcId': '`62!swypAqp_jK_lr1Ow',
     'child': {'name': 'on',
      'type': 'Dictionary-item-modifier',
      'srcId': ']MNfAFBjxy,c?G55a04@',
      'kind': 'Prep',
      'child': {'name': 'the',
       'type': 'Dictionary-item-modifier',
       'srcId': '62%#$13DP}Gj8=n4NCI.',
       'kind': 'Det',
       'child': {'name': 'hill',
        'type': 'Dictionary-item',
        'srcId': 'Ol68tPXKblg(pUghVhb@',
        'kind': 'N',
        'itemId': 'hill_N_Eng'},
       'itemId': 'the_Det_Eng'},
      'itemId': 'on_Prep_Eng'}}],
   'type': 'Segment',
   'srcId': ']H[rfMhNu,^(wX6[%.+w'}],
 'srcId': 'Li$gv+b_9o-n$z^FnSl~'}Delete document planat.delete_document_plan(dp['id'])TrueRestore document planat.create_document_plan(**dp)['name']'House description'List document plans[x['name']forxinat.list_document_plans(kind='Document')]['House description']Text generationresult=at.generate('House description',data={"size":"small","color":"red"})result['variants']['Small red house on the hill.']Bulk generationresults=at.generate_bulk('House description',data=[{"size":"small","color":"red"},{"size":"big","color":"green"}])[x['variants']forxinresults][['Small red house on the hill.'], ['Big green house on the hill.']]Fetch specific resultat.get_result(result['resultId']){'resultId': 'a364335f-5021-443d-9c77-fe40c296ecef',
 'offset': 0,
 'totalCount': 1,
 'ready': True,
 'updatedAt': 1628173135,
 'variants': ['Small red house on the hill.']}Working with stateExportat.export_state('state.zip')Clearat.clear_state()Restoreat.restore_state('state.zip')