#uk #post #code #united #kingdom #postal-code

postcode

英国邮编和地理定位API

2个版本

0.1.1 2021年6月26日
0.1.0 2021年6月26日

#5 in #uk

Download history 20/week @ 2024-03-28 7/week @ 2024-04-04 16/week @ 2024-05-16 41/week @ 2024-05-23 74/week @ 2024-05-30 44/week @ 2024-06-06 21/week @ 2024-06-13

144 每月下载次数

GPL-3.0 许可证

15KB
221

postcode-rs

crates.io crates.io API

英国邮编和地理定位API。这是postcodes.io的API客户端。

postcode = "0.1.1"

示例

use postcode::Postcode;

#[async_std::main]
async fn main() {
    let code = "SW1W0NY";
    
    let post = Postcode::from_code(code).await.unwrap();

    println!("{} ({}, {}) -> ({}, {})", code, post.region, post.country, post.latitude, post.longitude);
}
SW1W0NY (London, England) -> (51.495373, -0.147421)

许可证

MIT License

Copyright (c) 2021 Grant Handy

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

依赖项

~6.5–9.5MB
~199K SLoC