Easy and advanced Libgen site parser
Project description
LIBGEN-PARSER
Lets you parse libgen website easily. Uses libgen.rs site.
Quick LINKS
INSTALLATION
Use the below command to install and start using.
$ pip install libgenparser
REQUIREMENTS
Dependencies
This package has following dependencies. All of them probably will be installed automatically.
- requests
- beautifulsoup4
- lxml (for fast parsing of html)
- async-cache (only if you plan to use async methods) (optional)
Missing modules
If not installed automatically, use the below respective commands to install missing modules. Follow as bellow:
-
All of them at once:
$ pip install requests beautifulsoup4 lxml async-cache
-
Install individually
-
Install
requests
$ pip install requests
-
Install
beautifulsoup4
$ pip install beautifulsoup4
-
Install
lxml
parser for html parsing by beautifulsoup4$ pip install lxml
-
Install
async-cache
only if you plan to use async version.$ pip install async-cache
-
USAGE
Start using by importing as follows.
from libgenparser.parser import LibgenParser
libgen = LibgenParser()
libgen.search_title("Clean python")
LibgenParser class is contains all the required methods. All methods except LibgenParser.resolve_download_link()
returns parsed list of dictionaries on success else they return None. All methods are cached using
functools.lru_cache() for faster results. Async methods in __future__
are cached using async-cache
module's cache.AsyncLRU
.
By default, cache_length (amount of objects to hold in memory) is 1000. This might be an issue of out of memory if you
are running on very low memory machine. Change it as required by assigning a value (as length) to custom_cache_length
in LibgenParser class as shown bellow. Setting it to 0
will store no cache.
Change cache length
from libgenparser.parser import LibgenParser
libgen = LibgenParser(custom_cache_length=100)
libgen.search_title("Clean python")
-
Provide a title string to
libgen.search_title()
. -
Provide author's name string to
libgen.search_author()
. -
Provide year value (int/string) to
libgen.search_year()
. -
Provide MD5 identifier string of ebook to
libgen.search_md5()
. -
Provide publisher's name string to
libgen.search_publisher()
. -
Provide ISBN identifier string of ebook to
libgen.search_isbn()
. -
Provide file extension string of ebook to
libgen.searcg_extension()
. -
Provide language string to
libgen.search_language()
. -
Provide tag string to
libgen.search_tag()
.
This package has asynchronous (asyncio) support also.
from libgenparser.__future__.parser import LibgenParser
LibgenParser
from __future__
package contains async versions of all methods.
Supported features
- Download link
Get download links of an ebook on libgen.rs site by using its MD5 identifier.
Get download link of a specific book by passing the MD5 identifier of that book to parser.resolve_download_link()
which returns a direct url of book to download. MD5 identifiers can be obtained on use of search method.
Can query libgen.rs with following filters:
- Title (default)
- Tag
- Author name
- Year
- MD5
- ISBN
- Publisher
- Language
- File extension
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file libgenparser-0.1.0.tar.gz
.
File metadata
- Download URL: libgenparser-0.1.0.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5106c824311ddf941cc825847679999c421d8d85b98da2873e0d3229929201d |
|
MD5 | cf5a2bf1639c2371f8566d34d4f9d591 |
|
BLAKE2b-256 | dbba6594a6385bb20146a10c1c1bc506976f26b53fe7fa292e1975a66a7a1e49 |
File details
Details for the file libgenparser-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: libgenparser-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4631e5478d07f586f1f4626968eab83015bbf56a4b747abe0df499621f905dd8 |
|
MD5 | 13c0f30c72787fd389ab9090f894a9c3 |
|
BLAKE2b-256 | 225985fd3f52582fc1e805d95105568028a96ac947846c6767b674ea03b28304 |