intrac

Crates.iointrac
lib.rsintrac
version
sourcesrc
created_at2024-12-04 01:13:13.729976
updated_at2024-12-04 01:13:13.729976
descriptionUnofficial library to track Easypack24/InPost shipments and parcels via their Web API.
homepage
repositoryhttps://gitlab.com/interop2/intrac
max_upload_size
id1470885
Cargo.toml error:TOML parse error at line 26, column 1 | 26 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Lorenzo D. M. (wpabaln)

documentation

README

Intrac

This is an unofficial tiny API client for Easypack24 v1 (InPost delivery services) that helps you track locker-to-locker deliveries of parcels on the aforementioned platforms.

The API endpoints used are public and don't require authentication at the time of writing. The full API docs are available at InPost Italy Developers.

As a library

You can use this crate as a library in your projects. It provides a fully async API and complete type definitions with doc comments.

Library Example

use intrac::InPostApiClient;

pub async fn print_shipment_status(shipment_id: &str /* 0123...888 */) -> Result<(), Box<dyn std::error::Error>> {
    let mut api_client = InPostApiClient::new("it" /* country code */)?;
    let shipment = api_client.lookup_shipment(shipment_id).await?;
    println!("Status: {}", shipment.status);
    // And many more fields, as found in the Shipment struct.
    Ok(())
}

As a command-line tool

You can also use this as a standalone application, to track your shipments. Simply invoke the executable (cargo build) or run it from the repo (cargo run -- ) with the shipment IDs as arguments. You must provide at least one ID, and they will be resolved in order.

CLI Example

# Query two shipments
./intrac 843534321829832368922940 863723273223883882932840
# Will output the following (truncated for brevity):
Shipment 843534321829832368922940
        Created at: 2024-12-02 14:10:03.098 UTC
        Updated at: 2024-12-03 15:03:32.077 UTC
        Type: inpost_locker_standard
        Service: inpost_locker_standard
        Status: sent_from_sorting_center
        Size: C
        End-of-week collection: no
        Drop-off machine:
                Name: ITTOR11684
                Machine type: ParcelLocker
                Address: C.so Filippo Turati 75, 10134 Torino
                Location: N45.04681, E7.66353 (presso CARREFOUR)
                24/7: yes
                Opening hours: 24/7
        Target machine:
                Name: ITVAR44848M
                Machine type: ParcelLocker
                Address: Via Giovanni Borghi 30/0, 21100 Varese
                Location: N45.83419, E8.79707 (Lidl)
                24/7: yes
        Event log:
                Date & time: 2024-12-03 15:03:32 UTC
                Status: adopted_at_source_branch
                Origin status: PWO
                ----------
                Date & time: 2024-12-03 14:38:26 UTC
                Status: taken_by_courier
                Origin status: CustomerSent
                Agency: MI2
                ----------
                Date & time: 2024-12-03 11:07:48 UTC
                Status: dispatched_by_sender
                Origin status: CustomerStored
                Agency: MI2
                ----------
                Date & time: 2024-12-02 14:10:03 UTC
                Status: confirmed
                Origin status: CustomerDelivering
                Agency: MI2
                ----------
Shipment 863723273223883882932840
        Created at: [...]

Not implemented yet

  • Authenticated requests: label creation, shipment creation, query by company
  • Points list
  • expected_flow in Shipment
  • location in TrackingEvent
Commit count: 9

cargo fmt