%global _empty_manifest_terminate_build 0 Name: python-twisted-fate Version: 0.1.5 Release: 1 Summary: An api wrapper around the Legends of Runeterra Client API with deck encoder implementation License: MIT URL: https://github.com/Snowcola/twisted_fate Source0: https://mirrors.nju.edu.cn/pypi/web/packages/87/bc/261abcb6efffc7c872d54c2c95b2a85614fe7de0498e759028d253418fd8/twisted_fate-0.1.5.tar.gz BuildArch: noarch Requires: python3-requests %description # twisted_fate A python api wrapper to for riot's Legends of Runterra client-api including a port of [Riot Games C# implementation of the deck encoder/decoder](https://github.com/RiotGames/LoRDeckCodes) # Install ``` pip install twisted_fate ``` ## Usage ### Create Deck from deck code ```python from twisted_fate import Deck draven_deck = Deck.decode("CEBAGAIDCQRSOCQBAQAQYDISDQTCOKBNGQAACAIBAMFQ") # results print(deck.cards) #[ # Card(01NX020, Name: Draven, Cost: 3), # Card(01NX035, Name: Draven's Biggest Fan, Cost: 1), # Card(01NX039, Name: Vision, Cost: 3), # Card(01PZ001, Name: Rummage, Cost: 1), # Card(01PZ012, Name: Flame Chompers!, Cost: 2), # Card(01PZ013, Name: Augmented Experimenter, Cost: 6), # Card(01PZ018, Name: Academy Prodigy, Cost: 2), # Card(01PZ028, Name: Jury-Rig, Cost: 1), # Card(01PZ038, Name: Sump Dredger, Cost: 2), # Card(01PZ039, Name: Get Excited!, Cost: 3), # Card(01PZ040, Name: Jinx, Cost: 4), # Card(01PZ045, Name: Zaunite Urchin, Cost: 1), # Card(01PZ052, Name: Mystic Shot, Cost: 2), # Card(01NX011, Name: Whirling Death, Cost: 3) # ] ``` ### Create Deck from cards list, (in the format of a response from the client api) ```python from twisted_fate import Deck # client api response deck = { "DeckCode":"CEBAGAIDCQRSOCQBAQAQYDISDQTCOKBNGQAACAIBAMFQ", "CardsInDeck": { "01NX020": 3, "01NX035": 3, "01NX039": 3, "01PZ001": 3, "01PZ012": 3, "01PZ013": 3, "01PZ018": 3, "01PZ028": 3, "01PZ038": 3, "01PZ039": 3, "01PZ040": 3, "01PZ045": 3, "01PZ052": 3, "01NX011": 1, }, } draven_deck = Deck(cards=deck["CardsInDeck"]) print(draven_deck.encode().deck_code) # result: CEBAGAIDCQRSOCQBAQAQYDISDQTCOKBNGQAACAIBAMFQ # or print(draven_deck.to_deck_code()) # result: CEBAGAIDCQRSOCQBAQAQYDISDQTCOKBNGQAACAIBAMFQ ``` %package -n python3-twisted-fate Summary: An api wrapper around the Legends of Runeterra Client API with deck encoder implementation Provides: python-twisted-fate BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-twisted-fate # twisted_fate A python api wrapper to for riot's Legends of Runterra client-api including a port of [Riot Games C# implementation of the deck encoder/decoder](https://github.com/RiotGames/LoRDeckCodes) # Install ``` pip install twisted_fate ``` ## Usage ### Create Deck from deck code ```python from twisted_fate import Deck draven_deck = Deck.decode("CEBAGAIDCQRSOCQBAQAQYDISDQTCOKBNGQAACAIBAMFQ") # results print(deck.cards) #[ # Card(01NX020, Name: Draven, Cost: 3), # Card(01NX035, Name: Draven's Biggest Fan, Cost: 1), # Card(01NX039, Name: Vision, Cost: 3), # Card(01PZ001, Name: Rummage, Cost: 1), # Card(01PZ012, Name: Flame Chompers!, Cost: 2), # Card(01PZ013, Name: Augmented Experimenter, Cost: 6), # Card(01PZ018, Name: Academy Prodigy, Cost: 2), # Card(01PZ028, Name: Jury-Rig, Cost: 1), # Card(01PZ038, Name: Sump Dredger, Cost: 2), # Card(01PZ039, Name: Get Excited!, Cost: 3), # Card(01PZ040, Name: Jinx, Cost: 4), # Card(01PZ045, Name: Zaunite Urchin, Cost: 1), # Card(01PZ052, Name: Mystic Shot, Cost: 2), # Card(01NX011, Name: Whirling Death, Cost: 3) # ] ``` ### Create Deck from cards list, (in the format of a response from the client api) ```python from twisted_fate import Deck # client api response deck = { "DeckCode":"CEBAGAIDCQRSOCQBAQAQYDISDQTCOKBNGQAACAIBAMFQ", "CardsInDeck": { "01NX020": 3, "01NX035": 3, "01NX039": 3, "01PZ001": 3, "01PZ012": 3, "01PZ013": 3, "01PZ018": 3, "01PZ028": 3, "01PZ038": 3, "01PZ039": 3, "01PZ040": 3, "01PZ045": 3, "01PZ052": 3, "01NX011": 1, }, } draven_deck = Deck(cards=deck["CardsInDeck"]) print(draven_deck.encode().deck_code) # result: CEBAGAIDCQRSOCQBAQAQYDISDQTCOKBNGQAACAIBAMFQ # or print(draven_deck.to_deck_code()) # result: CEBAGAIDCQRSOCQBAQAQYDISDQTCOKBNGQAACAIBAMFQ ``` %package help Summary: Development documents and examples for twisted-fate Provides: python3-twisted-fate-doc %description help # twisted_fate A python api wrapper to for riot's Legends of Runterra client-api including a port of [Riot Games C# implementation of the deck encoder/decoder](https://github.com/RiotGames/LoRDeckCodes) # Install ``` pip install twisted_fate ``` ## Usage ### Create Deck from deck code ```python from twisted_fate import Deck draven_deck = Deck.decode("CEBAGAIDCQRSOCQBAQAQYDISDQTCOKBNGQAACAIBAMFQ") # results print(deck.cards) #[ # Card(01NX020, Name: Draven, Cost: 3), # Card(01NX035, Name: Draven's Biggest Fan, Cost: 1), # Card(01NX039, Name: Vision, Cost: 3), # Card(01PZ001, Name: Rummage, Cost: 1), # Card(01PZ012, Name: Flame Chompers!, Cost: 2), # Card(01PZ013, Name: Augmented Experimenter, Cost: 6), # Card(01PZ018, Name: Academy Prodigy, Cost: 2), # Card(01PZ028, Name: Jury-Rig, Cost: 1), # Card(01PZ038, Name: Sump Dredger, Cost: 2), # Card(01PZ039, Name: Get Excited!, Cost: 3), # Card(01PZ040, Name: Jinx, Cost: 4), # Card(01PZ045, Name: Zaunite Urchin, Cost: 1), # Card(01PZ052, Name: Mystic Shot, Cost: 2), # Card(01NX011, Name: Whirling Death, Cost: 3) # ] ``` ### Create Deck from cards list, (in the format of a response from the client api) ```python from twisted_fate import Deck # client api response deck = { "DeckCode":"CEBAGAIDCQRSOCQBAQAQYDISDQTCOKBNGQAACAIBAMFQ", "CardsInDeck": { "01NX020": 3, "01NX035": 3, "01NX039": 3, "01PZ001": 3, "01PZ012": 3, "01PZ013": 3, "01PZ018": 3, "01PZ028": 3, "01PZ038": 3, "01PZ039": 3, "01PZ040": 3, "01PZ045": 3, "01PZ052": 3, "01NX011": 1, }, } draven_deck = Deck(cards=deck["CardsInDeck"]) print(draven_deck.encode().deck_code) # result: CEBAGAIDCQRSOCQBAQAQYDISDQTCOKBNGQAACAIBAMFQ # or print(draven_deck.to_deck_code()) # result: CEBAGAIDCQRSOCQBAQAQYDISDQTCOKBNGQAACAIBAMFQ ``` %prep %autosetup -n twisted-fate-0.1.5 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-twisted-fate -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Tue Apr 11 2023 Python_Bot - 0.1.5-1 - Package Spec generated