# How to get the number of cards due to today?

**URL:** <https://forums.ankiweb.net/t/how-to-get-the-number-of-cards-due-to-today/10658>\
**Category:** Development\
**Created:** [June 7, 2021, 11:26pm UTC](https://forums.ankiweb.net/t/how-to-get-the-number-of-cards-due-to-today/10658 "2021-06-07T23:26:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon75804304](https://avatars.discourse-cdn.com/v4/letter/a/82dd89/32.png) [@anon75804304](https://forums.ankiweb.net/u/anon75804304)\
**Post date:** [June 7, 2021, 11:26pm UTC](https://forums.ankiweb.net/t/how-to-get-the-number-of-cards-due-to-today/10658/1 "2021-06-07T23:26:06Z")

</div>

I’m a very beginner to addon writing and I’ve been having a hard time figuring this out. Is there a simple way to get the number of cards in total that I have due to today?

---

<div class="post-metadata">

**Author:** ![abdo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/abdo/32/654_2.png) [@abdo](https://forums.ankiweb.net/u/abdo)\
**Post date:** [June 8, 2021, 5:47pm UTC](https://forums.ankiweb.net/t/how-to-get-the-number-of-cards-due-to-today/10658/2 "2021-06-08T17:47:03Z")

</div>

Try `len(mw.col.find_cards('is:due'))`

---

<div class="post-metadata">

**Author:** ![anon75804304](https://avatars.discourse-cdn.com/v4/letter/a/82dd89/32.png) [@anon75804304](https://forums.ankiweb.net/u/anon75804304)\
**Post date:** [June 8, 2021, 6:11pm UTC](https://forums.ankiweb.net/t/how-to-get-the-number-of-cards-due-to-today/10658/3 "2021-06-08T18:11:22Z")

</div>

I was also able to get it using

```auto
for tree in mw.col.sched.deckDueTree():
     new += tree[4]
     lrn += tree[3]
     due += tree[2]
value = new + lrn + due

```

But your code is shorter, I’m gonna try it.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [May 1, 2023, 3:18am UTC](https://forums.ankiweb.net/t/how-to-get-the-number-of-cards-due-to-today/10658/4 "2023-05-01T03:18:06Z")

</div>


