Package: pybooklib
About PyBookLibPyBookLib is a two part library designed to host and get template code projects. It is written for mainly Python programs, but it is possible to host other languages as well. PyBookLib has two submodules, each independant of one another: PyBook and PyLib. PyBookLib has no affiliations with the existing PyPI projectsPyBookandPyLib. It is a completely separated project, and just happened to be library themed. 😁InstallYou can install the package through the following:> pip install -U pybooklibIf you want the latest development version, which most definitely has bugs, run the following:> pip install git+https://github.com/BD103/PyBookLibUseTo pull up this markdown file in the console, you can runpybooklibin the command line. Runningpybookorpylibgives a list of possible commands with each.PyBookLibThe main PyBookLib module has no current function beyond a code bridge and displaying this markdown file in the command line.> pybooklibPyBookPyBook's main functionality is connecting to a hosted library and receivingbooks(.zipfiles). The library that is accessed is defined by an environmental variable. Try running something like this:frompybooklibimportpybookimportos# Set environmental variable for library. Unecessary but helpful all the samepybook.set_url("https://library.bd103.repl.co/api")# Gets a book "sample-library" from the user "BD103" with the version "1.2" and extracts contents to the directory "pylib-library"pybook.get(user="BD103",book="sample-library",version="1.2",direc="pylib-library")With this simple script, it connects tolibrary.bd103.repl.coand requests sample-library. This book is a sample script to host your own library. (It was created forReplit, so that's why there is a pyproject.toml.)You can also run some bash commands:#Getalistofcommands> pybook --help> pybook get-book BD103 sample-library --version 1.2 --direc pylib-library> pybook get-user BD103#Thisshouldautomaticallybesettolibrary.bd103.repl.co/api> pybook set-url https://link.to.site/api#Umbrellagetfunctiontospecifyexactdetails> pybook get --user BD103 --direc folderYou do not have to specify all these parameters. Try removing and replacing some of them and see what happens!PyLibPyLib is for hosting your own library. It is extremely simple. Install pybooklib, and choose your path:Note: These paths will automatically set the IP and Port to0.0.0.0:8000. If on a local machine, you can connect throughlocalhost:8000. If using a server hosting service, it should automatically set the host to your domain. If you are having conflicts with the port, or want a different IP, you can specify it by taking the Python main.py path and replacingpylib.run()withpylib.run(host="1.2.3.4", port=8080).Python main.pyCreate a file called main.py. Inside, paste the following:frompybooklibimportpylibpylib.run()Run the script to start hosting your library.CLIIn the command line, run the following:pylib runWatch as your server gets hosted.ContributingIf you want to contribute to this project, go togithub.com/BD103/PyBookLib, create a fork and a pull request. All code should be run through the following commands:black pybooklib
isort pybooklib --profile black
flake8 pybooklibPyTest is not yet implemented. Stay tuned! 🎵