- Python >= 3.10
From source
-
Activate virtual environment (Optional)
python3 -m venv citydao.venv source citydao.venv/bin/activate
-
Install via
setup.py
python setup.py install
From pypi
TBD
There are 4 main usage for this repository
Prepare .env
files according to what was shown in .env.example
.
- Get google API key here
- Get twitter API key/secret here
- Get telegram API key for bot here
- Get Spotify Client ID and credentials here
🤖 Run a telegram bot
Please see example at run_bot.py
📟 Fetch latest tweets
from citydao.tweets import CityDAOTwitter
apikey = "your_twitter_apikey"
api_secret = "your_twitter_api_secret"
twitter = CityDAOTwitter(apikey, api_secret)
tweets = twitter.fetch_recent_tweets()
today_tweets = twitter.filter_today_tweets(tweets)
🗓 Fetch calendar events
from citydao.calendar import CityDAOCalendar
google_apikey = "your_google_api_key"
calendar = CityDAOCalendar(google_apikey=google_apikey)
today_events = calendar.get_today_events()
📻 Get CityDAO's Podcast Episodes
from citydao.spotify import CityDAOSpotify
spotify_client_id, spotify_client_credentials = "your_spotify_client_id", "your_spotify_credentials"
citydao_spotify = CityDAOSpotify(spotify_client_id, spotify_client_credentials)
episodes = citydao_spotify.get_latest_episodes()
🏦 Get current treasury balance
from citydao.treasury import CityDAOTreasury
treasury = CityDAOTreasury()
balance = treasury.get_balance()
# balance = {
# "WETH": XXX,
# "USDC": YYY,
# "ETH": ZZZ
# }
🗳 Get CityDAO's proposals
from citydao.snapshot import SnapshotAPI, ProposalStatus
snapshot = SnapshotAPI()
proposals = snapshot.get_proposals()
active_proposals = snapshot.get_proposals(status=ProposalStatus.ACTIVE)
closed_proposals = snapshot.get_proposals(status=ProposalStatus.CLOSED)
for proposal in proposals:
# get detailed votes for each proposal
votes = proposal.get_votes()
Feels free to fork this repository and create a pull request!
chompk.eth | Contribution DAO#9502