Skip to main content

Light-weight minimal API Fuzzer in Python

Project description

  _     _ _             _             
(_)   (_|_)           (_)            
 _     _ _  ___   ____ _ ____  _____ 
| |   | | |/ _ \ / ___) |  _ \(____ |
 \ \ / /| | |_| | |   | | | | / ___ |
  \___/ |_|\___/|_|   |_|_| |_\_____|
                                     
Light-weight minimal API Fuzzer in Python

Viorina is a minimalist, lightweight API-fuzzing tool.
Describe your payload once—Viorina generates compliant, random test data for you.

It stays tiny

  • Declarative schemas – Register any model with @Viorina.payload (FastAPI-style, zero boiler-plate).
  • Descriptor magic – Python’s descriptor protocol auto-wires parent/child fields, so you don’t have to.
  • Accurate text fuzzing – Uses the Rust crate regex-generate to create strings that match your exact pattern.

Examples

Use @app.payload to register

  • Describe your payload structure and call Viorina.build_dict() at the end
import viorina            # For `app = viorina.Viorina()`
from viorina import Auto  # For describing schema


app = viorina.Viorina()


# Use `app.payload` to register
@app.payload
class Root:           # ... its child node `BranchA` not defined yet ...
    BranchA = Auto()  # => {"Root": { "BranchA": { ... } } }
    Name = "Anji"     # => {"Root": { "Name": "Anji", "BranchA": { ... } } }
    

@app.payload
class BranchA:        # ... the node `BranchA` defined later ...
    Age = 233         # => { "BranchA": { "Age": 233 } }
    

p = app.build_dict()  # ... build payload

# 
# {'Root': 
#     {'Name': 'Anji', 
#      'BranchA': {'Age': 233}
#     }
# }

Use descriptors to generate random data for fuzz testing

  • Use Text, Integer, Auto descriptors to generate random mock values
from viorina import Text, Integer, Auto, Viorina


app = Viorina()


@app.payload
class Root:
    SomeNode = Auto()
    RandomValue = Integer(min_value=233, max_value=235)


@app.payload
class SomeNode:
    RandomName = Text(regex=r'[AEIOU][aeiou][rnmlv][aeiou]{2}')
    ChildNode = Auto()
    RandomValue = Integer(min_value=0, max_value=9)


@app.payload
class ChildNode:
    ConstValue: int = 233


if __name__ == "__main__":
    import pprint
    
    for _ in range(3):
        pprint.pp(app.build_dict())
        
# Output:
        
# {'Root': {'RandomValue': 235,
#           'SomeNode': {'RandomName': 'Eolee',
#                        'RandomValue': 5,
#                        'ChildNode': {'ConstValue': 233}}}}
# {'Root': {'RandomValue': 235,
#           'SomeNode': {'RandomName': 'Aarei',
#                        'RandomValue': 7,
#                        'ChildNode': {'ConstValue': 233}}}}
# {'Root': {'RandomValue': 234,
#           'SomeNode': {'RandomName': 'Uovai',
#                        'RandomValue': 1,
#                        'ChildNode': {'ConstValue': 233}}}}

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

viorina-0.1.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

viorina-0.1.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file viorina-0.1.0.tar.gz.

File metadata

  • Download URL: viorina-0.1.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for viorina-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ebfef1112a9925c0f2df013c3177170cf40d7a03b303cccf37bf70f65ab0cc68
MD5 0ed1f7bc597337da7f1ee627696ee9ad
BLAKE2b-256 8f971b23262900961b56820f8511e6f8bb9eed53a62984291cadb78459c0d78d

See more details on using hashes here.

File details

Details for the file viorina-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: viorina-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for viorina-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6033240568cd1ac9b9a6e34b6c4856f3b7dbd72ef2183240367b347d46e616d3
MD5 d04cc28d4ea5b8e24233f60a5c3e8b18
BLAKE2b-256 c9b0ee938be7457ad7f5b960f6f1e56a161076cb133ca63652bcaff6a11e6c67

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page