Skip to content

Commit 9ac82db

Browse files
committed
rewrite w/ OOP (1.0.0)
1 parent c57635a commit 9ac82db

14 files changed

+1203
-304
lines changed

.gitignore

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
.idea/
2-
Generations/
2+
__pycache__/
3+
*.xml
4+
*.pyc
5+
autorequests.egg-info/
6+
reinstall.bat
7+
build.bat

LICENSE

+373
Large diffs are not rendered by default.

README.md

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# autorequests
2+
3+
Autorequests provides an easy way to create a simple API wrapper from data generated by your browser.
4+
5+
![BUILT WITH SWAG](https://forthebadge.com/images/badges/built-with-swag.svg)
6+
![NOT A BUG A FEATURE](https://forthebadge.com/images/badges/not-a-bug-a-feature.svg)
7+
![IT WORKS. WHY?](https://forthebadge.com/images/badges/it-works-why.svg)
8+
9+
### Showcase
10+
11+
** the website shown in this example is [imperialb.in](https://imperialb.in)
12+
![example showcase gif](https://i.imgur.com/75tMMIW.gif)
13+
14+
### Example Use Cases
15+
16+
* Creating a foundation for an API wrapper
17+
* Testing what cookies / headers are required for a server to understand your request
18+
19+
### How to Copy Data
20+
21+
1. Do an action on a website that causes a web request to be sent.
22+
2. Right-click --> Copy-As --> Node.JS Fetch
23+
24+
## 🖥️ Command Line
25+
26+
```console
27+
$ autorequests --help
28+
```
29+
30+
directory control
31+
32+
```console
33+
-i, --input Input Directory
34+
-o, --output Output Directory
35+
```
36+
37+
parsing control
38+
39+
```
40+
--no-headers Removes all headers from the operation
41+
--no-cookies Removes all cookies from the operation
42+
```
43+
44+
# 🚩 Known Issues
45+
46+
* Method names are parsed from the url, but if the URL doesn't have any paths with a valid method name, an invalid
47+
method name will be used.
48+
* Sometimes when copying fetches from the browser, some important headers aren't including, causing the resulting API
49+
wrapper to fail requests.
50+
51+
# 📅 Planned Features
52+
53+
* converting camelCased method names to snake_case.
54+
* replace hardcoded values with parameters that have default values.
55+
* detecting base paths (like /api/v1) and setting that in the class constructor. (maybe).
56+
* the ability to parse other formats of data from the browser (not just fetches).
57+
58+
# 🐞 Contributing
59+
60+
This project has a lot of room for improvement in optimizing regexps, better OOP, and bug fixes. If you make an issue,
61+
pr or suggestion, it'll be very appreciated <3.

autorequests.py

-303
This file was deleted.

autorequests/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
__name__ = "autorequests"
2+
__version__ = "1.0.0"
3+
__description__ = "Automatically create a simple API wrapper from requests generated by your browser."

0 commit comments

Comments
 (0)