Code Monkey home page Code Monkey logo

url-gen's Introduction

URL Generator

Overview

generate_valid_invalid_urls.py is a Python script for generating valid URLs by assembling URL components such as scheme, authority, path, query, and fragment, in accordance with RFC 3986 standards. It also includes a method for generating invalid URLs.

Features

Character Generation

  • Functions are designed to generate different types of characters needed for URLs, including percent-encoded characters, general delimiters, sub-delimiters, reserved, and unreserved characters.

Scheme Generation

  • Random URL schemes are generated, which are crucial for defining the protocol to be used.

Authority Component

  • Constructs the authority part, including user information, host (IPv4, IPv6, future IP versions), and port, essential for locating the resource.

Path Component

  • Generates paths in various forms, pivotal for specifying the resource location on the server.

Query and Fragment

  • Supports the creation of query and fragment components, used for providing additional data and navigating within a page.

Function Explanations Based on RFC 3986

  • Percent-encoding: Essential for encoding characters that may not be safely sent in URLs.
  • Scheme: Defines the protocol used for the URL, such as HTTP or HTTPS.
  • Authority: Specifies the domain name or IP address and port number, indicating the server.
  • Path: Identifies the specific resource within the server.
  • Query: Provides additional information to the server for resource retrieval.
  • Fragment: Allows direct access to a subsection of the resource.

Usage

  1. Installation: No external dependencies required.
  2. Execution: python generate_valid_invalid_urls.py
  3. Output: Prints 100 valid URLs to the console.

Customization

  • Adjust the N variable to change the number of URLs generated.
  • Modify maximum lengths for different components in their respective functions.

Contribution

Contributions are welcome for improvements or new features.

License

Open-sourced under the MIT License.

url-gen's People

Contributors

tracesofnuts avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.