Skip to main content

Alexandria

A project to decentralize and distribute literary infrastructure.

See github for a detailed breakdown.

Usage/Examples

import W3Alexandria # import the package
import ipfshttpclient # for connecting to ipfs


# url to connect to 
NETWORK = "https://rpc-mumbai.maticvigil.com/"
NETWORK = "https://eth.bd.evmos.dev:8545
# currently supports Polygon, Binance Smart Chain, Evmos, etc.


# create an instance of the objects
contract_book = W3Alexandria.Book(NETWORK) # instance of the contract book

ipfs_book = W3Alexandria.BookIPFS(NETWORK) # instance of the ipfs book

library = W3Alexandria.Library(NETWORK) # instance of library

mnemonic = "your mnemonic here"

# ALWAYS LOAD_DATA(), before you begine working with the contract
contract_book.load_data()
ipfs_book.load_data()
library.load_data()


# Load the addresses of already deployed contracts
contract_book_address = "0xAD94E1Fd0158C64981D29B03eE0C4C350C5b0B69"
ipfs_book_address = "0x98126F0d49e3137355B71f708Bb564ff9f224ED7"
library_address = "0x80303A8EBF84aeDf25c75ea5e2C474b4aE6dFe3A"

# generate new contracts and return their addresses

# generate a new book contract
print(contract_book.new_book("Rich Dad", "MIT", mnemonic).contractAddress)

# generate a new ipfs contract book, this method deploys the book directly to ipfs before contract deployment
print(ipfs_book.new_ipfs_book("Rich Dad", "MIT", "rich_dad.pdf", "pdf", client, mnemonic).contractAddress)

# generate a new library contract
print(library.new_library("Library of Alexandria", mnemonic).contractAddress)

All the available methods

W3Alexandria.Book

Method: deposit_ether_to_contract()
Doc: Deposit ether to the contract

Method: get_all_time_value()
Doc: return book all time value

Method: get_author()
Doc: return book author

Method: get_book_balance()
Doc: return book balance

Method: get_book_license()
Doc: return book book_license

Method: get_chapter_content()
Doc: return book chapter content

Method: get_chapter_name()
Doc: return book chapter name

Method: get_chapter_status()
Doc: return book chapter status

Method: get_chapters_count()
Doc: return book chapters count

Method: get_title()
Doc: return book title

Method: load_data()
Doc: load neccessary data to work with the object

Method: new_book()
Doc: create new book

Method: new_chapter()
Doc: create new chapter

Method: remove_chapter()
Doc: remove chapter

Method: transfer_ether_from_book_contract()
Doc: transfer ether from contract

W3Alexandria.BookIPFS

Method: deposit_ether_to_contract()
Doc: Deposit ether to the contract

Method: get_all_time_value()
Doc: return book all time value

Method: get_author()
Doc: return book author

Method: get_book_format()
Doc: return book format as deployed to ipfs, used to build the book from the hash

Method: get_book_license()
Doc: return book book_license

Method: get_ipfs_book_balance()
Doc: return book balance

Method: get_ipfs_hash()
Doc: return book ipfs hash

Method: get_title()
Doc: return book title

Method: load_data()
Doc: load neccessary data to work with the object

Method: new_ipfs_book()
Doc: create new ipfs book this is also upload the book to ipfs

Method: resolve_book_from_ipfs()
Doc: return the book from ipfs

Method: transfer_ether_from_book_contract()
Doc: transfer ether from contract

Method: upload_to_ipfs()
Doc: upload book to ipfs

W3Alexandria.Library

Method: add_book()
Doc: add book to library

Method: deposit_ether_to_contract()
Doc: Deposit ether to the contract

Method: get_all_time_value()
Doc: return library all time value

Method: get_book_address()
Doc: return book address

Method: get_book_author()
Doc: return book author

Method: get_book_count()
Doc: return book count

Method: get_book_status()
Doc: return book status

Method: get_book_title()
Doc: return book title

Method: get_librarian()
Doc: return library librarian

Method: get_library_balance()
Doc: get library balance

Method: get_library_name()
Doc: return library name

Method: get_quote()
Doc: return library quote

Method: load_data()
Doc: load neccessary data to work with the object

Method: new_library()
Doc: create new library

Method: remove_book()
Doc: remove book from library

Method: transfer_ether_from_library_contract()
Doc: transfer ether from library contract

Method: transfer_position()
Doc: transfer librarian position

License

MIT

Release files for W3Alexandria 1.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for W3Alexandria 1.0.8
File Size Uploaded
W3Alexandria-1.0.8.tar.gz 15.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for W3Alexandria 1.0.8
File Interpreter ABI Platform
W3Alexandria-1.0.8-py3-none-any.whl Python 3 none any Details

Total release size: 31.0 kB

Release files / W3Alexandria-1.0.8.tar.gz

Download URL W3Alexandria-1.0.8.tar.gz
Size 15.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c2fc759a95558550587d602cfdfb76d6a319c9d7d151c15f8e70f1cc97397792
BLAKE2b-256 checksum
How to use checksums
d448b942cc15575f8914bd5341bf09da628be7cd9fbce45ed6ae5c4c393f2e09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.9

Release files / W3Alexandria-1.0.8-py3-none-any.whl

Download URL W3Alexandria-1.0.8-py3-none-any.whl
Size 15.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f76a131a7e610ed0f43e5be6f1e736e27ddfa5ca050f60ccfa639b3640a4b105
BLAKE2b-256 checksum
How to use checksums
1e858f1ad3ce3efe7579e70e1a8c5d4b653244020a685762ff304e2a88f51fef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.9

Release history Release notifications | RSS feed

This release

1.0.8 This release

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page