Pienteger.QuranLib 7.0.1

dotnet add package Pienteger.QuranLib --version 7.0.1
NuGet\Install-Package Pienteger.QuranLib -Version 7.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Pienteger.QuranLib" Version="7.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Pienteger.QuranLib --version 7.0.1
#r "nuget: Pienteger.QuranLib, 7.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Pienteger.QuranLib as a Cake Addin
#addin nuget:?package=Pienteger.QuranLib&version=7.0.1

// Install Pienteger.QuranLib as a Cake Tool
#tool nuget:?package=Pienteger.QuranLib&version=7.0.1

Nuget Nuget

Quran Lib

A portable Quran library that gives read-only access to the entire Holy Quran.

Available Versions

  • .NET 7
  • .NET 6
  • .NET Framework 4.5

Installation

In the NuGet package manager console type -

Install-Package Pienteger.QuranLib

Or paste this code directly in the .csproj file.

<PackageReference Include="Pienteger.QuranLib" Version="7.0.1" />

Usage

using Pienteger.QuranLib;
QuranInstance quran = new QuranInstance();
quran.LoadChapters(1, 5);
Chapter? chapter = quran.GetChapter(1);
string randomAyah = chapter.Verses.ToList()[random.Next(0, chapter.TotalVerse)].Text;

API Documentation

Script Type

Two script types are available:

  1. ScriptType.Clean - The script is a clean script that does not contain any Harkat or Tashkeel.
  2. ScriptType.WithTashkil - The script is a script that contains Harkat and Tashkeel.

ScriptType.Clean is set to default. If you want to use ScriptType.WithTashkil, you can set it in the constructor.

Constructor Parameters

QuranInstance constructor has four parameters:

  • scriptType - The script type. (Default is set to ScriptType.Clean)
  • autoLoad - If true, the library will automatically load the chapters. (Default is set to false)
  • start and end - The start and end chapter numbers. (Default is set to 1 and 114. If autoLoad is true, the library will load chapters within this range.)

You can load chapters manually by calling LoadChapters method. Without loading chapters, the library will not be able to work properly. If the chapter is not loaded, the library will load it automatically when you call GetChapter method.

Methods

Method Description
LoadChapters(byte start = 1, byte end = 114) Loads chapters within the specified range.
GetChapterNames(byte start = 1, byte end = 114) Returns a list of chapter names.
GetBismillah() Returns Bismillahir Rahmanir Rahim in selected script
GetInTheNameOfAllah() Returns Bismillahir Rahmanir Rahim in selected script
GetChapter(ChapterName chapterName) Returns a Chapter object.
GetChapter(byte chapterNumber) Returns a Chapter object.
GetChapters(ChapterName[] chapterNames) Returns an ImmutableList<Chapter> object.
GetChapters(byte[] chapterNumbers) Returns an ImmutableList<Chapter> object.
GetChapters() Returns an ImmutableList<Chapter> object.
GetVerse(byte chapter, ushort verseNumber) Returns a Verse object.
GetVerse(ChapterName chapter, ushort verseNumber) Returns a Verse object.
GetVerses(ChapterName chapter) Returns an ImmutableList<Verse> object.
GetVerses(ushort chapterNumber) Returns an ImmutableList<Verse> object.
GetVerses(byte chapter, ushort startVerse, ushort endVerse) Returns an ImmutableList<Verse> object.
GetVerses(ChapterName chapter, ushort startVerse, ushort endVerse) Returns an ImmutableList<Verse> object.

All the text, and properties are read-only.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net7.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
7.0.1 276 10/24/2023
6.0.4 458 7/19/2022
6.0.3 460 4/22/2022
6.0.2 463 4/19/2022
6.0.1 441 4/19/2022
4.5.1 432 4/19/2022
4.5.0 428 4/19/2022
2.0.0 464 4/19/2022
1.0.0 456 4/18/2022

Now verse count can be retrieved from a surah without loading the surah.