Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rubdos/twlib
A Python library that downloads the worlddata available on tribalwars.
https://github.com/rubdos/twlib
Last synced: about 2 months ago
JSON representation
A Python library that downloads the worlddata available on tribalwars.
- Host: GitHub
- URL: https://github.com/rubdos/twlib
- Owner: rubdos
- Created: 2015-01-23T16:48:37.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-01-23T16:56:56.000Z (almost 10 years ago)
- Last Synced: 2024-10-15T01:31:16.653Z (3 months ago)
- Language: Python
- Size: 152 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# twlib
A Python library that downloads the worlddata available on tribalwars. Tested on W41 on the Dutch TribalWars# Usage
````
import twlib.tribalwarsORM as twworld = tw.World.load("41", "tribalwars.nl")
# Now you can iterate over world.villages
# or world.players
# or world.tribes
# eg.
for player in world.players:
print player.name
````Please refer to the tribalwarsORM object specifications if you want to see what information can be fetched. Every object has references, which are managed in a local sqlite database. Eg.
````
for member in player.tribe.players:
print member.name
````
will print every member in a tribe of a player.
````
for village in player.villages:
print village.name
# This village will also refer to the owner using village.player
````The API is pretty much compatible with this library https://code.google.com/p/tribalwars/ , as I was using this before, but lacked the backreferences and implementing them would overhaul the whole library.