#url #parse-url #uri #urllib

urlparse

This is a URL parsing library like urllib.parse in Python3.x

5 releases

Uses old Rust 2015

0.7.3 Feb 13, 2016
0.7.2 Jan 13, 2016
0.7.1 Jan 7, 2016
0.7.0 Dec 25, 2015
0.6.0 Dec 24, 2015

#67 in #parse-url

Download history 6364/week @ 2024-11-15 5770/week @ 2024-11-22 7130/week @ 2024-11-29 6022/week @ 2024-12-06 4300/week @ 2024-12-13 3939/week @ 2024-12-20 2736/week @ 2024-12-27 4023/week @ 2025-01-03 3112/week @ 2025-01-10 4167/week @ 2025-01-17 4998/week @ 2025-01-24 4727/week @ 2025-01-31 4740/week @ 2025-02-07 4514/week @ 2025-02-14 4324/week @ 2025-02-21 3504/week @ 2025-02-28

17,951 downloads per month
Used in 29 crates (10 directly)

MIT license

18KB
302 lines

rust-urlparse

Build Status

This is a URL parsing library written in Rust.

The goal of this project is to provide a simple parsing URL library like urllib.parse in Python3.x.

Examples

Source code

extern crate urlparse;
use urlparse::urlparse;
use urlparse::GetQuery;  // Trait

fn main() {
    let url = urlparse("http://www.example.com/foo?bar=123&col=println%21%28%22TEST%21%22%29&col=sub");
    let query = url.get_parsed_query().unwrap();
    println!("{:?}", url);
    println!("{:?}", query.get_first_from_str("col"));
}

Output

Url { scheme: "http", netloc: "www.example.com", path: "/foo", query: Some("bar=123&col=println%21%28%22TEST%21%22%29&col=sub"), fragment: None, username: None, password: None, hostname: Some("www.example.com"), port: None }
Some("println!(\"TEST!\")")

License

MIT

Installation

If you're using Cargo, just add urlparse to your Cargo.toml:

[dependencies.urlparse]
version = "0.7.2"

Documentation

The documentation is hosted online.

No runtime deps