-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e06ee4b
Showing
81 changed files
with
4,662 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Contribution Guidelines | ||
|
||
Thank you so much for your interest in contributing!. All types of contributions are valuable. 📝 | ||
|
||
Please make sure to read the documentation before making your contribution! It will make it a lot easier for us maintainers to make the most of it and smooth out the experience for all involved. 💚 | ||
|
||
## If you have a question about this project, how to use it, or just need clarification about something | ||
|
||
* Open an Issue [here](https://github.com/Ankit404butfound/PyWhatKit/issues) | ||
* Provide as much context as you can about what you're running into. | ||
* Provide project and platform versions (python, pip etc), depending on what seems relevant. If not, please be ready to provide that information if maintainers ask for it. | ||
|
||
## Request a Feature | ||
|
||
If the project doesn't do something you need or want it to do: | ||
|
||
* Head over to [this page](https://pywhatkit.herokuapp.com/request-feature) | ||
* Provide as much context as you can about what you're looking for. | ||
* If you want to contribute that feature yourself, please open a new draft PR [here](https://github.com/Ankit404butfound/PyWhatKit/pulls). | ||
|
||
## Code Formatting | ||
|
||
Please make sure that your code follows the PEP8 standards and that you provide proper type hinting for the functions and parameters along with proper spacing. | ||
You can follow [this](https://black.readthedocs.io/en/stable/integrations/editors.html) guide on how to integrate black formatter with various IDE's and Editors. | ||
|
||
For VSCode users, create a `.vscode` folder in the project directory and a `settings.json` file inside it. | ||
Inside the file add the following lines: | ||
|
||
```json | ||
{ | ||
"python.formatting.provider": "black", | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "ms-python.python" | ||
} | ||
``` | ||
|
||
You can also use `black filename` in the terminal to format each file separately. | ||
|
||
**Make sure to use pre-commit with `pre-commit run --all-files` before pushing your changes.** | ||
|
||
## Contributing Code | ||
|
||
Code contributions of just about any size are acceptable! | ||
|
||
Setting up a development environment: | ||
|
||
1. Fork the repository and then clone it to your local computer. | ||
2. OPTIONAL BUT RECOMMENDED: Create a new virtual environment with `virtualenv` using `python3 -m venv venv`. | ||
3. Activate the virtual environment and install the project dependencies using `pip3 install -r requirements-dev.txt`. | ||
4. Congrats 🎉, you are now ready to contribute. | ||
|
||
To contribute the code: | ||
|
||
1. Set up the development environment. | ||
2. Make any necessary changes to the source code. | ||
3. If possible, make sure to include comments describing what your code does. | ||
4. Write clear, concise commit message(s). | ||
5. Push changes to your forked repository and when you are ready to get your changes reviewed, create a new PR from your forked repository. | ||
6. If your PR fixes an open issue, add a line in your PR's description that says `closes #123`, where `#123` is the issue number that you're fixing. | ||
7. Someone from the maintainers will review your PR and will take the further steps. | ||
|
||
NOTE: To contribute to the Documentation, follow the same steps as above. | ||
|
||
## Adding New Features | ||
|
||
Here are some few things to keep in mind before working on a new feature: | ||
|
||
* We really want this library to be lightweight so please don't add features with heavy dependencies. | ||
* Keep the features relevant to the library. | ||
* Before adding a new feature, open up an Issue to discuss it or ping any mods on discord. | ||
|
||
## Provide Support on Issues | ||
|
||
Helping out other users with their questions is a really awesome way of contributing to any community. If you can help out someone please go ahead for it. 🙂 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Images for the website, work in progress. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019-present Ankit Raj Mahapatra | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
![image](https://media.discordapp.net/attachments/842794167134453820/882227960613048350/unknown.png?width=1440&height=420) | ||
|
||
[![image](https://flat.badgen.net/github/stars/Ankit404butfound/Pywhatkit)](https://github.com/Ankit404butfound/PyWhatKit/stargazers) | ||
[![image](https://flat.badgen.net/github/forks/Ankit404butfound/Pywhatkit)](https://github.com/Ankit404butfound/PyWhatKit/network/members) | ||
[![image](https://flat.badgen.net/github/open-issues/Ankit404butfound/Pywhatkit)](https://github.com/Ankit404butfound/PyWhatKit/issues) | ||
[![image](https://flat.badgen.net/github/open-prs/Ankit404butfound/Pywhatkit)](https://github.com/Ankit404butfound/PyWhatKit/pulls) | ||
[![image](https://flat.badgen.net/github/commits/Ankit404butfound/Pywhatkit)](https://github.com/Ankit404butfound/PyWhatKit/commits/master) | ||
[![image](https://flat.badgen.net/github/license/Ankit404butfound/Pywhatkit)](https://github.com/Ankit404butfound/PyWhatKit/LICENCE) | ||
[![image](https://flat.badgen.net/github/contributors/Ankit404butfound/Pywhatkit)](https://github.com/Ankit404butfound/PyWhatKit/graphs/contributors) | ||
[![image](https://flat.badgen.net/github/release/Ankit404butfound/Pywhatkit)](https://github.com/Ankit404butfound/PyWhatKit/releases) | ||
<!-- ![logo](https://github.com/Ankit404butfound/PyWhatKit/raw/master/Images/logo.png?raw=true) --> | ||
|
||
###### I am a bit busy these days and not able to maintain this project properly, if you are passionate about programming and knows a bit about the internal workings of this library and is willing to contribute and improve the project, contact me on Discord or Email, I will give you push access to the repo and release access to the PyPi project. Beginners are always welcomed as long as you don't break the new release 😂😅. | ||
|
||
[PyWhatKit](https://pypi.org/project/pywhatkit/) is a Python library with various helpful features. It's easy-to-use and does not require you to do any additional setup. Currently, it is one of the most popular library for WhatsApp and YouTube automation. New updates are released frequently with new features and bug fixes. | ||
|
||
# Links | ||
|
||
- **Join our discord server - https://discord.gg/62Yf5mushu** | ||
- **Documentation - [Wiki](https://github.com/Ankit404butfound/PyWhatKit/wiki)** | ||
|
||
## Installation and Supported Versions | ||
|
||
PyWhatKit is available on PyPi: | ||
|
||
```bash | ||
python3 -m pip install pywhatkit | ||
``` | ||
|
||
```bash | ||
pip3 install pywhatkit | ||
``` | ||
|
||
PyWhatKit officially supports Python 3.8+. | ||
|
||
## Cloning the Repository | ||
|
||
```bash | ||
git clone https://github.com/Ankit404butfound/PyWhatKit.git | ||
``` | ||
## What's new in v5.4? | ||
``` | ||
Fix Flask import error | ||
``` | ||
## What's new in v5.3? | ||
```py | ||
import pywhatkit | ||
pywhatkit.start_server() | ||
``` | ||
### This method can be used to remotely control your PC using your phone (Windows only) | ||
- Make sure your PC and your phone are on same network, on your PC, Open Network and Internet Settings > Properties > Network Profile, make sure it's set to Private. | ||
- Run the above code and then open command prompt and type `ipconfig`. | ||
- Search for `IPv4 Address` and on your phone's browser type this address and append `:8000` at the end, example `192.168.0.1:8000`. | ||
- Try moving you finger and you should notice your cursor moving too. | ||
- You can also type and scroll too, enjoy. | ||
- More information here https://pywhatkit.herokuapp.com/remote-kit with the raw code. | ||
|
||
## Features | ||
|
||
- Sending Message to a WhatsApp Group or Contact | ||
- Sending Image to a WhatsApp Group or Contact | ||
- Converting an Image to ASCII Art | ||
- Converting a String to Handwriting | ||
- Playing YouTube Videos | ||
- Sending Mails with HTML Code | ||
- Install and Use | ||
|
||
## Usage | ||
|
||
```py | ||
import pywhatkit | ||
|
||
# Send a WhatsApp Message to a Contact at 1:30 PM | ||
pywhatkit.sendwhatmsg("+910123456789", "Hi", 13, 30) | ||
|
||
# Same as above but Closes the Tab in 2 Seconds after Sending the Message | ||
pywhatkit.sendwhatmsg("+910123456789", "Hi", 13, 30, 15, True, 2) | ||
|
||
# Send an Image to a Group with the Caption as Hello | ||
pywhatkit.sendwhats_image("AB123CDEFGHijklmn", "Images/Hello.png", "Hello") | ||
|
||
# Send an Image to a Contact with the no Caption | ||
pywhatkit.sendwhats_image("+910123456789", "Images/Hello.png") | ||
|
||
# Send a WhatsApp Message to a Group at 12:00 AM | ||
pywhatkit.sendwhatmsg_to_group("AB123CDEFGHijklmn", "Hey All!", 0, 0) | ||
|
||
# Send a WhatsApp Message to a Group instantly | ||
pywhatkit.sendwhatmsg_to_group_instantly("AB123CDEFGHijklmn", "Hey All!") | ||
|
||
# Play a Video on YouTube | ||
pywhatkit.playonyt("PyWhatKit") | ||
``` | ||
|
||
For more Examples and Functions, have a look at the [Wiki](https://github.com/Ankit404butfound/PyWhatKit/wiki). | ||
|
||
## Contributing | ||
|
||
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. | ||
Be sure to read the [Guidelines](https://github.com/Ankit404butfound/PyWhatKit/blob/master/CONTRIBUTING.md) before Contributing. | ||
|
||
## License | ||
|
||
MIT. | ||
For more information see [this](https://github.com/Ankit404butfound/PyWhatKit/blob/master/LICENSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Version 5.2 | ||
# Status: Stable | ||
# Documentation: https://github.com/Ankit404butfound/PyWhatKit/wiki | ||
# Report Bugs and Feature Requests here: https://github.com/Ankit404butfound/PyWhatKit/issues | ||
# For further Information, Join our Discord: https://discord.gg/62Yf5mush | ||
from .async_pywhat import * | ||
from .sync_pywhat import * | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__all__ = ["ascii_art","handwriting","misc","mail","remotekit","sc","whats","core"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from typing import Optional | ||
|
||
from PIL import Image | ||
|
||
|
||
async def image_to_ascii_art( | ||
img_path: str, output_file: Optional[str] = "pywhatkit_asciiart" | ||
) -> str: | ||
"""Convert an Image to ASCII Art""" | ||
|
||
img = Image.open(img_path).convert("L") | ||
|
||
width, height = img.size | ||
aspect_ratio = height / width | ||
new_width = 80 | ||
new_height = aspect_ratio * new_width * 0.55 | ||
img = img.resize((new_width, int(new_height))) | ||
|
||
pixels = img.getdata() | ||
|
||
chars = ["*", "S", "#", "&", "@", "$", "%", "*", "!", ":", "."] | ||
new_pixels = [chars[pixel // 25] for pixel in pixels] | ||
new_pixels = "".join(new_pixels) | ||
|
||
new_pixels_count = len(new_pixels) | ||
ascii_image = [ | ||
new_pixels[index : index + new_width] | ||
for index in range(0, new_pixels_count, new_width) | ||
] | ||
ascii_image = "\n".join(ascii_image) | ||
|
||
with open(f"{output_file}.txt", "w") as f: | ||
f.write(ascii_image) | ||
return ascii_image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__all__ = ["exceptions", "log", "core"] |
Oops, something went wrong.