Files
KomSuite-NyaaPy/README.md
JuanjoSalvador a17186393d Minor fixes
2017-08-12 19:40:34 +02:00

63 lines
1.3 KiB
Markdown

# NyaaPy
Unofficial Python module to search into Nyaa.si and nyaa.pantsu.cat.
Based on [Kylart's Nyaapi](https://github.com/Kylart/Nyaapi).
### Installation and ussage
Install it using pip.
pip install nyaapy
### Contributions and development
At this moment there isn't an official Nyaa.si API, so we only can make requests using the search URI.
#### Instructions to contribute
1. Clone or fork the repo.
```
$ git clone https://github.com/JuanjoSalvador/nyaapy.git
```
2. Set the virtual environment.
```
$ virtualenv nyaa
$ source nyaa/bin/activate
```
3. If you are ussing a clonned repo, please create a new branch named `patch-<username>-<version>`. Example: `patch-juanjosalvador-0.2`
4. Always use the code into `src` folder, never the package.
### Example code
from NyaaPy.nyaa import Nyaa
from NyaaPy.nyaa import NyaaPantsu
# Nyaa.si results
nyaa_query = Nyaa.search('illo que pasa')
if len(nyaa_query) > 0:
for result in nyaa_query:
print(result['title'])
else:
print('Nothing here!')
# Nyaa.pantsu.cat results
pantsu_query = NyaaPantsu.search('new game')
if len(pantsu_query) > 0:
for result in pantsu_query:
print(result['title'])
else:
print('Nothing here!')
### License
MIT license.