# How to store text data with Python?

**URL:** <https://forums.unrealengine.com/t/how-to-store-text-data-with-python/688813>\
**Category:** Editor Scripting\
**Tags:** Python, unreal-engine, UE5-0, Plugins, question\
**Created:** [November 11, 2022, 3:36pm UTC](https://forums.unrealengine.com/t/how-to-store-text-data-with-python/688813 "2022-11-11T15:36:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![9Evgeny9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@9Evgeny9](https://forums.unrealengine.com/u/9Evgeny9)\
**Post date:** [November 11, 2022, 3:36pm UTC](https://forums.unrealengine.com/t/how-to-store-text-data-with-python/688813/1 "2022-11-11T15:36:42Z")

</div>

I need to store some text data with Python.  
Key1:value1  
Key2:value2

I’ve decided to use StringTables asset, and StringTableLibrary for operating with my asset.  
[https://docs.unrealengine.com/5.0/en-US/PythonAPI/class/StringTableLibrary.html](https://docs.unrealengine.com/5.0/en-US/PythonAPI/class/StringTableLibrary.html)

But StringTableLibrary has only get\_keys functions, and don’t have set\_keys.

Maybe i choose wrong type of asset.  
Anyway, how to store some text information with Python in some asset?

---

<div class="post-metadata">

**Author:** ![UE\_FlavienP](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ue_flavienp/32/1194546_2.png) [@UE\_FlavienP](https://forums.unrealengine.com/u/UE_FlavienP)\
**Post date:** [November 15, 2022, 11:25am UTC](https://forums.unrealengine.com/t/how-to-store-text-data-with-python/688813/2 "2022-11-15T11:25:30Z")

</div>

I do not know about the stringtablelibrary.

You can probably access:

- datatable assets. Create a string string schema for your datatable
- access metadata on assets, [Asset Metadata in Unreal Engine | Unreal Engine 5.0 Documentation](https://docs.unrealengine.com/5.0/en-US/asset-metadata-in-unreal-engine/)
- access a map on the class default object of one of your custom asset [Can you edit a Blueprint Variable from Python? - #3 by Jamie\_Dale](https://forums.unrealengine.com/t/can-you-edit-a-blueprint-variable-from-python/123147/3)

```auto
import unreal

#access asset metadata
eas = unreal.get_editor_subsystem(unreal.EditorAssetSubsystem)
asset = eas.load_asset("/game/NewBlueprint")
eas.set_metadata_tag(asset,"tag_name","tag_value")
eas.save_asset(asset)

#access a NewVar map variable on a custom blueprint
# get the generated class of the Blueprint (note the _C)
bp_gc = unreal.load_object(None, "/Game/NewBlueprint.NewBlueprint_C")
# get the Class Default Object (CDO) of the generated class
bp_cdo = unreal.get_default_object(bp_gc)
# set the default property values
bp_cdo.get_editor_property("NewVar")["map entry name"] = "map entry value"
#bp_cdo.set_editor_property("MyBoolProp", True)

```
