fut is a simple library for managing Fifa Ultimate Team.
Project description
fut
===
.. image:: https://travis-ci.org/oczkers/fut.png?branch=master
:target: https://travis-ci.org/oczkers/fut
fut is a simple library for managing Fifa Ultimate Team.
It is written entirely in Python.
Documentation
-------------
Documentation will be available soon at http://fut.readthedocs.org/.
Players database: https://www.easports.com/uk/fifa/ultimate-team/fut/database
Players database (json): http://cdn.content.easports.com/fifa/fltOnlineAssets/B488919F-23B5-497F-9FC0-CACFB38863D0/2016/fut/items/web/players.json
Usage
-----
AutoBuyer GUI
`````````````
If You're looking for "user friendly" autobuyer take a look at hunterjm's project:
https://github.com/hunterjm/futgui/releases
Login
`````
Optional parameters:
- CODE: [string] email/sms code for two-step verification (make sure to use string if your codes starts with 0).
- PLATFORM: [pc/ps3/ps4/xbox/xbox360] pc default.
- EMULATE: [and/ios] use this feature to avoid webapp errors (BE WARE IT'S HIGH RISK).
- DEBUG: [True/False] enables debug.
- COOKIES: [filename] saves cookies after every request and load it from given file when restaring app (just like browser).
.. code-block:: python
>>> import fut
>>> fut = fut.Core('email', 'password', 'secret answer')
Search
``````
Optional parameters:
- LEVEL: ['?'/'?'/gold'] Card level.
- CATEGORY: ['fitness'/'?'] Card category.
- MIN_PRICE: [int] Minimal price.
- MAX_PRICE: [int] Maximum price.
- MIN_BUY: [int] Minimal buy now price.
- MAX_BUY: [int] Maximum buy now price.
- START: [int] Start page number.
- PAGE_SIZE: [int] Amount of cards on single page (changing this might be risky).
.. code-block:: python
>>> items = fut.searchAuctions('development')
Bid
```
.. code-block:: python
>>> fut.bid(items[0]['trade_id'], 600)
Sell
````
Optional parameters:
- BUY_NOW: [int] Buy now price.
- DURATION: [int] Auction duration in seconds (3600 default).
.. code-block:: python
>>> fut.sell(item['item_id'], 150)
Quick sell
``````````
single item:
.. code-block:: python
>>> item_id = 123456789
>>> fut.quickSell(item_id)
multiple items:
.. code-block:: python
>>> item_id = [123456789, 987654321]
>>> fut.quickSell(item_id)
Piles (Watchlist / Tradepile / Unassigned / Squad)
``````````````````````````````````````````````````
.. code-block:: python
>>> items = fut.tradepile()
>>> items = fut.unassigned()
>>> items = fut.squad()
>>> fut.sendToTradepile(trade_id, item_id) # add card to tradepile
>>> fut.sendToClub(trade_id, item_id) # add card to club
>>> fut.sendToWatchlist(trade_id) # add card to watchlist
>>> fut.tradepileDelete(trade_id) # removes item from tradepile
>>> fut.watchlistDelete(trade_id) # removes item from watch list (you can pass single str/ing or list/tuple of ids - like in quickSell)
>>> fut.tradepile_size # tradepile size (slots)
80
>> len(fut.tradepile()) # tradepile fulfilment (number of cards in tradepile)
20
>>> fut.watchlist_size # watchlist size (slots)
30
>> len(fut.watchlist()) # watchlist fulfilment (number of cards in watchlist)
10
Credits
```````
It's cached on every request so if you want the most accurate info call fut.keppalive()
.. code-block:: python
>>> fut.credits
600
Relist
``````
Relists all expired cards in tradepile.
.. code-block:: python
>>> fut.relist() # relist all expired cards in tradepile
Card stats and definiction IDs
``````````````````````````````
Returns stats and definition IDs for each card variation.
.. code-block:: python
>>> fut.searchDefinition(asset_id, start=0, count=35)
Convert Team/League/Nation id to name
`````````````````````````````````````
.. code-block:: python
>>> fut.nations[1]
Albania
>>> fut.leagues[1]
Alka Superliga
>>> fut.teams[1]
Arsenal
Keepalive
`````````
Sends keepalive ping and returns current credits amount (you have to make at least one request every ~10 minutes to avoid session expire/logout).
.. code-block:: python
>>> fut.keepalive()
650
Logout
``````
Logs out nicely (like clicking on logout button).
.. code-block:: python
>>> fut.logout()
Item object (dict) structure
````````````````````````````
.. code-block:: python
>>> for item in items:
... trade_id = item['tradeId']
... buy_now_price = item['buyNowPrice']
... trade_state = item['tradeState']
... bid_state = item['bidState']
... starting_bid = i['startingBid']
... item_id = i['id']
... timestamp = i['timestamp'] # auction start
... rating = i['rating']
... asset_id = i['assetId']
... resource_id = i['resourceId']
... item_state = i['itemState']
... rareflag = i['rareflag']
... formation = i['formation']
... injury_type = i['injuryType']
... suspension = i['suspension']
... contract = i['contract']
... playStyle = i['playStyle'] # used only for players
... discardValue = i['discardValue']
... itemType = i['itemType']
... owners = i['owners']
... offers = i['offers']
... current_bid = i['currentBid']
... expires = i['expires'] # seconds left
to be continued ;-)
Problems
--------
Somehow i've sent card to full tradepile and it disappeared
`````````````
Make space in tradepile and just call one command to restore it:
.. code-block:: python
fut.sendToTradepile(-1, id)
I've card with None tradeId so cannot move/trade it
```````````````````````````````````````````````````
Make space in tradepile and just call one command to restore it:
.. code-block:: python
fut.sendToTradepile(-1, id)
CLI examples
------------
.. code-block:: bash
not yet
...
License
-------
GNU GPLv3
.. :changelog:
Changelog
---------
0.1.7 (2015-11-30)
++++++++++++++++++
* core: fix baseId calculation (thanks to hunterjm #174)
0.1.6 (2015-11-19)
++++++++++++++++++
* core: store credits after every call instead of making an additional call out
0.1.5 (2015-11-15)
++++++++++++++++++
* core: fix club (thanks to hunterjm #169)
0.1.4 (2015-10-29)
++++++++++++++++++
* core: fix itemParse (thanks to hunterjm #163)
0.1.3 (2015-10-28)
++++++++++++++++++
* core: bump clientversion for android/ios emulation
* core: add tradeStatus (thanks to hunterjm #161)
* exceptions: add code, reason, string to FutError
0.1.2 (2015-09-28)
++++++++++++++++++
* core: fix baseId calculation
* support app authentication (#147)
0.1.1 (2015-09-19)
++++++++++++++++++
* fix for ps/xbox
0.1.0 (2015-09-17)
++++++++++++++++++
* fifa 16
* core: update credits only on demand
* config: update user-agent (chrome 45 @ win10)
0.0.24 (2015-02-11)
+++++++++++++++++++
* core: fix #135 type conversion in quickSell & watchlistDelete
* core: rename parameter squad_num to squad_id
0.0.23 (2015-02-09)
+++++++++++++++++++
* urls: fix #131
* Captcha exception got img & token parameter
* core: add logout
* core: quickSell & watchlistDelete accepts now int/str or tuple/list with multiple ids
* urls: enable ssl for all urls
* core & urls: add timestamp dynamically (just right before every request)
0.0.22 (2014-12-28)
+++++++++++++++++++
* setup: fix manifest
* core: save session if code is not provided but required
0.0.21 (2014-12-13)
+++++++++++++++++++
* two-step verification
* fix cookies parameter not working (#99)
* core: use LWPCookieJar instead of pickle
* core: fix logging in __sendToPile__
0.0.20 (2014-10-19)
+++++++++++++++++++
* fix typo
0.0.19 (2014-10-19)
+++++++++++++++++++
* core: update old fut14 urls
* core: add cookies feature (save cookies after every request and load it when restaring app like browser)
* core: add saveSession, searchDefinition
* core: log sendToPile action
0.0.18 (2014-10-01)
+++++++++++++++++++
* core: add methods to list and delete available messages (thanks to jamslater)
* core: rework base id from resource id calculation, use new constant (thanks to jamslater)
* core: update android * ios clientVersion (9->11)
0.0.17 (2014-09-22)
+++++++++++++++++++
* rename project (fut14->fut)
* fut15 (drop support for fifa 14)
0.0.16 (2014-08-31)
+++++++++++++++++++
* #76 fix buying (thanks to arthurnn)
0.0.15 (2014-08-29)
+++++++++++++++++++
* add new exceptions: doLoginFail, MaxSessions, Captcha
* add changelog
* NullHandler is default logging handler
* core: bump clientVersion (8->9)
0.0.14 (2014-07-06)
+++++++++++++++++++
* core: relist returns number of delted/sold if clean parameter was set
* add new exception FeatureDisabled
* core: add emulate
* core: add stats
* core: add clubInfo
0.0.13 (2014-04-19)
+++++++++++++++++++
* core: add sendToWatchlist
0.0.12 (2014-02-23)
+++++++++++++++++++
* exceptions: add Unauthorized & MultipleSession
* fix quicksell
0.0.11 (2014-02-15)
+++++++++++++++++++
* fix logger
* setup.py is now executable
0.0.10 (2014-02-15)
+++++++++++++++++++
* core: add clean ability to relist (remove sold cards)
* core: keepalive returns credit amount
0.0.9 (2014-01-26)
++++++++++++++++++
* fix relist
0.0.8 (2014-01-26)
++++++++++++++++++
* add new exception Conflict
* init docs
* core: add relist
* core: add sendToClub
0.0.7 (2014-01-13)
++++++++++++++++++
* add few exceptions
0.0.6 (2013-12-30)
++++++++++++++++++
* core: add DEBUG feature
* add multiplatform support (xbox/ps3/and/ios)
0.0.5 (2013-12-23)
++++++++++++++++++
* core: add assetId param to searchAuction method
* core: add pileSize
* core: add leagueId to item data parser
0.0.4 (2013-11-10)
++++++++++++++++++
* convert lowercase function/method names to mixedCase (send_to_tradepile -> sendToTradepile)
* drop python-2.5 (requests)
* core: python 3 support
0.0.3 (2013-10-25)
++++++++++++++++++
* core: move requests session init & headers from login to init
* core: update credits on every request (only if it is avaible included in response)
0.0.2 (2013-10-17)
++++++++++++++++++
* core: add watchlist
* core: add card_info function
* core: add alias for base_id & card_info
0.0.1 (2013-10-15)
++++++++++++++++++
* init
===
.. image:: https://travis-ci.org/oczkers/fut.png?branch=master
:target: https://travis-ci.org/oczkers/fut
fut is a simple library for managing Fifa Ultimate Team.
It is written entirely in Python.
Documentation
-------------
Documentation will be available soon at http://fut.readthedocs.org/.
Players database: https://www.easports.com/uk/fifa/ultimate-team/fut/database
Players database (json): http://cdn.content.easports.com/fifa/fltOnlineAssets/B488919F-23B5-497F-9FC0-CACFB38863D0/2016/fut/items/web/players.json
Usage
-----
AutoBuyer GUI
`````````````
If You're looking for "user friendly" autobuyer take a look at hunterjm's project:
https://github.com/hunterjm/futgui/releases
Login
`````
Optional parameters:
- CODE: [string] email/sms code for two-step verification (make sure to use string if your codes starts with 0).
- PLATFORM: [pc/ps3/ps4/xbox/xbox360] pc default.
- EMULATE: [and/ios] use this feature to avoid webapp errors (BE WARE IT'S HIGH RISK).
- DEBUG: [True/False] enables debug.
- COOKIES: [filename] saves cookies after every request and load it from given file when restaring app (just like browser).
.. code-block:: python
>>> import fut
>>> fut = fut.Core('email', 'password', 'secret answer')
Search
``````
Optional parameters:
- LEVEL: ['?'/'?'/gold'] Card level.
- CATEGORY: ['fitness'/'?'] Card category.
- MIN_PRICE: [int] Minimal price.
- MAX_PRICE: [int] Maximum price.
- MIN_BUY: [int] Minimal buy now price.
- MAX_BUY: [int] Maximum buy now price.
- START: [int] Start page number.
- PAGE_SIZE: [int] Amount of cards on single page (changing this might be risky).
.. code-block:: python
>>> items = fut.searchAuctions('development')
Bid
```
.. code-block:: python
>>> fut.bid(items[0]['trade_id'], 600)
Sell
````
Optional parameters:
- BUY_NOW: [int] Buy now price.
- DURATION: [int] Auction duration in seconds (3600 default).
.. code-block:: python
>>> fut.sell(item['item_id'], 150)
Quick sell
``````````
single item:
.. code-block:: python
>>> item_id = 123456789
>>> fut.quickSell(item_id)
multiple items:
.. code-block:: python
>>> item_id = [123456789, 987654321]
>>> fut.quickSell(item_id)
Piles (Watchlist / Tradepile / Unassigned / Squad)
``````````````````````````````````````````````````
.. code-block:: python
>>> items = fut.tradepile()
>>> items = fut.unassigned()
>>> items = fut.squad()
>>> fut.sendToTradepile(trade_id, item_id) # add card to tradepile
>>> fut.sendToClub(trade_id, item_id) # add card to club
>>> fut.sendToWatchlist(trade_id) # add card to watchlist
>>> fut.tradepileDelete(trade_id) # removes item from tradepile
>>> fut.watchlistDelete(trade_id) # removes item from watch list (you can pass single str/ing or list/tuple of ids - like in quickSell)
>>> fut.tradepile_size # tradepile size (slots)
80
>> len(fut.tradepile()) # tradepile fulfilment (number of cards in tradepile)
20
>>> fut.watchlist_size # watchlist size (slots)
30
>> len(fut.watchlist()) # watchlist fulfilment (number of cards in watchlist)
10
Credits
```````
It's cached on every request so if you want the most accurate info call fut.keppalive()
.. code-block:: python
>>> fut.credits
600
Relist
``````
Relists all expired cards in tradepile.
.. code-block:: python
>>> fut.relist() # relist all expired cards in tradepile
Card stats and definiction IDs
``````````````````````````````
Returns stats and definition IDs for each card variation.
.. code-block:: python
>>> fut.searchDefinition(asset_id, start=0, count=35)
Convert Team/League/Nation id to name
`````````````````````````````````````
.. code-block:: python
>>> fut.nations[1]
Albania
>>> fut.leagues[1]
Alka Superliga
>>> fut.teams[1]
Arsenal
Keepalive
`````````
Sends keepalive ping and returns current credits amount (you have to make at least one request every ~10 minutes to avoid session expire/logout).
.. code-block:: python
>>> fut.keepalive()
650
Logout
``````
Logs out nicely (like clicking on logout button).
.. code-block:: python
>>> fut.logout()
Item object (dict) structure
````````````````````````````
.. code-block:: python
>>> for item in items:
... trade_id = item['tradeId']
... buy_now_price = item['buyNowPrice']
... trade_state = item['tradeState']
... bid_state = item['bidState']
... starting_bid = i['startingBid']
... item_id = i['id']
... timestamp = i['timestamp'] # auction start
... rating = i['rating']
... asset_id = i['assetId']
... resource_id = i['resourceId']
... item_state = i['itemState']
... rareflag = i['rareflag']
... formation = i['formation']
... injury_type = i['injuryType']
... suspension = i['suspension']
... contract = i['contract']
... playStyle = i['playStyle'] # used only for players
... discardValue = i['discardValue']
... itemType = i['itemType']
... owners = i['owners']
... offers = i['offers']
... current_bid = i['currentBid']
... expires = i['expires'] # seconds left
to be continued ;-)
Problems
--------
Somehow i've sent card to full tradepile and it disappeared
`````````````
Make space in tradepile and just call one command to restore it:
.. code-block:: python
fut.sendToTradepile(-1, id)
I've card with None tradeId so cannot move/trade it
```````````````````````````````````````````````````
Make space in tradepile and just call one command to restore it:
.. code-block:: python
fut.sendToTradepile(-1, id)
CLI examples
------------
.. code-block:: bash
not yet
...
License
-------
GNU GPLv3
.. :changelog:
Changelog
---------
0.1.7 (2015-11-30)
++++++++++++++++++
* core: fix baseId calculation (thanks to hunterjm #174)
0.1.6 (2015-11-19)
++++++++++++++++++
* core: store credits after every call instead of making an additional call out
0.1.5 (2015-11-15)
++++++++++++++++++
* core: fix club (thanks to hunterjm #169)
0.1.4 (2015-10-29)
++++++++++++++++++
* core: fix itemParse (thanks to hunterjm #163)
0.1.3 (2015-10-28)
++++++++++++++++++
* core: bump clientversion for android/ios emulation
* core: add tradeStatus (thanks to hunterjm #161)
* exceptions: add code, reason, string to FutError
0.1.2 (2015-09-28)
++++++++++++++++++
* core: fix baseId calculation
* support app authentication (#147)
0.1.1 (2015-09-19)
++++++++++++++++++
* fix for ps/xbox
0.1.0 (2015-09-17)
++++++++++++++++++
* fifa 16
* core: update credits only on demand
* config: update user-agent (chrome 45 @ win10)
0.0.24 (2015-02-11)
+++++++++++++++++++
* core: fix #135 type conversion in quickSell & watchlistDelete
* core: rename parameter squad_num to squad_id
0.0.23 (2015-02-09)
+++++++++++++++++++
* urls: fix #131
* Captcha exception got img & token parameter
* core: add logout
* core: quickSell & watchlistDelete accepts now int/str or tuple/list with multiple ids
* urls: enable ssl for all urls
* core & urls: add timestamp dynamically (just right before every request)
0.0.22 (2014-12-28)
+++++++++++++++++++
* setup: fix manifest
* core: save session if code is not provided but required
0.0.21 (2014-12-13)
+++++++++++++++++++
* two-step verification
* fix cookies parameter not working (#99)
* core: use LWPCookieJar instead of pickle
* core: fix logging in __sendToPile__
0.0.20 (2014-10-19)
+++++++++++++++++++
* fix typo
0.0.19 (2014-10-19)
+++++++++++++++++++
* core: update old fut14 urls
* core: add cookies feature (save cookies after every request and load it when restaring app like browser)
* core: add saveSession, searchDefinition
* core: log sendToPile action
0.0.18 (2014-10-01)
+++++++++++++++++++
* core: add methods to list and delete available messages (thanks to jamslater)
* core: rework base id from resource id calculation, use new constant (thanks to jamslater)
* core: update android * ios clientVersion (9->11)
0.0.17 (2014-09-22)
+++++++++++++++++++
* rename project (fut14->fut)
* fut15 (drop support for fifa 14)
0.0.16 (2014-08-31)
+++++++++++++++++++
* #76 fix buying (thanks to arthurnn)
0.0.15 (2014-08-29)
+++++++++++++++++++
* add new exceptions: doLoginFail, MaxSessions, Captcha
* add changelog
* NullHandler is default logging handler
* core: bump clientVersion (8->9)
0.0.14 (2014-07-06)
+++++++++++++++++++
* core: relist returns number of delted/sold if clean parameter was set
* add new exception FeatureDisabled
* core: add emulate
* core: add stats
* core: add clubInfo
0.0.13 (2014-04-19)
+++++++++++++++++++
* core: add sendToWatchlist
0.0.12 (2014-02-23)
+++++++++++++++++++
* exceptions: add Unauthorized & MultipleSession
* fix quicksell
0.0.11 (2014-02-15)
+++++++++++++++++++
* fix logger
* setup.py is now executable
0.0.10 (2014-02-15)
+++++++++++++++++++
* core: add clean ability to relist (remove sold cards)
* core: keepalive returns credit amount
0.0.9 (2014-01-26)
++++++++++++++++++
* fix relist
0.0.8 (2014-01-26)
++++++++++++++++++
* add new exception Conflict
* init docs
* core: add relist
* core: add sendToClub
0.0.7 (2014-01-13)
++++++++++++++++++
* add few exceptions
0.0.6 (2013-12-30)
++++++++++++++++++
* core: add DEBUG feature
* add multiplatform support (xbox/ps3/and/ios)
0.0.5 (2013-12-23)
++++++++++++++++++
* core: add assetId param to searchAuction method
* core: add pileSize
* core: add leagueId to item data parser
0.0.4 (2013-11-10)
++++++++++++++++++
* convert lowercase function/method names to mixedCase (send_to_tradepile -> sendToTradepile)
* drop python-2.5 (requests)
* core: python 3 support
0.0.3 (2013-10-25)
++++++++++++++++++
* core: move requests session init & headers from login to init
* core: update credits on every request (only if it is avaible included in response)
0.0.2 (2013-10-17)
++++++++++++++++++
* core: add watchlist
* core: add card_info function
* core: add alias for base_id & card_info
0.0.1 (2013-10-15)
++++++++++++++++++
* init
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fut-0.1.7.tar.gz
(37.0 kB
view hashes)