Giter Site home page Giter Site logo

Comments (7)

klieret avatar klieret commented on September 27, 2024

Hi @CaptainDario, I think the field you're looking for is called cdeck :) All columns of the "cards" table are prefixed with c. Let me know if this works!

from ankipandas.

klieret avatar klieret commented on September 27, 2024

Ah, I just saw that the old closed issue references deck instead of cdeck (probably and earlier version of AnkiPandas). I'll add a note there, thanks for making me aware of this.

Thanks btw for providing such a complete issue report including all the logs and code and link :)

from ankipandas.

CaptainDario avatar CaptainDario commented on September 27, 2024

@klieret Thank you for your help!
With cdeck I can now iterate over all cards from a test-deck.

I added:

for cnt in range(t.shape[0]):
    print(t.iloc[cnt][19])

to print the back and front of a basic note (I guess there is a prettier way to do that...).

However I have problems accessing a nested deck.
The deck I want to access is nested like this:
"Sprachen" -> "Japanisch" -> "Japanisch Vokabeln"
when I try:

t = cards.query("cdeck == 'Japanisch Vokabeln'")

or

t = cards.query("cdeck == 'Sprachen::Japanisch::Japanisch Vokabeln'")

I get an empty deck.

What is the correct notation to access a nested deck?

from ankipandas.

klieret avatar klieret commented on September 27, 2024

Can you just check cards["cdeck"].unique() before the query? This should print all available deck names, so you'll probably find yours there.

I can also recommend you to simply do a pandas tutorial, this will probably help you a lot with these things :) (also for finding your way with accessing the content of the tables).

from ankipandas.

klieret avatar klieret commented on September 27, 2024

I can also highly recommend to run AnkiPandas in a Jupyter notebook. This will give you a graphical representation of the tables and lets you play around with it much more interactively

from ankipandas.

CaptainDario avatar CaptainDario commented on September 27, 2024

Thank you, a Pandas tutorial is overdue thats true...

I just read a little bit about pandas and could finally figure out how to get all notes from a deck. The separator for nested decks is \x1f.
This is just a small side project for one or two days, so thank you for saving my time budget with this very nice library!

from ankipandas.

klieret avatar klieret commented on September 27, 2024

That's good to know with the \x1f separator! I'll see if I add some documentation for that!

Good luck with your side project, don't hesitate if there are more questions :)

from ankipandas.

Related Issues (20)

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.