Giter Club home page Giter Club logo

bible_plus_dart's Introduction

Introduction

BiblePlus is a dart library to work with PDB bible files. It's heavily inspired by the bibleplus java library with improvement of implicit lazy loading and exception handling.

Example

See example/main.dart

import 'package:bible_plus/bible_plus.dart';

void main() {
  BiblePlus bible = new BiblePlus('/path/to/bible.pdb');
  try {
    bible.loadVersionInfo();
  } on Exception catch (e) {
    // Error
    print(e);
  }
  // At this point we can access some basic information,
  // such as the bible version name and version info.
  // We can also have the list of book names at this point.

  // Get the version name of the bible
  String versionName = bible.versionName;
  print(versionName); // => King James Version

  // Get the version info of the bible
  String versionInfo = bible.versionInfo;
  print(versionInfo);

  // Get the total number of books in the bible
  int bookCount = bible.totalBooks;
  print(bookCount); // => 66

  // Get the BibleBook object. The line below returns Genesis
  BibleBook bGen = bible.books[0];

  // Get the full name of the book
  String fullName = bGen.fullName;
  print(fullName); // => 'Genesis'

  // Get the shot name of the book
  String shortName = bGen.shortName;
  print(shortName); // => 'Gen'

  // Get the total number of chapters in the book
  int totalChapters = bGen.totalChapters;
  print(totalChapters); // => 50

  // Get the total number of verses in the chapter
  int chapter = 1;
  int totalVerses = bGen.getTotalVerses(chapter);
  print(totalVerses); // => 31

  // Get the verse text only
  int verse = 1;
  String verseText = bGen.getVerse(chapter, verse);
  print(verseText); // => 'In the beginning...'

  // Get the chapter title, or verse title, together with
  // the verse text. See the documentation of the return
  // value in BibleBook
  List<String> sb = bGen.getCompleteVerse(chapter, verse);
  print(sb.join('\n'));
  // => 'In the beginning...\n\nChapter 1\nGenesis'
}

API Doc

More detailed API documentation available here

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.