Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/livioribeiro/dbf-dextractor
Extract and deserialize dbf files
https://github.com/livioribeiro/dbf-dextractor
Last synced: 12 days ago
JSON representation
Extract and deserialize dbf files
- Host: GitHub
- URL: https://github.com/livioribeiro/dbf-dextractor
- Owner: livioribeiro
- License: apache-2.0
- Created: 2020-05-02T22:04:45.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-05-04T11:57:44.000Z (over 4 years ago)
- Last Synced: 2024-11-23T15:38:04.249Z (30 days ago)
- Language: Rust
- Size: 41 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# dbf-dextractor
Extract data from dbf files and deserialize with serde.
## Usage
```rust
use std::collections::BTreeMap;use serde::Deserialize;
use dbf_dextractor::{Value, Date, Timestamp};
const DBF_FILE: &str = "/path/to/data.dbf";
const DBT_FILE: &str = "/path/to/data.dbt";#[derive(Deserialize, Debug)]
struct Record {
boolean: bool,
date: Date,
timestamp: Timestamp,
decimal: f64,
id: u32,
name: String,
note: Option,
}for record in dbf_dextractor::read(DBF_FILE, Some(DBT_FILE))? {
let record: Record = record?;
println!("{:#?}", record);
}let records: Vec>
= dbf_dextractor::read_values(DBF_FILE, Some(DBT_FILE))?
.collect::>()?;println!("{:#?}", records);
```