diff --git a/README.md b/README.md index 5a95519..9107151 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,34 @@ -

- - - - - +

+ Pip Install Bitches 😩 +

+ +

+ + +

-#### pip-install-bitches was made by +

+ + + + + +

+ +

+ pip-install-bitches was made by + Love ❌ code βœ… +

+ --- + ### πŸŽˆγƒ»Code example + Example of how you can use [bitches](https://pypi.org/project/bitches/) + ```py import bitches #valid @@ -19,5 +36,8 @@ bitches.get() or -bitches.get("yes") #yes is the name of the directory that will be created +bitches.get( + "yes", # directory name (default: "bitches") + 5 # amount of bitches (default: randint(5, 10)) +) ``` diff --git a/bitches/__init__.py b/bitches/__init__.py index 2e5d37f..86240f9 100644 --- a/bitches/__init__.py +++ b/bitches/__init__.py @@ -1,49 +1,31 @@ -#how about you import some bitches -import os +# how about you import some bitches import requests +from os import mkdir, sep from random import randint from threading import Thread -from zipfile import ZipFile, ZIP_DEFLATED api = 'https://api.waifu.pics/nsfw/waifu' -def get(dirr=None): - '''can choose directory name too''' - directory = "bitches" - if dirr: - directory = dirr - try: os.mkdir(directory) - except Exception: pass - for i in range(randint(5, 10)): - Thread(target=bitches, args=(directory, )).start() -def bitches(dir_): - for i in range(randint(3, 7)): +def get(directory="bitches", amount=randint(5, 10)): + '''can choose directory name too''' + try: + mkdir(directory) + except Exception: + pass + for i in range(amount): + Thread(target=bitches, args=(directory, amount)).start() + + +def bitches(dir_, amount=randint(3, 7)): + for i in range(amount): req_url = requests.get(api) url = req_url.json()['url'] if not req_url.ok: print("error: "+req_url) - with open(dir_+os.sep+url[21:], 'wb') as f: + with open(dir_+sep+url[21:], 'wb') as f: response = requests.get(url, stream=True) for block in response.iter_content(1024): if not block: break f.write(block) - -def tempDir(): - system = os.name - if system == 'nt': - return os.getenv('temp') - elif system == 'posix': - return '/tmp/' - -def zipfile(_file): - _zipfile = os.path.join(os.getcwd(), 'bitches.zip') - zipped_file = ZipFile(_zipfile, "w", ZIP_DEFLATED) - abs_src = os.path.abspath(_file) - for dirname, _, files in os.walk(_file): - for filename in files: - absname = os.path.abspath(os.path.join(dirname, filename)) - arcname = absname[len(abs_src) + 1:] - zipped_file.write(absname, arcname) - zipped_file.close() \ No newline at end of file diff --git a/setup.py b/setup.py index b3f34af..214a396 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages __name__ = "bitches" -__version__ = "0.0.2" +__version__ = "0.0.3" setup( name=__name__, @@ -11,17 +11,17 @@ setup( description="how about you pip install some bitches", long_description_content_type="text/markdown", long_description=open("README.md", encoding="utf-8").read(), - url = "https://github.com/rdimo/pip-install-bitches", + url="https://github.com/rdimo/pip-install-bitches", project_urls={ - "Bug Tracker": "https://github.com/rdimo/pip-install-bitches/issues", + "Bug Tracker": "https://github.com/rdimo/pip-install-bitches/issues", }, install_requires=['requests'], packages=find_packages(), keywords=['bitches', 'python', 'package', 'library', 'lib', 'module', 'checker'], classifiers=[ - "Intended Audience :: Developers", - "Programming Language :: Python :: 3", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", + "Intended Audience :: Developers", + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", ] -) \ No newline at end of file +)