Giter Site home page Giter Site logo

dbase's Introduction

dbase-parser: A dbaseIII/IV/foxpro iterative parser for rust

This crate provides the ability to read and parse dbf files, yielding typed objects as it goes. It is efficient, versatile, well-tested and, above all, maintained.

The motivation behind this is documented here. In particular, no parsing crate supported the memo (M) type, let alone the two variants of it.

Build Status Coverage Status

A disclaimer on versioning

As the crate is still under active development, versions may change relatively fast. Until we're at 1.x, consider the public API to be unstable.

In particular, the FieldValue enum may gain additional types as different DBF file formats surface.

Installation

Add dbase_parser to your dependencies.

Usage

Opening a file and streaming rows is a simple set of operations, as shown below:

extern crate dbase_parser;
use dbase_parser::{FieldValue, open};

let dbase_file = open("data.dbf");
let amount:f64 = dbase_file
  .map(|db| {
    db.into_iter().fold(0.0, |current, record| {
      record.get("amount").map(|value| match value {
        FieldValue::Numeric(value) => value.clone(),
        _ => 0.0
      }).unwrap_or(0.0)

  })
}).unwrap_or(0.0);

More options and types are available under the hood and exposed through the documentation.

Bugs

If you've found a bug or issue, don't hesitate to file an issue. If you are parsing a file, don't forget to attach it to your issue; make sure to anonymize the data if needed.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

dbase's People

Contributors

srenauld avatar

Stargazers

Sergey Antoninko avatar Marius Smit avatar Rod Gaither avatar

Watchers

James Cloos avatar  avatar Reg Meyer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.