ultipa.utils package
Subpackages
- ultipa.utils.ufilter package
- Submodules
- ultipa.utils.ufilter.new_ufilter module
- ultipa.utils.ufilter.ufilter module
- Module contents
Submodules
ultipa.utils.ResposeFormat module
- class ultipa.utils.ResposeFormat.ResponseKeyFormat(jsonKeys: List[str] | None = None, boolKeys: List[str] | None = None, keyReplace: object | None = None, dataFormat: List[str] | None = None, convert2Int: List[str] | None = None)[source]
Bases:
object
Processing class that defines settings for returnd-data formatting related operations.
ultipa.utils.checkStrTime module
ultipa.utils.common module
Settings of some constant values.
ultipa.utils.convert module
- ultipa.utils.convert.convertTableToDict(table_rows, headers)[source]
Convert Table to Object.
- Args:
table_rows: headers:
Returns:
ultipa.utils.errors module
- exception ultipa.utils.errors.ParameterException(err='Parameter error!')[source]
Bases:
Exception
Class for customizing errors related to parameter
- exception ultipa.utils.errors.SerializeException(err='Serialize failed!')[source]
Bases:
Exception
Class for customizing errors related to serialization
- exception ultipa.utils.errors.ServerException(err='Server connection failed!')[source]
Bases:
Exception
Class for customizing errors related to server connection
ultipa.utils.fileSize module
ultipa.utils.format module
- class ultipa.utils.format.FormatType[source]
Bases:
object
- static arrays(_arrays) List[ArrayAlias] [source]
- static attr(attr, timeZone, timeZoneOffset) UltipaAttr [source]
- static attrAlias(_attrs, timeZone, timeZoneOffset) List[AttrNewAlias] [source]
- static explainPlan(_explainPlan) List[ExplainPlan] [source]
- static makeEntityEdgeTable(schema: Schema, rows: List[EntityRow], timeZoneOffset=None) EdgeEntityTable [source]
- static makeEntityNodeTable(schema: Schema, entity_rows: List[EntityRow], timeZoneOffset=None) NodeEntityTable [source]
- classmethod parseAttrListData(datas) List[PaserAttrListData] [source]
- static pathAlias(_paths, timeZone, timeZoneOffset) [<class 'ultipa.structs.Path.PathAlias'>] [source]
- static propertyType(type: str) PropertyType [source]
Convert the type input by the user to ULTIPA.PropertyType :param type: :return:
- static resultalias(_arrays) List[ResultAlias] [source]
- static statistics(_table, timeZone, timeZoneOffset) UltipaStatistics [source]
- static uqlMergeResponse(_res, timeZone, timeZoneOffset) UltipaResponse [source]
- static uqlResponse(_res, timeZone, timeZoneOffset) UltipaResponse [source]
ultipa.utils.logger module
- class ultipa.utils.logger.LoggerConfig(name: str, fileName: str | None = None, isWriteToFile: bool = False, level: <module 'logging' from '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/logging/__init__.py'> = 20, isStream: bool = False)[source]
Bases:
object
A class that defines how log messages related to Ultipa connection are handled.
It specifies settings such as log name, log file paths, log level, etc.
ultipa.utils.nullValue module
- ultipa.utils.nullValue.isNullValue(v: any, type: PropertyType)[source]
Judge whether a value is null
- Args:
v: The value to be judged type: The property type of v
- Returns:
bool
- ultipa.utils.nullValue.nullValue(type: PropertyType)[source]
Returns the null value corresponding to different data types
- Args:
type: The data type
Returns:
ultipa.utils.password2md5 module
ultipa.utils.privileges module
- class ultipa.utils.privileges.GraphPrivileges[source]
Bases:
object
Data class for graphset privileges.
- AB = 'AB'
- ALGO = 'ALGO'
- ALTER_PROPERTY = 'ALTER_PROPERTY'
- ALTER_SCHEMA = 'ALTER_SCHEMA'
- AUTONET = 'AUTONET'
- CLEAR_TASK = 'CLEAR_TASK'
- CREATE_FULLTEXT = 'CREATE_FULLTEXT'
- CREATE_INDEX = 'CREATE_INDEX'
- CREATE_PROPERTY = 'CREATE_PROPERTY'
- CREATE_SCHEMA = 'CREATE_SCHEMA'
- DELETE = 'DELETE'
- DROP_FULLTEXT = 'DROP_FULLTEXT'
- DROP_INDEX = 'DROP_INDEX'
- DROP_PROPERTY = 'DROP_PROPERTY'
- DROP_SCHEMA = 'DROP_SCHEMA'
- EXPORT = 'EXPORT'
- FIND = 'FIND'
- INSERT = 'INSERT'
- KHOP = 'KHOP'
- LTE = 'LTE'
- PAUSE_TASK = 'PAUSE_TASK'
- RESUME_TASK = 'RESUME_TASK'
- SHOW_ALGO = 'SHOW_ALGO'
- SHOW_FULLTEXT = 'SHOW_FULLTEXT'
- SHOW_INDEX = 'SHOW_INDEX'
- SHOW_PROPERTY = 'SHOW_PROPERTY'
- SHOW_SCHEMA = 'SHOW_SCHEMA'
- SHOW_TASK = 'SHOW_TASK'
- SPREAD = 'SPREAD'
- STOP_TASK = 'STOP_TASK'
- TEMPLATE = 'TEMPLATE'
- UFE = 'UFE'
- UPDATE = 'UPDATE'
- UPSERT = 'UPSERT'
- class ultipa.utils.privileges.SystemPrivileges[source]
Bases:
object
Data class for system privileges.
- ALTER_GRAPH = 'ALTER_GRAPH'
- ALTER_POLICY = 'ALTER_POLICY'
- ALTER_USER = 'ALTER_USER'
- COMPACT = 'COMPACT'
- CREATE_GRAPH = 'CREATE_GRAPH'
- CREATE_POLICY = 'CREATE_POLICY'
- CREATE_USER = 'CREATE_USER'
- DROP_GRAPH = 'DROP_GRAPH'
- DROP_POLICY = 'DROP_POLICY'
- DROP_USER = 'DROP_USER'
- KILL = 'KILL'
- MOUNT_GRAPH = 'MOUNT_GRAPH'
- SHOW_GRAPH = 'SHOW_GRAPH'
- SHOW_POLICY = 'SHOW_POLICY'
- SHOW_PRIVILEGE = 'SHOW_PRIVILEGE'
- SHOW_USER = 'SHOW_USER'
- STAT = 'STAT'
- TOP = 'TOP'
- TRUNCATE = 'TRUNCATE'
- UNMOUNT_GRAPH = 'UNMOUNT_GRAPH'
ultipa.utils.propertyUtils module
- ultipa.utils.propertyUtils.getPropertyTypesDesc(type: PropertyTypeStr, subTypes: List[PropertyTypeStr])[source]
Generate the format string a list type corresponds to.
- Args:
type:
subTypes:
- Returns:
str[]
- ultipa.utils.propertyUtils.isBasePropertyType(type: PropertyTypeStr)[source]
Judge whether a data type is a base property type (not a list).
- Args:
type:
Returns:
ultipa.utils.raftRetry module
ultipa.utils.serialize module
ultipa.utils.typeCheck module
ultipa.utils.ultipaSchedule module
- ultipa.utils.ultipaSchedule.run_continuously(interval=2)[source]
Continuously run, while executing pending jobs at each elapsed time interval. @return cease_continuous_run: threading. Event which can be set to cease continuous run. Please note that it is intended behavior that run_continuously() does not run missed jobs. For example, if you’ve registered a job that should run every minute and you set a continuous run interval of one hour then your job won’t be run 60 times at each interval but only once.
ultipa.utils.ultipa_datetime module
- class ultipa.utils.ultipa_datetime.DateTimestamp(date=None)[source]
Bases:
object
A class that realizes the mutual conversion of datetime and timestamp.
- class ultipa.utils.ultipa_datetime.UltipaDatetime[source]
Bases:
object
Processing class for date and time related operations.
- static datetimeInt2datetimeStr(datetime_int)[source]
Convert the customized datetime integer into a datetime string
- Args:
datetime_int:
Returns:
- classmethod datetimeStr2datetimeInt(strDatetime: datetime)[source]
Convert a datatime string into a customized datatime integer.
- Args:
strDatetime:
Returns:
- day = 0
- hour = 0
- microsecond = 0
- minute = 0
- month = 0
- second = 0
- static timestampInt2timestampStr(datetime_int, timeZone: str | None = None, timeZoneOffset: int = 0)[source]
- classmethod timestampStr2timestampInt(strDatetime: str, timeZone, timeZoneOffset=0)[source]
Convert strings of datetime, timezone and timezone-offset into the Unix timestamp integer in seconds.
- Args:
strDatetime: timeZone: timeZoneOffset:
Returns:
- year = 0
ultipa.utils.uql_marker module
- class ultipa.utils.uql_marker.CommandList[source]
Bases:
object
- ab = 'ab'
- algo = 'algo'
- algo_dv = 'algo_dv'
- alterEdgeProperty = 'alter().edge_property'
- alterEdgeSchema = 'alter().edge_schema'
- alterGraph = 'alter().graph'
- alterNodeProperty = 'alter().node_property'
- alterNodeSchema = 'alter().node_schema'
- alterPolicy = 'alter().policy'
- alterUser = 'alter().user'
- autoNet = 'autoNet'
- autoNetByPart = 'autoNetByPart'
- clearTask = 'clear().task'
- compact = 'compact'
- createBackup = 'db.backup.create'
- createEdgeFulltext = 'create().edge_fulltext'
- createEdgeIndex = 'create().edge_index'
- createEdgeProperty = 'create().edge_property'
- createEdgeSchema = 'create().edge_schema'
- createGraph = 'create().graph'
- createNodeFulltext = 'create().node_fulltext'
- createNodeIndex = 'create().node_index'
- createNodeProperty = 'create().node_property'
- createNodeSchema = 'create().node_schema'
- createPolicy = 'create().policy'
- createUser = 'create().user'
- deleteEdges = 'delete().edges'
- deleteNodes = 'delete().nodes'
- dropEdgeFulltext = 'drop().edge_fulltext'
- dropEdgeIndex = 'drop().edge_index'
- dropEdgeProperty = 'drop().edge_property'
- dropEdgeSchema = 'drop().edge_schema'
- dropGraph = 'drop().graph'
- dropNodeFulltext = 'drop().node_fulltext'
- dropNodeIndex = 'drop().node_index'
- dropNodeProperty = 'drop().node_property'
- dropNodeSchema = 'drop().node_schema'
- dropPolicy = 'drop().policy'
- dropUser = 'drop().user'
- edges = 'find().edges'
- getPolicy = 'show().policy'
- getSelfInfo = 'show().self'
- getUser = 'show().user'
- grant = 'grant'
- grantUser = 'grant().user'
- insert = 'insert'
- khop = 'khop'
- kill = 'kill'
- lteEdge = 'LTE().edge_property'
- lteNode = 'LTE().node_property'
- mount = 'mount().graph'
- nodeSpread = 'spread'
- nodes = 'find().nodes'
- pauseTask = 'pause().task'
- restoreBackup = 'db.backup.restore'
- resumeTask = 'resume().task'
- revoke = 'revoke().user'
- showAlgo = 'show().algo'
- showBackup = 'db.backup.show'
- showEdgeFulltext = 'show().edge_fulltext'
- showEdgeIndex = 'show().edge_index'
- showEdgeProperty = 'show().edge_property'
- showEdgeSchema = 'show().edge_schema'
- showFulltext = 'show().fulltext'
- showGraph = 'show().graph'
- showIndex = 'show().index'
- showNodeFulltext = 'show().node_fulltext'
- showNodeIndex = 'show().node_index'
- showNodeProperty = 'show().node_property'
- showNodeSchema = 'show().node_schema'
- showPolicy = 'show().policy'
- showPrivilege = 'show().privilege'
- showProperty = 'show().property'
- showSchema = 'show().schema'
- showTask = 'show().task'
- showUser = 'show().user'
- stat = 'stats'
- stopTask = 'stop().task'
- template = 't'
- top = 'top'
- truncate = 'truncate'
- ufeEdge = 'UFE().edge_property'
- ufeNode = 'UFE().node_property'
- unmount = 'unmount().graph'
- updateEdges = 'update().edges'
- updateNodes = 'update().nodes'
- upsert = 'upsert'
- class ultipa.utils.uql_marker.UQLMAKER(command: CommandList, commandP: any | None = None, commonParams=None)[source]
Bases:
object
A class that assembles UQL.