Skip to content

AlexKalopsia/mastodon-gender-distribution

 
 

Repository files navigation

Gender Distribution of Mastodon Connections and Followers

Note

The original tool was created by ajdavis for Twitter, before the free API got shut down.
I have adapted the original project to work with Mastodon.

Mastodon Proportional guesses the gender of your followers and those you follow by looking in their Mastodon profile names, bios, and extra fields for pronoun announcements like "she/her", or else guessing it based on first name.

Read the original author's article "72% Of The People I Follow On Twitter Are Men."

Install

This script requires Python 3.8, and the packages listed in requirements.txt.

py -m pip install -r requirements.txt

Deploy

The repo contains an example app_render.wsgi config useful when deploying to PythonAnywhere.

If you want to deploy to Railway, make sure you set the COOKIE_SECRET and DEPLOY_URL env variables.

Command-line

First and foremost, you need to login on your Mastodon instance, open your profile, and go on Preferences > Development > New Application. Pick a name, select read and profile permissions, and keep note of your Client key and Client secret, as you will need to input them in the terminal when asked.

py analyze.py alexkalopsia@mastodon.social

Pass a Mastodon user handle to analyze the accounts the user follows and their followers.
It supports formats such as alexkalopsia, @alexkalopsia, @[email protected] and [email protected].

Local server

Start a Flask server for testing:

Linux

COOKIE_SECRET=foo python3 server.py 8000

Windows

$env:COOKIE_SECRET="foo"; py server.py 8000

Test

From the repository root directory:

py -m unittest discover -v

About

Compare number of women, men, and nonbinary people among Mastodon connections and followers.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 64.9%
  • HTML 35.1%