https://github.com/joegasewicz/birman
Multipart formdata decoder
https://github.com/joegasewicz/birman
form formdata multipart multipart-formdata
Last synced: about 1 month ago
JSON representation
Multipart formdata decoder
- Host: GitHub
- URL: https://github.com/joegasewicz/birman
- Owner: joegasewicz
- License: mit
- Created: 2022-11-21T13:21:50.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-12-02T12:55:57.000Z (over 2 years ago)
- Last Synced: 2025-04-10T13:34:12.445Z (about 1 month ago)
- Topics: form, formdata, multipart, multipart-formdata
- Language: Python
- Homepage: https://pypi.org/project/birman/
- Size: 185 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/joegasewicz/birman/actions/workflows/python-package.yml)
[](https://github.com/joegasewicz/birman/actions/workflows/python-publish.yml)# Birman
Multipart formdata decoder library.### Install
```
pip install birman
```### Get started
Decode multipart form data
```python
from birman import Decoder
# multipart_data = b'---- ...etc'decoder = Decoder(multipart_data)
result = decoder.decode()
```
This would return a normalized dict
```python
# example from params - [email protected]&password=wizard
# result -
{
"email": {
"name": "email",
"value": "[email protected]",
},
"password": {
"name": "password",
"value": "wizard",
},
}
```Parse URI form params
```python
from birman import Encoderarg = "[email protected]&password=wizard"
result = Encoder.parse_params(arg)
```
This would return a normalized dict
```python
# result -
{
"email": {
"name": "email",
"value": "[email protected]",
},
"password": {
"name": "password",
"value": "wizard",
},
}
```### Multipart Formdata
The decoder method will return file data extracted from the multipart formdata as a dict.```python
{
'name': 'logo',
'type': 'file',
'value': {
'filename': 'bobtail.png',
'mimetype': 'image/png',
'file_data': b'...',
'type': 'file',
}
```