Crates.io | opendatasoft-explore-api |
lib.rs | opendatasoft-explore-api |
version | 0.1.0 |
source | src |
created_at | 2023-01-18 07:17:34.099393 |
updated_at | 2023-01-18 07:17:34.099393 |
description | HTTP client for Opendatasoft Explore API v2 |
homepage | https://agora.nasqueron.org/Nasqueron_Datasources |
repository | https://devcentral.nasqueron.org/source/datasources/browse/main/opendatasoft-explore-api/ |
max_upload_size | |
id | 761568 |
size | 2,505,976 |
The crate opendatasoft-explore-api is an Opendatasoft Explore API v2 client, intended to be used in Rust projects to query any open data server using this software, such as the open data portal from French economy agency.
As the API is stable, this tool can be used to query metadata or records of open data portals from various companies and public administrations.
It's used at Nasqueron in the fantoir-datasource tool to query attachments information for the FANTOIR file and determine if a new file is available.
First, add opendatasoft-explore-api
to your Cargo.toml dependencies.
You also need an async implementation. Our code is tested with Tokio.
Then, you can create an instance of our ExploreApiEndPoint structure. It's then ready to query the API:
use opendatasoft_explore_api::requests::ExploreApiEndPoint;
static API_URL: &'static str = "https://data.economie.gouv.fr/api/v2";
static DATASET_ID: &'static str = "fichier-fantoir-des-voies-et-lieux-dits";
#[tokio::main]
async fn main() {
let endpoint = ExploreApiEndPoint::new(API_URL);
let dataset = endpoint.get_dataset_information(DATASET_ID).await;
println!("{:?}", dataset);
}
Documentation is available at https://docs.rs/opendatasoft-explore-api
A real-use example can also be found in the same repository in the fantoir-datasource/src/commands/fetch folder.
Source code is released under BSD-2-Clause license. (c) 2022-2023 Nasqueron project, some rights reserved.
Nasqueron is a free culture and open source project, not affiliated to the Opendatasoft company.
Note: the files in tests/requests/ used by integration tests describe datasets licensed under Licence Ouverte v2.0 (Etalab). They are NOT included in the compiled library.
Currently, this implementation doesn't cover:
Get in touch if you're interested either in implementing or if you need one of those. That will help us to prioritize those.
Project board for issues and features requests
Integration tests for requests are located in the tests/ folders.
The files in test/requests/ are cached from real queries made against the data.economie.gouv.fr API portal: https://data.economie.gouv.fr/api/v2/console