how to use - OwEn-GaTO/Japan GitHub Wiki

to import the library from Asia import Japan.

Nagasaki

atributtes:

name(type == string, required): your database name.

sizeX(type == int, required if "expandable" equals False): number of attributes(default is: 1).

sizeY(type == int, required if "expandable" equals False): number of objects(default is: 1).

expandable(type == boolean, optional): defines if the database can be expanded after it is created(default is: True ).

fragmenter(type == string, optional): is the value with which the attributes are separated therefore it has to be a value that you will never use in the database(default is: "ç~|~!ç" ).

extension(type == string, optional): database file extension(default is: "senior").

how to use the Nagasaki api your_object = Japan.Nagasaki(name,sizeX,sizeY,expandable,fragmenter,extension).

functions:

getsizeY() returns the number of objects.

getsizeX() returns the number of attributes, but if the objects have a different number of attributes returns a list.

getline(numline(int)) returns the attributes of the object in the numline index as a list.

getcolum(numcolum(int)) returns the attributes at the numcolum index of all objects.

getpoint(pointY(int), pointX(int)) returns a specific attribute of a specific object where pointY is the index of the object and pointX is the index of the attribute.

setline(val(list), numline(int)) sets all, part, or add attributes to the object in the numline index, if numline is 0 or greater than the number of objects a new object is added.

setcolum(val(list), numcolum(int)) establece el atributo en el indice numcolum a todos los objetos, numcolum must be equal to or less than the smallest value returned by getsizeX and the length of val has to be equal to or less than the number of objects.

setpoint(val(any), pointY(int), pointX(int)) sets a specific attribute of a specific object where pointY is the index of the object and pointX is the index of the attribute.

Osaka

atributtes:

fragmenter(type == string, optional): is the value with which the attributes are separated therefore it has to be a value that you will never use in the database(default is: "ç~|~!ç" ).

extension(type == string, optional): database file extension(default is: "senior").

how to instantiate your_object = Japan.Osaka(fragmenter, extension)

functions:

create_database(name(string), sizeX(int), sizeY(int)) create a database with sizeY rows and sizeX columns.

read_row(name(string), row(int)) returns the value of the row (row).

read_colum(name(string), colum(int)) returns the value of the column (colum).

write_row(name(string), row(int), array(list)) write a row with the value of array.

write_colum(name(string), colum(int), array(list)) write a column with the value of array.

append(name(string), array(list)) add a row with the array value to the end of the database.

delete_database(name(string)) delete a database.

sizeY(name(string)) returns the number of rows.

sizeX(name(string)) returns the number of columns.

read_database(name(string), mode(string)) if the mode is "text n" it returns text with line breaks, if the mode is "text wn" it returns text without line breaks, if the mode is "list wn" it returns a list if the line breaks, if the mode es "list n" returns a list with line breaks.

write_array(name(string), array(list)) write the entire database with the value of array

read_cordinate(name(string), X(int), Y(int)) returns a specific point from the database

write_cordinate(name(string), val(any), X(int), Y(int)) write a specific point with the value of val in the database

how to handle the indexes

unlike lists and tuples where where indices start at 0, in Japan the indexes start at 1