Package: librarycubed
Library CubedWARNING: LIBRARY CUBED IS STILL IN ALPHAMANY IMPERATIVE SECURITY FEATURES SUCH AS NOT HASHING PASSWORDS HAVE NOT YET BEEN IMPLEMENTEDAT THE MOMENT, ONLY USE LIBRARY CUBED IN A PRIVATE SETTING FOR TESTINGDON'T ACTUALLY USE LIBRARY CUBED IN YOUR APPLICATION(YOU HAVE BEEN WARNED...)An updated, more secure version will be published later (Expected by end of August 20238)Please email any bugs, suggestions, problems, etc toerlindsay2@gmail.comLibrary Cubed is a python package, optimized for libraries to better manage and keep track of their books, run by blockchain.Run the following to install Library Cubed:pip install librarycubedThen in your python file, add:import librarycubedFeatures:Customizable blockchain and creation systemBacked by Proof of Authority (PoA) and hashing encryptionSimple and easy-to-useReminder systemNo crypto or digital wallet neededDocumentationInitializationFor LC to work properly, a seperate database file must be created.import librarycubed as lc

lc.init_list()This only needs to be run once, you can delete this line of code after. You should seebcList.sqlite3appear in your directory.Do not delete thebcList.sqlite3file or any other .sqlite3 files.UseBlockchain.delete(filename)to delete a blockchain, do not manually delete themCreate Your First Blockchainimport librarycubed as lc

lc.Blockchain.new(filename, name)Notes:Filenames must end with .sqlite3Filename cannot be "bcList.sqlite3"The name does not need to be the same as the filename (e.g. if the filename is "hello.sqlite3", the name does not also have to be "hello")The same filename or name cannot be used twiceAdminsLC has two types of admins: Master Admin and AdminThe Master Admin has more power over other admins. This would be the boss, supervisor, CEO, etc of your company.Admins can only verify blocks and view the blockchain.Note that this system is likely to change in future updatesTo initialize the Master Admin:import librarycubed as lc
lc.init_list()

lc.Blockchain.new('bc.sqlite3','bc')

lc.Admin.Master.new('bc.sqlite3') # use the same filename to add the admin to the specific fileYou should be prompted to enter the username and password in the terminal.To create a new admin:import librarycubed as lc
#lc.init_list()

#lc.Blockchain.new('bc.sqlite3','bc')

lc.Admin.new('bc.sqlite3') # use the same filename to add the admin to the specific fileYou should be prompted to enter the username and password for the new admin in the terminalThen you should be prompted to confirm by entering the Master Admin username and passwordAdd dataTo create a new block, useBlockchain.insert_into(filename, format(borrower, book, type, dueDate))import librarycubed as lc
lc.init_list()

lc.Blockchain.new('bc.sqlite3','bc')

lc.insert_into('bc.sqlite3', format("Bob","The Adventure Of Alex","borrow","07/06/2023"))Notes:Due date must be in MM/DD/YYYY format; bugs and errors may occurThe format function must be used.Blocks created withinsert_into()will be found in "pending".Verify blocksTo create verify pending blocks, usePoA(filename)import librarycubed as lc
lc.init_list()

lc.Blockchain.new('bc.sqlite3','bc')

lc.insert_into('bc.sqlite3', format("Bob","The Adventure Of Alex","borrow","07/06/2023"))

lc.PoA('bc.sqlite3')You should then be prompted to look at the block and check that it is valid.
Then you must enter the username of an admin to confirm.View dataTo create verify pending blocks, use:GetData.chain(filename, database type)to view the entire chain, orGetData.block(filename, database type, block index)to view a specific block in a chain, orGetData.chains()to view a list of all the chainsimport librarycubed as lc
lc.init_list()

lc.Blockchain.new('bc.sqlite3','bc')

lc.insert_into('bc.sqlite3', format("Bob","The Adventure Of Alex","borrow","07/06/2023"))

lc.GetData.chain('bc.sqlite3','pending')Use 'pending' as database type when you want to look at unverified blocks
Use 'blockchain' when you want to look at verified blocks in the blockchain
Use 'admin' to view a list of adminsNote that the first block is block 1, not block 0.Verify blocksTo create verify pending blocks, usePoA(filename)import librarycubed as lc
lc.init_list()

lc.Blockchain.new('bc.sqlite3','bc')

lc.insert_into('bc.sqlite3', format("Bob","The Adventure Of Alex","borrow","07/06/2023"))

lc.PoA('bc.sqlite3')The Check FunctionsTo create verify the hashes of your blockchain, useCheck.hashes(filename)To get a list of overdue borrows, useCheck.returns(filename)import librarycubed as lc
lc.init_list()

lc.Blockchain.new('bc.sqlite3','bc')

lc.insert_into('bc.sqlite3', format("Bob","The Adventure Of Alex","borrow","07/06/2023"))

lc.PoA('bc.sqlite3')

lc.Check.hashes('bc.sqlite3')
lc.Check.returns('bc.sqlite3')