Automatically create a simple API wrapper from requests generated by your browser.
Project description
autorequests
Autorequests provides an easy way to create a simple API wrapper from data generated by your browser.
Showcase
** the website shown in this example is imperialb.in
Example Use Cases
- Creating a foundation for an API wrapper
- Recreating a request outside the browser
- Testing what cookies or headers are required for a server to understand your request
✂️ How to Copy
- Inspect Element
- Go to
Network
tab - Find web request
- Right-Click
- Copy
- Choose A
Copying Method
:
Supported Copying Methods
- Powershell
- Node.JS fetch
🖥️ Command Line
$ autorequests --help
directory control
-i, --input Input Directory
-o, --output Output Directory
parsing control
--no-headers Removes all headers from the operation
--no-cookies Removes all cookies from the operation
🚩 Known Issues
- Method names are parsed from the url, but if the URL doesn't have any paths with a valid method name, an invalid method name will be used.
- Sometimes when copying fetches from the browser, some important headers aren't including, causing the resulting API wrapper to fail requests.
📅 Planned Features
- converting camelCased method names to snake_case.
- replace hardcoded values with parameters that have default values.
- detecting base paths (like /api/v1) and setting that in the class constructor. (maybe).
- the ability to parse other formats of data from the browser (not just fetches).
🐞 Contributing
This project has a lot of room for improvement in optimizing regexps, better OOP, and bug fixes. If you make an issue, pr, or suggestion, it'll be very appreciated <3.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
autorequests-1.0.2.tar.gz
(13.3 kB
view hashes)
Built Distribution
Close
Hashes for autorequests-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a5a874299b10d671ce7d9e578b3dcc5b4d5bb8071ebf9ba5dd3b16a1071ea0d |
|
MD5 | 521d0172166c255e4811e6544631b031 |
|
BLAKE2b-256 | f02b1c7b4ed7f4615db48689e641182d39394a15fb7e29e5d414cde10f7ba997 |