Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Hizbqurater of the juz itself #79

Open
AbdelrhmanUZaki opened this issue Sep 20, 2023 · 2 comments
Open

add Hizbqurater of the juz itself #79

AbdelrhmanUZaki opened this issue Sep 20, 2023 · 2 comments
Assignees

Comments

@AbdelrhmanUZaki
Copy link

AbdelrhmanUZaki commented Sep 20, 2023

I tried to get the number of rub in any juz, but api didn't get that info, so I tried a lot and found this equation, so you can use it to add this addition info to the api in json.

"data": {
        "number": 65,
        "ayahs": [
            {
                "number": 1042,
                "text": "۞ قال الملأ الذين استكبروا من قومه لنخرجنك يا شعيب والذين آمنوا معك من قريتنا أو لتعودن في ملتنا ۚ قال أولو كنا كارهين",
                "surah": {
                    "number": 7,
                    "name": "سُورَةُ الأَعۡرَافِ",
                    "englishName": "Al-A'raaf",
                    "englishNameTranslation": "The Heights",
                    "revelationType": "Meccan",
                    "numberOfAyahs": 206
                },
                "numberInSurah": 88,
                "juz": 9,
                "manzil": 2,
                "page": 162,
                "ruku": 132,
                "hizbQuarter": 65,
                "sajda": false
            },

Its number in entire quran is 65 as shown in "hizbQuarter": 65
To get its number in its juz, do this equation

Rank_in_Juz = (hizbQuarter - ((juz - 1) * 8))
Rank_in_Juz = (65 - ((9 - 1) * 8))
print(Rank_in_Juz)
  • minus 1 => to get number fo juzs before current juz.
  • mult in 8 => to get all rub count before our juz
  • then we will subtract it from hizbQuarter, which will give us its order only in current juz

You could try above code with this simple python script

juz = int(input("input juz rank: "))
rub_rank = int(input("input rub rank in entire quran: "))
Rank_in_Juz = (rub_rank - ((juz - 1) * 8))
print(Rank_in_Juz)
x = input("press any button to exit")
@meezaan
Copy link
Member

meezaan commented Sep 21, 2023

I tried to get the number of rub in any juz, but api didn't get that info, so I tried a lot and found this equation, so you can use it to add this addition info to the api in json.

"data": {
        "number": 65,
        "ayahs": [
            {
                "number": 1042,
                "text": "۞ قال الملأ الذين استكبروا من قومه لنخرجنك يا شعيب والذين آمنوا معك من قريتنا أو لتعودن في ملتنا ۚ قال أولو كنا كارهين",
                "surah": {
                    "number": 7,
                    "name": "سُورَةُ الأَعۡرَافِ",
                    "englishName": "Al-A'raaf",
                    "englishNameTranslation": "The Heights",
                    "revelationType": "Meccan",
                    "numberOfAyahs": 206
                },
                "numberInSurah": 88,
                "juz": 9,
                "manzil": 2,
                "page": 162,
                "ruku": 132,
                "hizbQuarter": 65,
                "sajda": false
            },

Its number in entire quran is 65 as shown in "hizbQuarter": 65 To get its number in its juz, do this equation

Rank_in_Juz = (hizbQuarter - ((juz - 1) * 8))
Rank_in_Juz = (65 - ((9 - 1) * 8))
print(Rank_in_Juz)
  • minus 1 => to get number fo juzs before current juz.
  • mult in 8 => to get all rub count before our juz
  • then we will subtract it from hizbQuarter, which will give us its order only in current juz

You could try above code with this simple python script

juz = int(input("input juz rank: "))
rub_rank = int(input("input rub rank in entire quran: "))
Rank_in_Juz = (rub_rank - ((juz - 1) * 8))
print(Rank_in_Juz)
x = input("press any button to exit")

I will have a look, but https://api.alquran.cloud/v1/meta might be useful.

@AbdelrhmanUZaki
Copy link
Author

I tried to get the number of rub in any juz, but api didn't get that info, so I tried a lot and found this equation, so you can use it to add this addition info to the api in json.

"data": {
        "number": 65,
        "ayahs": [
            {
                "number": 1042,
                "text": "۞ قال الملأ الذين استكبروا من قومه لنخرجنك يا شعيب والذين آمنوا معك من قريتنا أو لتعودن في ملتنا ۚ قال أولو كنا كارهين",
                "surah": {
                    "number": 7,
                    "name": "سُورَةُ الأَعۡرَافِ",
                    "englishName": "Al-A'raaf",
                    "englishNameTranslation": "The Heights",
                    "revelationType": "Meccan",
                    "numberOfAyahs": 206
                },
                "numberInSurah": 88,
                "juz": 9,
                "manzil": 2,
                "page": 162,
                "ruku": 132,
                "hizbQuarter": 65,
                "sajda": false
            },

Its number in entire quran is 65 as shown in "hizbQuarter": 65 To get its number in its juz, do this equation

Rank_in_Juz = (hizbQuarter - ((juz - 1) * 8))
Rank_in_Juz = (65 - ((9 - 1) * 8))
print(Rank_in_Juz)
  • minus 1 => to get number fo juzs before current juz.
  • mult in 8 => to get all rub count before our juz
  • then we will subtract it from hizbQuarter, which will give us its order only in current juz

You could try above code with this simple python script

juz = int(input("input juz rank: "))
rub_rank = int(input("input rub rank in entire quran: "))
Rank_in_Juz = (rub_rank - ((juz - 1) * 8))
print(Rank_in_Juz)
x = input("press any button to exit")

I will have a look, but https://api.alquran.cloud/v1/meta might be useful.

mmm, NO I didn't find it useful -the meta url you provided
but which one I get required data is https://api.alquran.cloud/v1/hizbQuarter/65/quran-uthmani, which is fine till now.
Allah bless you

@meezaan meezaan self-assigned this Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants