Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 7, 2023. It is now read-only.
/SculptingPublic archive

Library for sculpting objects from others

License

NotificationsYou must be signed in to change notification settings

emptybutton/Sculpting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Library for sculpting objects from others

Installing

pip install sculpting

Examples

Create an object based on another

fromdataclassesimportdataclassfrompyhandlingimportby,thenfromsculptingimportSculpture@dataclassclassUser:id:intusername:strpassword:stroriginal=User(0,"William","1234")sculture=Sculpture(original,name="username",password_hash=(getattr|by|"password")|then>>hash)

which is mapped with the original

sculture.namesculture.password_hash
William1670106271132722890

even with its modification

sculture.name="Not William"original.username
Not William

which can be custom

fromsculptingimportAttributeMap,changing_attribute_map_forfromsculpting.toolsimportsetting_of_attrtransforming_sculpture=Sculpture(original,id_of_others=AttributeMap(getattr|by|"id_of_others",setting_of_attr("id_of_others",value_transformer=tuple)    ),# Shortcut for recording abovesynonym_for_id_of_others=changing_attribute_map_for("id_of_others",tuple))transforming_sculpture.synonym_for_id_of_others=range(1,5)original.id_of_others
(1, 2, 3, 4)

using standard tools

fromdatetimeimportdatetimefromtimeimportsleepfrompyhandlingimportclose,operation_by,eventually,returnlyfromsculptingimportread_only_attribute_map_asfromsculpting.toolsimportoncestandard_tool_sculpture_from= (close(Sculpture)(id=read_only_attribute_map_as((getattr|by|'id')|then>>operation_by('*',2)),creation_time=once(eventually(datetime.now))    )|then>>returnly(getattr|by|"creation_time"))standard_tool_sculpture=standard_tool_sculpture_from(original)print(datetime.now().time(),"- at initialization")sleep(3)print(standard_tool_sculpture.creation_time.time(),"- at getting")
16:10:16.045444 - at initialization16:10:16.045444 - at getting

[8]ページ先頭

©2009-2025 Movatter.jp